From 8585586a484ca41496d3a034ce89c69943372b1b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 12 May 2025 02:57:53 +0000 Subject: [PATCH] CodeGen from PR 34346 in Azure/azure-rest-api-specs Merge 8c669f8e3a380ac9f02fddd035e578b7a85cf6d9 into 5802c95f18bfba1003be50e545d07f8bb679c857 --- .../azure-resourcemanager-avs/CHANGELOG.md | 1009 ++- sdk/avs/azure-resourcemanager-avs/README.md | 12 +- sdk/avs/azure-resourcemanager-avs/SAMPLE.md | 2555 +++--- sdk/avs/azure-resourcemanager-avs/pom.xml | 16 +- .../azure/resourcemanager/avs/AvsManager.java | 239 +- .../avs/fluent/AddonsClient.java | 2 +- .../avs/fluent/AuthorizationsClient.java | 2 +- .../resourcemanager/avs/fluent/AvsClient.java | 109 +- .../avs/fluent/CloudLinksClient.java | 2 +- .../avs/fluent/ClustersClient.java | 10 +- .../avs/fluent/DatastoresClient.java | 2 +- .../fluent/GlobalReachConnectionsClient.java | 2 +- .../avs/fluent/HcxEnterpriseSitesClient.java | 2 +- .../avs/fluent/HostsClient.java | 79 + .../avs/fluent/IscsiPathsClient.java | 38 +- .../avs/fluent/LocationsClient.java | 36 +- .../avs/fluent/OperationsClient.java | 2 +- .../avs/fluent/PlacementPoliciesClient.java | 10 +- .../avs/fluent/PrivateCloudsClient.java | 106 +- .../avs/fluent/ProvisionedNetworksClient.java | 74 + .../avs/fluent/ScriptCmdletsClient.java | 2 +- .../avs/fluent/ScriptExecutionsClient.java | 2 +- .../avs/fluent/ScriptPackagesClient.java | 2 +- .../avs/fluent/SkusClient.java | 38 + .../avs/fluent/VirtualMachinesClient.java | 10 +- .../avs/fluent/WorkloadNetworksClient.java | 426 +- .../avs/fluent/models/AddonInner.java | 2 +- .../fluent/models/AdminCredentialsInner.java | 4 +- .../avs/fluent/models/CloudLinkInner.java | 75 +- .../avs/fluent/models/ClusterInner.java | 121 +- .../models/ClusterUpdateProperties.java | 2 +- .../fluent/models/ClusterZoneListInner.java | 19 +- .../avs/fluent/models/DatastoreInner.java | 124 +- .../ExpressRouteAuthorizationInner.java | 83 +- .../models/GlobalReachConnectionInner.java | 137 +- .../fluent/models/HcxEnterpriseSiteInner.java | 65 +- .../avs/fluent/models/HostModelInner.java | 195 + .../avs/fluent/models/IscsiPathInner.java | 65 +- .../avs/fluent/models/OperationInner.java | 31 +- .../fluent/models/PlacementPolicyInner.java | 2 +- .../PlacementPolicyUpdateProperties.java | 2 +- .../avs/fluent/models/PrivateCloudInner.java | 471 +- .../models/PrivateCloudUpdateProperties.java | 2 +- .../models/ProvisionedNetworkInner.java | 155 + .../avs/fluent/models/QuotaInner.java | 4 +- .../avs/fluent/models/ResourceSkuInner.java | 262 + .../avs/fluent/models/ScriptCmdletInner.java | 73 +- .../fluent/models/ScriptExecutionInner.java | 288 +- .../avs/fluent/models/ScriptPackageInner.java | 69 +- .../avs/fluent/models/TrialInner.java | 4 +- .../fluent/models/VirtualMachineInner.java | 70 +- .../models/WorkloadNetworkDhcpInner.java | 2 +- .../WorkloadNetworkDnsServiceInner.java | 192 +- .../models/WorkloadNetworkDnsZoneInner.java | 181 +- .../models/WorkloadNetworkGatewayInner.java | 69 +- .../fluent/models/WorkloadNetworkInner.java | 33 +- .../WorkloadNetworkPortMirroringInner.java | 168 +- .../models/WorkloadNetworkPublicIpInner.java | 97 +- .../models/WorkloadNetworkSegmentInner.java | 156 +- .../models/WorkloadNetworkVMGroupInner.java | 122 +- .../WorkloadNetworkVirtualMachineInner.java | 70 +- .../avs/fluent/models/package-info.java | 4 +- .../avs/fluent/package-info.java | 4 +- .../avs/implementation/AddonImpl.java | 2 +- .../avs/implementation/AddonsClientImpl.java | 521 +- .../avs/implementation/AddonsImpl.java | 2 +- .../implementation/AdminCredentialsImpl.java | 2 +- .../AuthorizationsClientImpl.java | 555 +- .../implementation/AuthorizationsImpl.java | 2 +- .../avs/implementation/AvsClientBuilder.java | 28 +- .../avs/implementation/AvsClientImpl.java | 270 +- .../avs/implementation/CloudLinkImpl.java | 25 +- .../implementation/CloudLinksClientImpl.java | 528 +- .../avs/implementation/CloudLinksImpl.java | 2 +- .../avs/implementation/ClusterImpl.java | 60 +- .../implementation/ClusterZoneListImpl.java | 2 +- .../implementation/ClustersClientImpl.java | 771 +- .../avs/implementation/ClustersImpl.java | 4 +- .../avs/implementation/DatastoreImpl.java | 46 +- .../implementation/DatastoresClientImpl.java | 574 +- .../avs/implementation/DatastoresImpl.java | 2 +- .../ExpressRouteAuthorizationImpl.java | 28 +- .../GlobalReachConnectionImpl.java | 47 +- .../GlobalReachConnectionsClientImpl.java | 554 +- .../GlobalReachConnectionsImpl.java | 2 +- .../implementation/HcxEnterpriseSiteImpl.java | 26 +- .../HcxEnterpriseSitesClientImpl.java | 445 +- .../HcxEnterpriseSitesImpl.java | 2 +- .../avs/implementation/HostModelImpl.java | 65 + .../avs/implementation/HostsClientImpl.java | 508 ++ .../avs/implementation/HostsImpl.java | 70 + .../avs/implementation/IscsiPathImpl.java | 103 +- .../implementation/IscsiPathsClientImpl.java | 620 +- .../avs/implementation/IscsiPathsImpl.java | 107 +- .../implementation/LocationsClientImpl.java | 228 +- .../avs/implementation/LocationsImpl.java | 26 +- .../avs/implementation/OperationImpl.java | 2 +- .../implementation/OperationsClientImpl.java | 135 +- .../avs/implementation/OperationsImpl.java | 2 +- .../PlacementPoliciesClientImpl.java | 773 +- .../implementation/PlacementPoliciesImpl.java | 2 +- .../implementation/PlacementPolicyImpl.java | 2 +- .../avs/implementation/PrivateCloudImpl.java | 225 +- .../PrivateCloudsClientImpl.java | 1402 ++-- .../avs/implementation/PrivateCloudsImpl.java | 50 +- .../ProvisionedNetworkImpl.java | 50 + .../ProvisionedNetworksClientImpl.java | 493 ++ .../ProvisionedNetworksImpl.java | 70 + .../avs/implementation/QuotaImpl.java | 2 +- .../implementation/ResourceManagerUtils.java | 2 +- .../avs/implementation/ResourceSkuImpl.java | 89 + .../avs/implementation/ScriptCmdletImpl.java | 37 +- .../ScriptCmdletsClientImpl.java | 287 +- .../avs/implementation/ScriptCmdletsImpl.java | 2 +- .../implementation/ScriptExecutionImpl.java | 146 +- .../ScriptExecutionsClientImpl.java | 637 +- .../implementation/ScriptExecutionsImpl.java | 2 +- .../avs/implementation/ScriptPackageImpl.java | 28 +- .../ScriptPackagesClientImpl.java | 259 +- .../implementation/ScriptPackagesImpl.java | 2 +- .../avs/implementation/SkusClientImpl.java | 295 + .../avs/implementation/SkusImpl.java | 44 + .../avs/implementation/TrialImpl.java | 2 +- .../implementation/VirtualMachineImpl.java | 29 +- .../VirtualMachinesClientImpl.java | 465 +- .../implementation/VirtualMachinesImpl.java | 2 +- .../WorkloadNetworkDhcpImpl.java | 35 +- .../WorkloadNetworkDnsServiceImpl.java | 102 +- .../WorkloadNetworkDnsZoneImpl.java | 100 +- .../WorkloadNetworkGatewayImpl.java | 20 +- .../implementation/WorkloadNetworkImpl.java | 12 +- .../WorkloadNetworkPortMirroringImpl.java | 88 +- .../WorkloadNetworkPublicIpImpl.java | 53 +- .../WorkloadNetworkSegmentImpl.java | 88 +- .../WorkloadNetworkVMGroupImpl.java | 73 +- .../WorkloadNetworkVirtualMachineImpl.java | 21 +- .../WorkloadNetworksClientImpl.java | 7274 ++++++++++------- .../implementation/WorkloadNetworksImpl.java | 587 +- .../models/AddonList.java | 32 +- .../models/CloudLinkList.java | 32 +- .../models/ClusterList.java | 32 +- .../models/DatastoreList.java | 32 +- .../models/ExpressRouteAuthorizationList.java | 32 +- .../models/GlobalReachConnectionList.java | 32 +- .../models/HcxEnterpriseSiteList.java | 32 +- .../implementation/models/HostListResult.java | 112 + .../models/IscsiPathListResult.java | 32 +- .../models/OperationListResult.java | 25 +- .../models/PagedResourceSku.java | 112 + .../models/PlacementPoliciesList.java | 32 +- .../models/PrivateCloudList.java | 32 +- .../models/ProvisionedNetworkListResult.java | 114 + .../models/ScriptCmdletsList.java | 32 +- .../models/ScriptExecutionsList.java | 32 +- .../models/ScriptPackagesList.java | 32 +- .../models/VirtualMachinesList.java | 32 +- .../models/WorkloadNetworkDhcpList.java | 32 +- .../WorkloadNetworkDnsServicesList.java | 32 +- .../models/WorkloadNetworkDnsZonesList.java | 32 +- .../models/WorkloadNetworkGatewayList.java | 32 +- .../models/WorkloadNetworkList.java | 32 +- .../WorkloadNetworkPortMirroringList.java | 32 +- .../models/WorkloadNetworkPublicIPsList.java | 32 +- .../models/WorkloadNetworkSegmentsList.java | 32 +- .../models/WorkloadNetworkVMGroupsList.java | 32 +- .../WorkloadNetworkVirtualMachinesList.java | 32 +- .../avs/implementation/package-info.java | 4 +- .../avs/models/ActionType.java | 6 +- .../resourcemanager/avs/models/Addon.java | 2 +- .../avs/models/AddonArcProperties.java | 21 +- .../avs/models/AddonHcxProperties.java | 61 +- .../avs/models/AddonProperties.java | 12 +- .../avs/models/AddonProvisioningState.java | 16 +- .../avs/models/AddonSrmProperties.java | 21 +- .../resourcemanager/avs/models/AddonType.java | 2 +- .../avs/models/AddonVrProperties.java | 21 +- .../resourcemanager/avs/models/Addons.java | 2 +- .../avs/models/AdminCredentials.java | 2 +- .../avs/models/AffinityStrength.java | 6 +- .../avs/models/AffinityType.java | 6 +- .../avs/models/Authorizations.java | 2 +- .../avs/models/AvailabilityProperties.java | 2 +- .../avs/models/AvailabilityStrategy.java | 6 +- .../avs/models/AzureHybridBenefitType.java | 6 +- .../resourcemanager/avs/models/Circuit.java | 2 +- .../resourcemanager/avs/models/CloudLink.java | 52 +- .../models/CloudLinkProperties.java | 6 +- .../models/CloudLinkProvisioningState.java | 8 +- .../avs/models/CloudLinkStatus.java | 12 +- .../avs/models/CloudLinks.java | 2 +- .../resourcemanager/avs/models/Cluster.java | 83 +- .../models/ClusterProperties.java | 5 +- .../avs/models/ClusterProvisioningState.java | 14 +- .../avs/models/ClusterUpdate.java | 2 +- .../avs/models/ClusterZone.java | 4 +- .../avs/models/ClusterZoneList.java | 2 +- .../resourcemanager/avs/models/Clusters.java | 2 +- .../resourcemanager/avs/models/Datastore.java | 120 +- .../models/DatastoreProperties.java | 40 +- .../models/DatastoreProvisioningState.java | 18 +- .../avs/models/DatastoreStatus.java | 16 +- .../avs/models/Datastores.java | 2 +- .../avs/models/DhcpTypeEnum.java | 2 +- .../avs/models/DiskPoolVolume.java | 2 +- .../avs/models/DnsServiceLogLevelEnum.java | 12 +- .../avs/models/DnsServiceStatusEnum.java | 6 +- .../avs/models/DnsZoneType.java | 6 +- .../avs/models/ElasticSanVolume.java | 2 +- .../avs/models/Encryption.java | 2 +- .../avs/models/EncryptionKeyStatus.java | 6 +- .../models/EncryptionKeyVaultProperties.java | 2 +- .../avs/models/EncryptionState.java | 6 +- .../avs/models/EncryptionVersionType.java | 6 +- .../resourcemanager/avs/models/Endpoints.java | 4 +- .../avs/models/ExpressRouteAuthorization.java | 59 +- .../ExpressRouteAuthorizationProperties.java | 5 +- ...ssRouteAuthorizationProvisioningState.java | 10 +- .../avs/models/GeneralHostProperties.java | 98 + .../avs/models/GlobalReachConnection.java | 150 +- .../GlobalReachConnectionProperties.java | 6 +- ...lobalReachConnectionProvisioningState.java | 10 +- .../models/GlobalReachConnectionStatus.java | 8 +- .../avs/models/GlobalReachConnections.java | 2 +- .../avs/models/HcxEnterpriseSite.java | 57 +- .../models/HcxEnterpriseSiteProperties.java | 6 +- .../HcxEnterpriseSiteProvisioningState.java | 8 +- .../avs/models/HcxEnterpriseSiteStatus.java | 10 +- .../avs/models/HcxEnterpriseSites.java | 2 +- .../resourcemanager/avs/models/HostKind.java | 51 + .../avs/models/HostMaintenance.java | 51 + .../resourcemanager/avs/models/HostModel.java | 70 + .../avs/models/HostProperties.java | 273 + .../avs/models/HostProvisioningState.java | 56 + .../resourcemanager/avs/models/Hosts.java | 72 + .../avs/models/IdentitySource.java | 8 +- .../avs/models/InternetEnum.java | 6 +- .../resourcemanager/avs/models/IscsiPath.java | 147 +- .../models/IscsiPathProperties.java | 5 +- .../models/IscsiPathProvisioningState.java | 16 +- .../avs/models/IscsiPaths.java | 66 +- .../resourcemanager/avs/models/Locations.java | 36 +- .../avs/models/ManagementCluster.java | 2 +- .../avs/models/MountOptionEnum.java | 9 +- .../avs/models/NetAppVolume.java | 2 +- .../models/NsxPublicIpQuotaRaisedEnum.java | 6 +- .../resourcemanager/avs/models/Operation.java | 8 +- .../avs/models/OperationDisplay.java | 6 +- .../avs/models/Operations.java | 2 +- .../avs/models/OptionalParamEnum.java | 6 +- .../resourcemanager/avs/models/Origin.java | 8 +- .../PSCredentialExecutionParameter.java | 2 +- .../avs/models/PlacementPolicies.java | 2 +- .../avs/models/PlacementPolicy.java | 2 +- .../avs/models/PlacementPolicyProperties.java | 8 +- .../PlacementPolicyProvisioningState.java | 14 +- .../avs/models/PlacementPolicyState.java | 6 +- .../avs/models/PlacementPolicyType.java | 2 +- .../avs/models/PlacementPolicyUpdate.java | 2 +- .../models/PortMirroringDirectionEnum.java | 8 +- .../avs/models/PortMirroringStatusEnum.java | 6 +- .../avs/models/PrivateCloud.java | 406 +- .../avs/models/PrivateCloudIdentity.java | 17 +- .../models/PrivateCloudProperties.java | 14 +- .../models/PrivateCloudProvisioningState.java | 18 +- .../avs/models/PrivateCloudUpdate.java | 2 +- .../avs/models/PrivateClouds.java | 50 +- .../avs/models/ProvisionedNetwork.java | 55 + .../models/ProvisionedNetworkProperties.java | 115 + .../ProvisionedNetworkProvisioningState.java | 57 + .../avs/models/ProvisionedNetworkTypes.java | 76 + .../avs/models/ProvisionedNetworks.java | 67 + .../avs/models/PureStorageVolume.java | 130 + .../resourcemanager/avs/models/Quota.java | 2 +- .../avs/models/QuotaEnabled.java | 6 +- .../avs/models/ResourceIdentityType.java | 51 - .../avs/models/ResourceSku.java | 84 + .../avs/models/ResourceSkuCapabilities.java | 111 + .../avs/models/ResourceSkuLocationInfo.java | 140 + .../avs/models/ResourceSkuResourceType.java | 51 + .../models/ResourceSkuRestrictionInfo.java | 102 + .../avs/models/ResourceSkuRestrictions.java | 154 + .../ResourceSkuRestrictionsReasonCode.java | 52 + .../models/ResourceSkuRestrictionsType.java | 51 + .../avs/models/ResourceSkuZoneDetails.java | 119 + .../avs/models/ScriptCmdlet.java | 44 +- .../avs/models/ScriptCmdletAudience.java | 6 +- .../models/ScriptCmdletProperties.java | 9 +- .../models/ScriptCmdletProvisioningState.java | 8 +- .../avs/models/ScriptCmdlets.java | 2 +- .../avs/models/ScriptExecution.java | 342 +- .../avs/models/ScriptExecutionParameter.java | 8 +- .../models/ScriptExecutionParameterType.java | 2 +- .../models/ScriptExecutionProperties.java | 24 +- .../ScriptExecutionPropertiesNamedOutput.java | 65 + .../ScriptExecutionProvisioningState.java | 18 +- .../avs/models/ScriptExecutions.java | 2 +- .../avs/models/ScriptOutputStreamType.java | 10 +- .../avs/models/ScriptPackage.java | 42 +- .../models/ScriptPackageProperties.java | 7 +- .../ScriptPackageProvisioningState.java | 8 +- .../avs/models/ScriptPackages.java | 2 +- .../avs/models/ScriptParameter.java | 19 +- .../avs/models/ScriptParameterTypes.java | 14 +- .../ScriptSecureStringExecutionParameter.java | 2 +- .../ScriptStringExecutionParameter.java | 2 +- .../avs/models/SegmentStatusEnum.java | 6 +- .../azure/resourcemanager/avs/models/Sku.java | 8 +- .../resourcemanager/avs/models/SkuTier.java | 10 +- .../resourcemanager/avs/models/Skus.java | 33 + .../avs/models/SpecializedHostProperties.java | 99 + .../resourcemanager/avs/models/SslEnum.java | 6 +- .../SystemAssignedServiceIdentityType.java | 51 + .../resourcemanager/avs/models/Trial.java | 2 +- .../avs/models/TrialStatus.java | 8 +- .../avs/models/VMGroupStatusEnum.java | 6 +- .../avs/models/VMTypeEnum.java | 8 +- .../avs/models/VirtualMachine.java | 42 +- .../models/VirtualMachineProperties.java | 12 +- .../VirtualMachineProvisioningState.java | 8 +- .../VirtualMachineRestrictMovement.java | 2 +- .../VirtualMachineRestrictMovementState.java | 6 +- .../avs/models/VirtualMachines.java | 6 +- .../avs/models/VisibilityParameterEnum.java | 6 +- .../VmHostPlacementPolicyProperties.java | 21 +- .../models/VmPlacementPolicyProperties.java | 21 +- .../avs/models/WorkloadNetwork.java | 14 +- .../avs/models/WorkloadNetworkDhcp.java | 23 +- .../avs/models/WorkloadNetworkDhcpEntity.java | 8 +- .../WorkloadNetworkDhcpProvisioningState.java | 14 +- .../avs/models/WorkloadNetworkDhcpRelay.java | 38 +- .../avs/models/WorkloadNetworkDhcpServer.java | 38 +- .../avs/models/WorkloadNetworkDnsService.java | 228 +- .../WorkloadNetworkDnsServiceProperties.java | 7 +- ...oadNetworkDnsServiceProvisioningState.java | 14 +- .../avs/models/WorkloadNetworkDnsZone.java | 220 +- .../WorkloadNetworkDnsZoneProperties.java | 5 +- ...rkloadNetworkDnsZoneProvisioningState.java | 14 +- .../avs/models/WorkloadNetworkGateway.java | 28 +- .../WorkloadNetworkGatewayProperties.java | 22 +- .../models/WorkloadNetworkPortMirroring.java | 192 +- ...orkloadNetworkPortMirroringProperties.java | 7 +- ...NetworkPortMirroringProvisioningState.java | 14 +- .../models/WorkloadNetworkProperties.java | 7 +- .../WorkloadNetworkProvisioningState.java | 14 +- .../avs/models/WorkloadNetworkPublicIp.java | 66 +- .../WorkloadNetworkPublicIpProperties.java | 5 +- ...kloadNetworkPublicIpProvisioningState.java | 14 +- .../avs/models/WorkloadNetworkSegment.java | 167 +- .../models/WorkloadNetworkSegmentPortVif.java | 19 +- .../WorkloadNetworkSegmentProperties.java | 8 +- ...rkloadNetworkSegmentProvisioningState.java | 14 +- .../models/WorkloadNetworkSegmentSubnet.java | 2 +- .../avs/models/WorkloadNetworkVMGroup.java | 126 +- .../WorkloadNetworkVMGroupProperties.java | 6 +- ...rkloadNetworkVMGroupProvisioningState.java | 14 +- .../models/WorkloadNetworkVirtualMachine.java | 28 +- ...rkloadNetworkVirtualMachineProperties.java | 23 +- .../avs/models/WorkloadNetworks.java | 293 +- .../avs/models/package-info.java | 4 +- .../resourcemanager/avs/package-info.java | 4 +- .../src/main/java/module-info.java | 3 +- .../proxy-config.json | 2 +- .../azure-resourcemanager-avs.properties | 1 + .../AddonsCreateOrUpdateSamples.java | 32 +- .../avs/generated/AddonsDeleteSamples.java | 5 +- .../avs/generated/AddonsGetSamples.java | 26 +- .../avs/generated/AddonsListSamples.java | 5 +- .../AuthorizationsCreateOrUpdateSamples.java | 5 +- .../AuthorizationsDeleteSamples.java | 5 +- .../generated/AuthorizationsGetSamples.java | 5 +- .../generated/AuthorizationsListSamples.java | 5 +- .../CloudLinksCreateOrUpdateSamples.java | 11 +- .../generated/CloudLinksDeleteSamples.java | 5 +- .../avs/generated/CloudLinksGetSamples.java | 5 +- .../avs/generated/CloudLinksListSamples.java | 5 +- .../ClustersCreateOrUpdateSamples.java | 8 +- .../avs/generated/ClustersDeleteSamples.java | 5 +- .../avs/generated/ClustersGetSamples.java | 5 +- .../avs/generated/ClustersListSamples.java | 5 +- .../generated/ClustersListZonesSamples.java | 8 +- .../avs/generated/ClustersUpdateSamples.java | 5 +- .../DatastoresCreateOrUpdateSamples.java | 10 +- .../generated/DatastoresDeleteSamples.java | 5 +- .../avs/generated/DatastoresGetSamples.java | 5 +- .../avs/generated/DatastoresListSamples.java | 5 +- ...ReachConnectionsCreateOrUpdateSamples.java | 13 +- .../GlobalReachConnectionsDeleteSamples.java | 5 +- .../GlobalReachConnectionsGetSamples.java | 5 +- .../GlobalReachConnectionsListSamples.java | 5 +- ...xEnterpriseSitesCreateOrUpdateSamples.java | 6 +- .../HcxEnterpriseSitesDeleteSamples.java | 5 +- .../HcxEnterpriseSitesGetSamples.java | 5 +- .../HcxEnterpriseSitesListSamples.java | 5 +- .../avs/generated/HostsGetSamples.java | 24 + .../avs/generated/HostsListSamples.java | 22 + .../IscsiPathsCreateOrUpdateSamples.java | 13 +- .../generated/IscsiPathsDeleteSamples.java | 7 +- .../avs/generated/IscsiPathsGetSamples.java | 7 +- .../IscsiPathsListByPrivateCloudSamples.java | 5 +- ...ocationsCheckQuotaAvailabilitySamples.java | 6 +- ...ocationsCheckTrialAvailabilitySamples.java | 9 +- .../avs/generated/OperationsListSamples.java | 5 +- ...lacementPoliciesCreateOrUpdateSamples.java | 6 +- .../PlacementPoliciesDeleteSamples.java | 5 +- .../PlacementPoliciesGetSamples.java | 5 +- .../PlacementPoliciesListSamples.java | 5 +- .../PlacementPoliciesUpdateSamples.java | 5 +- .../PrivateCloudsCreateOrUpdateSamples.java | 77 +- .../generated/PrivateCloudsDeleteSamples.java | 5 +- ...rivateCloudsGetByResourceGroupSamples.java | 8 +- ...vateCloudsListAdminCredentialsSamples.java | 6 +- ...ivateCloudsListByResourceGroupSamples.java | 8 +- .../generated/PrivateCloudsListSamples.java | 9 +- ...rivateCloudsRotateNsxtPasswordSamples.java | 6 +- ...ateCloudsRotateVcenterPasswordSamples.java | 5 +- .../generated/PrivateCloudsUpdateSamples.java | 13 +- .../ProvisionedNetworksGetSamples.java | 22 + .../ProvisionedNetworksListSamples.java | 22 + .../generated/ScriptCmdletsGetSamples.java | 5 +- .../generated/ScriptCmdletsListSamples.java | 5 +- ...ScriptExecutionsCreateOrUpdateSamples.java | 25 +- .../ScriptExecutionsDeleteSamples.java | 5 +- ...riptExecutionsGetExecutionLogsSamples.java | 6 +- .../generated/ScriptExecutionsGetSamples.java | 5 +- .../ScriptExecutionsListSamples.java | 5 +- .../generated/ScriptPackagesGetSamples.java | 5 +- .../generated/ScriptPackagesListSamples.java | 5 +- .../avs/generated/SkusListSamples.java | 22 + .../generated/VirtualMachinesGetSamples.java | 5 +- .../generated/VirtualMachinesListSamples.java | 5 +- ...irtualMachinesRestrictMovementSamples.java | 6 +- .../WorkloadNetworksCreateDhcpSamples.java | 7 +- ...rkloadNetworksCreateDnsServiceSamples.java | 21 +- .../WorkloadNetworksCreateDnsZoneSamples.java | 19 +- ...oadNetworksCreatePortMirroringSamples.java | 18 +- ...WorkloadNetworksCreatePublicIPSamples.java | 29 + ...WorkloadNetworksCreatePublicIpSamples.java | 29 - .../WorkloadNetworksCreateSegmentSamples.java | 34 + ...WorkloadNetworksCreateSegmentsSamples.java | 35 - .../WorkloadNetworksCreateVMGroupSamples.java | 15 +- .../WorkloadNetworksDeleteDhcpSamples.java | 7 +- ...rkloadNetworksDeleteDnsServiceSamples.java | 6 +- .../WorkloadNetworksDeleteDnsZoneSamples.java | 6 +- ...oadNetworksDeletePortMirroringSamples.java | 5 +- ...orkloadNetworksDeletePublicIPSamples.java} | 12 +- .../WorkloadNetworksDeleteSegmentSamples.java | 9 +- .../WorkloadNetworksDeleteVMGroupSamples.java | 6 +- .../WorkloadNetworksGetDhcpSamples.java | 5 +- .../WorkloadNetworksGetDnsServiceSamples.java | 8 +- .../WorkloadNetworksGetDnsZoneSamples.java | 7 +- .../WorkloadNetworksGetGatewaySamples.java | 7 +- ...rkloadNetworksGetPortMirroringSamples.java | 8 +- ...> WorkloadNetworksGetPublicIPSamples.java} | 11 +- .../generated/WorkloadNetworksGetSamples.java | 7 +- .../WorkloadNetworksGetSegmentSamples.java | 7 +- .../WorkloadNetworksGetVMGroupSamples.java | 7 +- ...kloadNetworksGetVirtualMachineSamples.java | 8 +- .../WorkloadNetworksListDhcpSamples.java | 7 +- ...WorkloadNetworksListDnsServiceSamples.java | 22 + ...orkloadNetworksListDnsServicesSamples.java | 24 - .../WorkloadNetworksListDnsZonesSamples.java | 7 +- .../WorkloadNetworksListGatewaysSamples.java | 7 +- ...kloadNetworksListPortMirroringSamples.java | 8 +- .../WorkloadNetworksListPublicIPsSamples.java | 8 +- .../WorkloadNetworksListSamples.java | 5 +- .../WorkloadNetworksListSegmentsSamples.java | 7 +- .../WorkloadNetworksListVMGroupsSamples.java | 7 +- ...oadNetworksListVirtualMachinesSamples.java | 7 +- .../WorkloadNetworksUpdateDhcpSamples.java | 32 - ...rkloadNetworksUpdateDnsServiceSamples.java | 21 +- .../WorkloadNetworksUpdateDnsZoneSamples.java | 19 +- ...oadNetworksUpdatePortMirroringSamples.java | 17 +- .../WorkloadNetworksUpdateSegmentSamples.java | 35 + ...WorkloadNetworksUpdateSegmentsSamples.java | 36 - .../WorkloadNetworksUpdateVMGroupSamples.java | 15 +- .../generated/AddonArcPropertiesTests.java | 26 - .../generated/AddonHcxPropertiesTests.java | 26 - .../avs/generated/AddonInnerTests.java | 24 - .../avs/generated/AddonListTests.java | 33 - .../avs/generated/AddonPropertiesTests.java | 23 - .../avs/generated/AddonVrPropertiesTests.java | 26 - .../AddonsCreateOrUpdateMockTests.java | 12 +- .../avs/generated/AddonsDeleteMockTests.java | 8 +- .../AddonsGetWithResponseMockTests.java | 10 +- .../avs/generated/AddonsListMockTests.java | 10 +- .../AuthorizationsDeleteMockTests.java | 8 +- .../AvailabilityPropertiesTests.java | 33 - .../avs/generated/CircuitTests.java | 23 - .../avs/generated/CloudLinkInnerTests.java | 26 - .../avs/generated/CloudLinkListTests.java | 33 - .../generated/CloudLinkPropertiesTests.java | 26 - .../CloudLinksCreateOrUpdateMockTests.java | 17 +- .../generated/CloudLinksDeleteMockTests.java | 8 +- .../CloudLinksGetWithResponseMockTests.java | 12 +- .../generated/CloudLinksListMockTests.java | 13 +- .../avs/generated/ClusterInnerTests.java | 51 - .../avs/generated/ClusterListTests.java | 54 - .../avs/generated/ClusterPropertiesTests.java | 33 - .../ClusterUpdatePropertiesTests.java | 30 - .../avs/generated/ClusterUpdateTests.java | 49 - .../generated/ClusterZoneListInnerTests.java | 26 - .../avs/generated/ClusterZoneTests.java | 23 - .../ClustersCreateOrUpdateMockTests.java | 45 +- .../generated/ClustersDeleteMockTests.java | 8 +- .../ClustersGetWithResponseMockTests.java | 26 +- .../avs/generated/ClustersListMockTests.java | 26 +- ...lustersListZonesWithResponseMockTests.java | 10 +- .../avs/generated/DatastoreInnerTests.java | 42 - .../avs/generated/DatastoreListTests.java | 59 - .../generated/DatastorePropertiesTests.java | 42 - .../DatastoresCreateOrUpdateMockTests.java | 36 +- .../generated/DatastoresDeleteMockTests.java | 9 +- .../DatastoresGetWithResponseMockTests.java | 22 +- .../generated/DatastoresListMockTests.java | 23 +- .../avs/generated/DiskPoolVolumeTests.java | 33 - .../avs/generated/ElasticSanVolumeTests.java | 24 - .../avs/generated/EndpointsTests.java | 23 - ...GlobalReachConnectionsDeleteMockTests.java | 9 +- ...priseSitesDeleteWithResponseMockTests.java | 8 +- .../HostsGetWithResponseMockTests.java | 48 + .../avs/generated/HostsListMockTests.java | 48 + .../avs/generated/IscsiPathInnerTests.java | 26 - .../generated/IscsiPathListResultTests.java | 32 - .../generated/IscsiPathPropertiesTests.java | 26 - .../IscsiPathsCreateOrUpdateMockTests.java | 18 +- .../generated/IscsiPathsDeleteMockTests.java | 8 +- .../IscsiPathsGetWithResponseMockTests.java | 15 +- ...IscsiPathsListByPrivateCloudMockTests.java | 14 +- ...uotaAvailabilityWithResponseMockTests.java | 10 +- ...rialAvailabilityWithResponseMockTests.java | 20 +- .../avs/generated/ManagementClusterTests.java | 33 - .../avs/generated/NetAppVolumeTests.java | 24 - .../avs/generated/OperationDisplayTests.java | 23 - .../avs/generated/OperationInnerTests.java | 24 - .../generated/OperationListResultTests.java | 23 - .../generated/OperationsListMockTests.java | 8 +- ...cementPoliciesCreateOrUpdateMockTests.java | 20 +- .../PlacementPoliciesDeleteMockTests.java | 8 +- ...ementPoliciesGetWithResponseMockTests.java | 14 +- .../PlacementPoliciesListMockTests.java | 12 +- .../generated/PlacementPoliciesListTests.java | 39 - .../generated/PlacementPolicyInnerTests.java | 31 - .../PlacementPolicyPropertiesTests.java | 30 - .../PlacementPolicyUpdatePropertiesTests.java | 43 - .../generated/PlacementPolicyUpdateTests.java | 42 - .../generated/PrivateCloudIdentityTests.java | 27 - .../PrivateCloudsDeleteMockTests.java | 8 +- ...ionedNetworksGetWithResponseMockTests.java | 37 + .../ProvisionedNetworksListMockTests.java | 37 + .../avs/generated/QuotaInnerTests.java | 23 - .../avs/generated/ScriptCmdletInnerTests.java | 23 - .../ScriptCmdletPropertiesTests.java | 23 - ...ScriptCmdletsGetWithResponseMockTests.java | 11 +- .../generated/ScriptCmdletsListMockTests.java | 12 +- .../avs/generated/ScriptCmdletsListTests.java | 30 - .../generated/ScriptExecutionInnerTests.java | 65 - .../ScriptExecutionParameterTests.java | 26 - .../ScriptExecutionPropertiesTests.java | 63 - ...riptExecutionsCreateOrUpdateMockTests.java | 48 +- .../ScriptExecutionsDeleteMockTests.java | 9 +- ...GetExecutionLogsWithResponseMockTests.java | 28 +- ...iptExecutionsGetWithResponseMockTests.java | 24 +- .../ScriptExecutionsListMockTests.java | 25 +- .../generated/ScriptExecutionsListTests.java | 77 - .../generated/ScriptPackageInnerTests.java | 23 - .../ScriptPackagePropertiesTests.java | 23 - ...criptPackagesGetWithResponseMockTests.java | 10 +- .../ScriptPackagesListMockTests.java | 10 +- .../generated/ScriptPackagesListTests.java | 29 - .../avs/generated/ScriptParameterTests.java | 26 - ...ptSecureStringExecutionParameterTests.java | 29 - .../ScriptStringExecutionParameterTests.java | 28 - .../avs/generated/SkuTests.java | 39 - .../avs/generated/TrialInnerTests.java | 22 - .../generated/VirtualMachineInnerTests.java | 23 - .../VirtualMachinePropertiesTests.java | 23 - .../VirtualMachineRestrictMovementTests.java | 27 - ...rtualMachinesGetWithResponseMockTests.java | 10 +- .../VirtualMachinesListMockTests.java | 10 +- .../generated/VirtualMachinesListTests.java | 32 - .../VmHostPlacementPolicyPropertiesTests.java | 50 - .../VmPlacementPolicyPropertiesTests.java | 38 - .../WorkloadNetworkDhcpEntityTests.java | 29 - .../WorkloadNetworkDhcpInnerTests.java | 30 - .../WorkloadNetworkDhcpListTests.java | 42 - .../WorkloadNetworkDhcpRelayTests.java | 33 - .../WorkloadNetworkDhcpServerTests.java | 35 - .../WorkloadNetworkDnsServiceInnerTests.java | 43 - ...kloadNetworkDnsServicePropertiesTests.java | 43 - .../WorkloadNetworkDnsServicesListTests.java | 48 - .../WorkloadNetworkDnsZoneInnerTests.java | 42 - ...WorkloadNetworkDnsZonePropertiesTests.java | 42 - .../WorkloadNetworkDnsZonesListTests.java | 68 - .../WorkloadNetworkGatewayInnerTests.java | 26 - .../WorkloadNetworkGatewayListTests.java | 33 - ...WorkloadNetworkGatewayPropertiesTests.java | 26 - .../generated/WorkloadNetworkInnerTests.java | 23 - .../generated/WorkloadNetworkListTests.java | 32 - ...orkloadNetworkPortMirroringInnerTests.java | 40 - ...WorkloadNetworkPortMirroringListTests.java | 60 - ...adNetworkPortMirroringPropertiesTests.java | 40 - .../WorkloadNetworkPropertiesTests.java | 22 - .../WorkloadNetworkPublicIPsListTests.java | 37 - .../WorkloadNetworkPublicIpInnerTests.java | 29 - ...orkloadNetworkPublicIpPropertiesTests.java | 29 - .../WorkloadNetworkSegmentInnerTests.java | 40 - .../WorkloadNetworkSegmentPortVifTests.java | 25 - ...WorkloadNetworkSegmentPropertiesTests.java | 40 - .../WorkloadNetworkSegmentSubnetTests.java | 31 - .../WorkloadNetworkSegmentsListTests.java | 57 - .../WorkloadNetworkVMGroupInnerTests.java | 33 - ...WorkloadNetworkVMGroupPropertiesTests.java | 33 - .../WorkloadNetworkVMGroupsListTests.java | 44 - ...rkloadNetworkVirtualMachineInnerTests.java | 27 - ...dNetworkVirtualMachinePropertiesTests.java | 28 - ...rkloadNetworkVirtualMachinesListTests.java | 33 - .../WorkloadNetworksCreateDhcpMockTests.java | 18 +- ...loadNetworksCreateDnsServiceMockTests.java | 37 +- ...orkloadNetworksCreateDnsZoneMockTests.java | 37 +- ...dNetworksCreatePortMirroringMockTests.java | 33 +- ...kloadNetworksCreatePublicIPMockTests.java} | 25 +- ...orkloadNetworksCreateSegmentMockTests.java | 52 + ...rkloadNetworksCreateSegmentsMockTests.java | 52 - ...orkloadNetworksCreateVMGroupMockTests.java | 25 +- .../WorkloadNetworksDeleteDhcpMockTests.java | 9 +- ...loadNetworksDeleteDnsServiceMockTests.java | 8 +- ...orkloadNetworksDeleteDnsZoneMockTests.java | 9 +- ...dNetworksDeletePortMirroringMockTests.java | 8 +- ...kloadNetworksDeletePublicIPMockTests.java} | 13 +- ...orkloadNetworksDeleteSegmentMockTests.java | 8 +- ...orkloadNetworksDeleteVMGroupMockTests.java | 8 +- ...dNetworksGetDhcpWithResponseMockTests.java | 14 +- ...rksGetDnsServiceWithResponseMockTests.java | 23 +- ...tworksGetDnsZoneWithResponseMockTests.java | 22 +- ...tworksGetGatewayWithResponseMockTests.java | 12 +- ...GetPortMirroringWithResponseMockTests.java | 20 +- ...orksGetPublicIPWithResponseMockTests.java} | 19 +- ...tworksGetSegmentWithResponseMockTests.java | 21 +- ...tworksGetVMGroupWithResponseMockTests.java | 16 +- ...etVirtualMachineWithResponseMockTests.java | 13 +- ...kloadNetworksGetWithResponseMockTests.java | 10 +- .../WorkloadNetworksListDhcpMockTests.java | 14 +- ...rkloadNetworksListDnsServiceMockTests.java | 45 + ...kloadNetworksListDnsServicesMockTests.java | 45 - ...WorkloadNetworksListDnsZonesMockTests.java | 22 +- ...WorkloadNetworksListGatewaysMockTests.java | 14 +- .../WorkloadNetworksListMockTests.java | 10 +- ...oadNetworksListPortMirroringMockTests.java | 21 +- ...orkloadNetworksListPublicIPsMockTests.java | 16 +- ...WorkloadNetworksListSegmentsMockTests.java | 20 +- ...WorkloadNetworksListVMGroupsMockTests.java | 16 +- ...dNetworksListVirtualMachinesMockTests.java | 12 +- .../tsp-location.yaml | 4 + 653 files changed, 22053 insertions(+), 20209 deletions(-) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/HostsClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ProvisionedNetworksClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/SkusClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HostModelInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ProvisionedNetworkInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ResourceSkuInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostModelImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostsClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostsImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworkImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworksClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworksImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ResourceSkuImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/SkusClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/SkusImpl.java rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/AddonList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/CloudLinkList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/ClusterList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/DatastoreList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/ExpressRouteAuthorizationList.java (80%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/GlobalReachConnectionList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/HcxEnterpriseSiteList.java (81%) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HostListResult.java rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/IscsiPathListResult.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/OperationListResult.java (74%) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PagedResourceSku.java rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/PlacementPoliciesList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/PrivateCloudList.java (81%) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ProvisionedNetworkListResult.java rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/ScriptCmdletsList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/ScriptExecutionsList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/ScriptPackagesList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/VirtualMachinesList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/WorkloadNetworkDhcpList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/WorkloadNetworkDnsServicesList.java (80%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/WorkloadNetworkDnsZonesList.java (80%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/WorkloadNetworkGatewayList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/WorkloadNetworkList.java (81%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/WorkloadNetworkPortMirroringList.java (80%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/WorkloadNetworkPublicIPsList.java (80%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/WorkloadNetworkSegmentsList.java (80%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/WorkloadNetworkVMGroupsList.java (80%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{ => implementation}/models/WorkloadNetworkVirtualMachinesList.java (80%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/CloudLinkProperties.java (94%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/ClusterProperties.java (96%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/DatastoreProperties.java (83%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/ExpressRouteAuthorizationProperties.java (96%) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GeneralHostProperties.java rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/GlobalReachConnectionProperties.java (96%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/HcxEnterpriseSiteProperties.java (93%) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostKind.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostMaintenance.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostModel.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostProperties.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Hosts.java rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/IscsiPathProperties.java (95%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/PrivateCloudProperties.java (96%) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetwork.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworkProperties.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworkProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworkTypes.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworks.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PureStorageVolume.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceIdentityType.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSku.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuCapabilities.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuLocationInfo.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuResourceType.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictionInfo.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictions.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictionsReasonCode.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictionsType.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuZoneDetails.java rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/ScriptCmdletProperties.java (93%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/ScriptExecutionProperties.java (95%) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionPropertiesNamedOutput.java rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/ScriptPackageProperties.java (94%) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Skus.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SpecializedHostProperties.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SystemAssignedServiceIdentityType.java rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/VirtualMachineProperties.java (91%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/WorkloadNetworkDnsServiceProperties.java (96%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/WorkloadNetworkDnsZoneProperties.java (97%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/WorkloadNetworkGatewayProperties.java (84%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/WorkloadNetworkPortMirroringProperties.java (95%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/WorkloadNetworkProperties.java (91%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/WorkloadNetworkPublicIpProperties.java (96%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/WorkloadNetworkSegmentProperties.java (94%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/WorkloadNetworkVMGroupProperties.java (95%) rename sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/{fluent => }/models/WorkloadNetworkVirtualMachineProperties.java (83%) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/resources/azure-resourcemanager-avs.properties create mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HostsGetSamples.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HostsListSamples.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksGetSamples.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksListSamples.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/SkusListSamples.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIPSamples.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIpSamples.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentSamples.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentsSamples.java rename sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/{WorkloadNetworksDeletePublicIpSamples.java => WorkloadNetworksDeletePublicIPSamples.java} (54%) rename sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/{WorkloadNetworksGetPublicIpSamples.java => WorkloadNetworksGetPublicIPSamples.java} (51%) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServiceSamples.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServicesSamples.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateDhcpSamples.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateSegmentSamples.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateSegmentsSamples.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonArcPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonHcxPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonVrPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AvailabilityPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CircuitTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinkInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinkListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinkPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterUpdatePropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterUpdateTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterZoneListInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterZoneTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoreInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoreListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastorePropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DiskPoolVolumeTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ElasticSanVolumeTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/EndpointsTests.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/HostsGetWithResponseMockTests.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/HostsListMockTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathListResultTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ManagementClusterTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/NetAppVolumeTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationDisplayTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationListResultTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyUpdatePropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyUpdateTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PrivateCloudIdentityTests.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksGetWithResponseMockTests.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksListMockTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/QuotaInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionParameterTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackageInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagePropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagesListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptParameterTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptSecureStringExecutionParameterTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptStringExecutionParameterTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/SkuTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/TrialInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachineInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinePropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachineRestrictMovementTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinesListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VmHostPlacementPolicyPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VmPlacementPolicyPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpEntityTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpRelayTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpServerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsServiceInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsServicePropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsServicesListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsZoneInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsZonePropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsZonesListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkGatewayInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkGatewayListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkGatewayPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPortMirroringInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPortMirroringListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPortMirroringPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPublicIPsListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPublicIpInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPublicIpPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentPortVifTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentSubnetTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentsListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVMGroupInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVMGroupPropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVMGroupsListTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVirtualMachineInnerTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVirtualMachinePropertiesTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVirtualMachinesListTests.java rename sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/{WorkloadNetworksCreatePublicIpMockTests.java => WorkloadNetworksCreatePublicIPMockTests.java} (51%) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentMockTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentsMockTests.java rename sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/{WorkloadNetworksDeletePublicIpMockTests.java => WorkloadNetworksDeletePublicIPMockTests.java} (68%) rename sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/{WorkloadNetworksGetPublicIpWithResponseMockTests.java => WorkloadNetworksGetPublicIPWithResponseMockTests.java} (57%) create mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServiceMockTests.java delete mode 100644 sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServicesMockTests.java create mode 100644 sdk/avs/azure-resourcemanager-avs/tsp-location.yaml diff --git a/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md b/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md index 13a16b3e459b..e80b27ecc16e 100644 --- a/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md +++ b/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md @@ -1,14 +1,1015 @@ # Release History -## 1.3.0-beta.1 (Unreleased) +## 1.3.0-beta.1 (2025-05-12) -### Features Added +- Azure Resource Manager avs client library for Java. This package contains Microsoft Azure SDK for avs Management SDK. Azure VMware Solution API. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.DatastoreList` was removed + +#### `models.ClusterList` was removed + +#### `models.GlobalReachConnectionList` was removed + +#### `models.AddonList` was removed + +#### `models.VirtualMachinesList` was removed + +#### `models.WorkloadNetworkDhcpList` was removed + +#### `models.ScriptCmdletsList` was removed + +#### `models.CloudLinkList` was removed + +#### `models.WorkloadNetworkVMGroupsList` was removed + +#### `models.ScriptExecutionsList` was removed + +#### `models.HcxEnterpriseSiteList` was removed + +#### `models.WorkloadNetworkPortMirroringList` was removed + +#### `models.WorkloadNetworkVirtualMachinesList` was removed + +#### `models.ResourceIdentityType` was removed + +#### `models.WorkloadNetworkList` was removed + +#### `models.PlacementPoliciesList` was removed + +#### `models.WorkloadNetworkPublicIPsList` was removed + +#### `models.WorkloadNetworkSegmentsList` was removed + +#### `models.OperationListResult` was removed + +#### `models.WorkloadNetworkDnsServicesList` was removed + +#### `models.PrivateCloudList` was removed + +#### `models.ExpressRouteAuthorizationList` was removed + +#### `models.WorkloadNetworkDnsZonesList` was removed + +#### `models.WorkloadNetworkGatewayList` was removed + +#### `models.ScriptPackagesList` was removed + +#### `models.IscsiPathListResult` was removed + +#### `models.WorkloadNetworkDnsService$DefinitionStages` was modified + +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.WorkloadNetworkDhcp$DefinitionStages` was modified + +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.WorkloadNetworkDnsZone$DefinitionStages` was modified + +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.WorkloadNetworkPortMirroring$DefinitionStages` was modified + +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.WorkloadNetworkSegment$DefinitionStages` was modified + +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.WorkloadNetworkPublicIp$DefinitionStages` was modified + +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.WorkloadNetworkVMGroup$DefinitionStages` was modified + +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.CloudLink$Definition` was modified + +* `withLinkedCloud(java.lang.String)` was removed + +#### `models.Cluster$Definition` was modified + +* `withClusterSize(java.lang.Integer)` was removed +* `withHosts(java.util.List)` was removed +* `withVsanDatastoreName(java.lang.String)` was removed + +#### `models.ScriptExecution$Update` was modified + +* `withRetention(java.lang.String)` was removed +* `withTimeout(java.lang.String)` was removed +* `withHiddenParameters(java.util.List)` was removed +* `withNamedOutputs(java.util.Map)` was removed +* `withParameters(java.util.List)` was removed +* `withOutput(java.util.List)` was removed +* `withFailureReason(java.lang.String)` was removed +* `withScriptCmdletId(java.lang.String)` was removed + +#### `models.WorkloadNetworkSegmentPortVif` was modified + +* `withPortName(java.lang.String)` was removed + +#### `models.WorkloadNetworkDhcpRelay` was modified + +* `provisioningState()` was removed +* `segments()` was removed + +#### `models.ScriptCmdlet` was modified + +* `provisioningState()` was removed +* `timeout()` was removed +* `parameters()` was removed +* `audience()` was removed +* `description()` was removed + +#### `models.Cluster` was modified + +* `clusterSize()` was removed +* `provisioningState()` was removed +* `vsanDatastoreName()` was removed +* `clusterId()` was removed +* `hosts()` was removed + +#### `models.GlobalReachConnection` was modified + +* `authorizationKey()` was removed +* `expressRouteId()` was removed +* `provisioningState()` was removed +* `circuitConnectionStatus()` was removed +* `addressPrefix()` was removed +* `peerExpressRouteCircuit()` was removed + +#### `models.WorkloadNetworkDnsZone$Update` was modified + +* `withDnsServices(java.lang.Long)` was removed +* `withDnsServerIps(java.util.List)` was removed +* `withDomain(java.util.List)` was removed +* `withRevision(java.lang.Long)` was removed +* `withSourceIp(java.lang.String)` was removed +* `withDisplayName(java.lang.String)` was removed + +#### `models.IscsiPath` was modified + +* `provisioningState()` was removed +* `networkBlock()` was removed + +#### `models.WorkloadNetworks` was modified + +* `getDnsZoneWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `getGateway(java.lang.String,java.lang.String,java.lang.String)` was removed +* `defineSegments(java.lang.String)` was removed +* `listPublicIPs(java.lang.String,java.lang.String)` was removed +* `deleteDhcp(java.lang.String,java.lang.String,java.lang.String)` was removed +* `listDnsZones(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `getDhcpByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `getPortMirroringWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `getDnsService(java.lang.String,java.lang.String,java.lang.String)` was removed +* `getDnsZone(java.lang.String,java.lang.String,java.lang.String)` was removed +* `deleteSegment(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `deleteSegment(java.lang.String,java.lang.String,java.lang.String)` was removed +* `getPortMirroring(java.lang.String,java.lang.String,java.lang.String)` was removed +* `deleteVMGroupById(java.lang.String)` was removed +* `getPublicIpByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `listPortMirroring(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `deleteDnsServiceByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteDnsZoneById(java.lang.String)` was removed +* `getSegmentWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `deletePublicIpByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `listVMGroups(java.lang.String,java.lang.String)` was removed +* `listSegments(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `getVMGroup(java.lang.String,java.lang.String,java.lang.String)` was removed +* `definePublicIp(java.lang.String)` was removed +* `getPublicIpById(java.lang.String)` was removed +* `getVMGroupWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `deletePublicIp(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `getSegment(java.lang.String,java.lang.String,java.lang.String)` was removed +* `deleteDnsZoneByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteDnsServiceById(java.lang.String)` was removed +* `deletePortMirroringByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteVMGroupByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `listDhcp(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `listVMGroups(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `getPublicIp(java.lang.String,java.lang.String,java.lang.String)` was removed +* `listDnsServices(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `listGateways(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `deletePublicIpById(java.lang.String)` was removed +* `deletePublicIp(java.lang.String,java.lang.String,java.lang.String)` was removed +* `getDnsServiceWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `getVirtualMachineWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `listPublicIPs(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `deleteDhcp(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `getGatewayWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `getPublicIpWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `get(java.lang.String,java.lang.String)` was removed +* `listDnsServices(java.lang.String,java.lang.String)` was removed +* `listVirtualMachines(java.lang.String,java.lang.String)` was removed +* `listVirtualMachines(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `listSegments(java.lang.String,java.lang.String)` was removed +* `listPortMirroring(java.lang.String,java.lang.String)` was removed +* `getVirtualMachine(java.lang.String,java.lang.String,java.lang.String)` was removed +* `listGateways(java.lang.String,java.lang.String)` was removed +* `listDhcp(java.lang.String,java.lang.String)` was removed +* `listDnsZones(java.lang.String,java.lang.String)` was removed +* `deletePortMirroringById(java.lang.String)` was removed +* `getDhcpById(java.lang.String)` was removed +* `getWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.WorkloadNetworkDhcp$Definition` was modified + +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed + +#### `models.AddonArcProperties` was modified + +* `provisioningState()` was removed + +#### `models.ExpressRouteAuthorization` was modified + +* `expressRouteId()` was removed +* `expressRouteAuthorizationKey()` was removed +* `expressRouteAuthorizationId()` was removed +* `provisioningState()` was removed + +#### `models.VmPlacementPolicyProperties` was modified + +* `provisioningState()` was removed + +#### `models.VirtualMachine` was modified + +* `moRefId()` was removed +* `folderPath()` was removed +* `restrictMovement()` was removed +* `provisioningState()` was removed +* `displayName()` was removed + +#### `models.WorkloadNetworkSegment$Definition` was modified + +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withSubnet(models.WorkloadNetworkSegmentSubnet)` was removed +* `withConnectedGateway(java.lang.String)` was removed +* `withRevision(java.lang.Long)` was removed + +#### `models.WorkloadNetworkPublicIp$Definition` was modified + +* `withNumberOfPublicIPs(java.lang.Long)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed + +#### `models.IscsiPaths` was modified + +* `get(java.lang.String,java.lang.String)` was removed +* `createOrUpdate(java.lang.String,java.lang.String,fluent.models.IscsiPathInner,com.azure.core.util.Context)` was removed +* `delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `createOrUpdate(java.lang.String,java.lang.String,fluent.models.IscsiPathInner)` was removed +* `getWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `deleteByResourceGroup(java.lang.String,java.lang.String)` was removed + +#### `models.WorkloadNetworkDnsZone` was modified + +* `displayName()` was removed +* `provisioningState()` was removed +* `dnsServices()` was removed +* `revision()` was removed +* `domain()` was removed +* `sourceIp()` was removed +* `dnsServerIps()` was removed + +#### `models.ScriptPackage` was modified + +* `version()` was removed +* `provisioningState()` was removed +* `uri()` was removed +* `description()` was removed +* `company()` was removed + +#### `models.WorkloadNetworkSegment$Update` was modified + +* `withConnectedGateway(java.lang.String)` was removed +* `withRevision(java.lang.Long)` was removed +* `withSubnet(models.WorkloadNetworkSegmentSubnet)` was removed +* `withDisplayName(java.lang.String)` was removed + +#### `models.Datastore` was modified + +* `diskPoolVolume()` was removed +* `status()` was removed +* `netAppVolume()` was removed +* `elasticSanVolume()` was removed +* `provisioningState()` was removed + +#### `models.WorkloadNetworkSegment` was modified + +* `connectedGateway()` was removed +* `revision()` was removed +* `displayName()` was removed +* `subnet()` was removed +* `provisioningState()` was removed +* `status()` was removed +* `portVif()` was removed + +#### `models.Datastore$Definition` was modified + +* `withNetAppVolume(models.NetAppVolume)` was removed +* `withDiskPoolVolume(models.DiskPoolVolume)` was removed +* `withElasticSanVolume(models.ElasticSanVolume)` was removed + +#### `models.WorkloadNetworkDnsService$Update` was modified + +* `withDnsServiceIp(java.lang.String)` was removed +* `withDefaultDnsZone(java.lang.String)` was removed +* `withLogLevel(models.DnsServiceLogLevelEnum)` was removed +* `withFqdnZones(java.util.List)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withRevision(java.lang.Long)` was removed + +#### `models.AddonVrProperties` was modified + +* `provisioningState()` was removed + +#### `models.ScriptExecution$Definition` was modified + +* `withParameters(java.util.List)` was removed +* `withHiddenParameters(java.util.List)` was removed +* `withOutput(java.util.List)` was removed +* `withFailureReason(java.lang.String)` was removed +* `withScriptCmdletId(java.lang.String)` was removed +* `withRetention(java.lang.String)` was removed +* `withNamedOutputs(java.util.Map)` was removed +* `withTimeout(java.lang.String)` was removed + +#### `models.WorkloadNetworkVMGroup$Update` was modified + +* `withMembers(java.util.List)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withRevision(java.lang.Long)` was removed + +#### `models.ScriptParameter` was modified + +* `withName(java.lang.String)` was removed + +#### `models.WorkloadNetworkVMGroup$Definition` was modified + +* `withMembers(java.util.List)` was removed +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed +* `withRevision(java.lang.Long)` was removed +* `withDisplayName(java.lang.String)` was removed + +#### `models.GlobalReachConnection$Definition` was modified + +* `withExpressRouteId(java.lang.String)` was removed +* `withAuthorizationKey(java.lang.String)` was removed +* `withPeerExpressRouteCircuit(java.lang.String)` was removed + +#### `models.WorkloadNetworkVirtualMachine` was modified + +* `displayName()` was removed +* `provisioningState()` was removed +* `vmType()` was removed + +#### `models.WorkloadNetworkPortMirroring$Update` was modified + +* `withRevision(java.lang.Long)` was removed +* `withDestination(java.lang.String)` was removed +* `withDirection(models.PortMirroringDirectionEnum)` was removed +* `withSource(java.lang.String)` was removed +* `withDisplayName(java.lang.String)` was removed + +#### `models.CloudLink` was modified + +* `status()` was removed +* `linkedCloud()` was removed +* `provisioningState()` was removed + +#### `models.WorkloadNetwork` was modified + +* `provisioningState()` was removed + +#### `models.WorkloadNetworkDnsZone$Definition` was modified + +* `withRevision(java.lang.Long)` was removed +* `withDomain(java.util.List)` was removed +* `withDnsServerIps(java.util.List)` was removed +* `withDnsServices(java.lang.Long)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withSourceIp(java.lang.String)` was removed +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed + +#### `models.VmHostPlacementPolicyProperties` was modified + +* `provisioningState()` was removed + +#### `models.WorkloadNetworkPortMirroring` was modified + +* `direction()` was removed +* `displayName()` was removed +* `status()` was removed +* `provisioningState()` was removed +* `revision()` was removed +* `source()` was removed +* `destination()` was removed + +#### `models.ScriptExecution` was modified + +* `information()` was removed +* `retention()` was removed +* `finishedAt()` was removed +* `provisioningState()` was removed +* `namedOutputs()` was removed +* `warnings()` was removed +* `parameters()` was removed +* `startedAt()` was removed +* `hiddenParameters()` was removed +* `errors()` was removed +* `failureReason()` was removed +* `scriptCmdletId()` was removed +* `timeout()` was removed +* `output()` was removed +* `submittedAt()` was removed + +#### `models.WorkloadNetworkPublicIp` was modified + +* `provisioningState()` was removed +* `numberOfPublicIPs()` was removed +* `displayName()` was removed +* `publicIpBlock()` was removed + +#### `models.WorkloadNetworkPortMirroring$Definition` was modified + +* `withDestination(java.lang.String)` was removed +* `withDirection(models.PortMirroringDirectionEnum)` was removed +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed +* `withSource(java.lang.String)` was removed +* `withRevision(java.lang.Long)` was removed +* `withDisplayName(java.lang.String)` was removed + +#### `models.PrivateCloud$Definition` was modified + +* `withVcenterPassword(java.lang.String)` was removed +* `withVirtualNetworkId(java.lang.String)` was removed +* `withAvailability(models.AvailabilityProperties)` was removed +* `withDnsZoneType(models.DnsZoneType)` was removed +* `withNsxtPassword(java.lang.String)` was removed +* `withNetworkBlock(java.lang.String)` was removed +* `withExtendedNetworkBlocks(java.util.List)` was removed +* `withSecondaryCircuit(models.Circuit)` was removed +* `withManagementCluster(models.ManagementCluster)` was removed +* `withIdentitySources(java.util.List)` was removed +* `withCircuit(models.Circuit)` was removed +* `withEncryption(models.Encryption)` was removed +* `withInternet(models.InternetEnum)` was removed + +#### `models.CloudLink$Update` was modified + +* `withLinkedCloud(java.lang.String)` was removed + +#### `models.WorkloadNetworkVMGroup` was modified + +* `revision()` was removed +* `members()` was removed +* `status()` was removed +* `displayName()` was removed +* `provisioningState()` was removed + +#### `models.ExpressRouteAuthorization$Definition` was modified + +* `withExpressRouteId(java.lang.String)` was removed + +#### `models.ExpressRouteAuthorization$Update` was modified + +* `withExpressRouteId(java.lang.String)` was removed + +#### `models.AddonHcxProperties` was modified + +* `provisioningState()` was removed + +#### `models.WorkloadNetworkDnsService$Definition` was modified + +* `withFqdnZones(java.util.List)` was removed +* `withRevision(java.lang.Long)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withDefaultDnsZone(java.lang.String)` was removed +* `withDnsServiceIp(java.lang.String)` was removed +* `withLogLevel(models.DnsServiceLogLevelEnum)` was removed +* `withExistingPrivateCloud(java.lang.String,java.lang.String)` was removed + +#### `models.HcxEnterpriseSite` was modified + +* `status()` was removed +* `provisioningState()` was removed +* `activationKey()` was removed + +#### `models.Datastore$Update` was modified + +* `withNetAppVolume(models.NetAppVolume)` was removed +* `withElasticSanVolume(models.ElasticSanVolume)` was removed +* `withDiskPoolVolume(models.DiskPoolVolume)` was removed + +#### `models.PrivateCloudIdentity` was modified + +* `models.ResourceIdentityType type()` -> `models.SystemAssignedServiceIdentityType type()` +* `withType(models.ResourceIdentityType)` was removed + +#### `models.GlobalReachConnection$Update` was modified + +* `withPeerExpressRouteCircuit(java.lang.String)` was removed +* `withExpressRouteId(java.lang.String)` was removed +* `withAuthorizationKey(java.lang.String)` was removed + +#### `models.WorkloadNetworkGateway` was modified + +* `displayName()` was removed +* `path()` was removed +* `provisioningState()` was removed + +#### `models.PrivateCloud` was modified + +* `circuit()` was removed +* `vcenterCertificateThumbprint()` was removed +* `identitySources()` was removed +* `managementCluster()` was removed +* `networkBlock()` was removed +* `dnsZoneType()` was removed +* `nsxtCertificateThumbprint()` was removed +* `externalCloudLinks()` was removed +* `encryption()` was removed +* `managementNetwork()` was removed +* `endpoints()` was removed +* `nsxtPassword()` was removed +* `secondaryCircuit()` was removed +* `extendedNetworkBlocks()` was removed +* `internet()` was removed +* `availability()` was removed +* `nsxPublicIpQuotaRaised()` was removed +* `provisioningNetwork()` was removed +* `virtualNetworkId()` was removed +* `vcenterPassword()` was removed +* `vmotionNetwork()` was removed +* `provisioningState()` was removed + +#### `models.WorkloadNetworkDnsService` was modified + +* `dnsServiceIp()` was removed +* `status()` was removed +* `logLevel()` was removed +* `displayName()` was removed +* `defaultDnsZone()` was removed +* `provisioningState()` was removed +* `revision()` was removed +* `fqdnZones()` was removed + +#### `models.AddonSrmProperties` was modified + +* `provisioningState()` was removed + +#### `models.WorkloadNetworkDhcp` was modified + +* `refresh()` was removed +* `refresh(com.azure.core.util.Context)` was removed + +#### `models.WorkloadNetworkDhcpServer` was modified + +* `segments()` was removed +* `provisioningState()` was removed + +### Features Added + +* `models.HostKind` was added + +* `models.WorkloadNetworkDnsServiceProperties` was added + +* `models.ProvisionedNetwork` was added + +* `models.IscsiPath$UpdateStages` was added + +* `models.ResourceSkuRestrictionInfo` was added + +* `implementation.models.DatastoreList` was added + +* `implementation.models.ScriptPackagesList` was added + +* `models.SpecializedHostProperties` was added + +* `models.VirtualMachineProperties` was added + +* `models.ResourceSkuLocationInfo` was added + +* `models.IscsiPath$Update` was added + +* `models.IscsiPath$DefinitionStages` was added + +* `models.WorkloadNetworkGatewayProperties` was added + +* `models.HostProvisioningState` was added + +* `models.GeneralHostProperties` was added + +* `models.WorkloadNetworkVirtualMachineProperties` was added + +* `models.HostMaintenance` was added + +* `models.Skus` was added + +* `implementation.models.VirtualMachinesList` was added + +* `models.HostModel` was added + +* `models.WorkloadNetworkVMGroupProperties` was added + +* `models.WorkloadNetworkPublicIpProperties` was added + +* `implementation.models.ExpressRouteAuthorizationList` was added + +* `implementation.models.WorkloadNetworkList` was added + +* `models.WorkloadNetworkProperties` was added + +* `models.HostProperties` was added + +* `models.ProvisionedNetworks` was added + +* `models.SystemAssignedServiceIdentityType` was added + +* `models.ResourceSku` was added + +* `models.ResourceSkuRestrictionsReasonCode` was added + +* `models.HcxEnterpriseSiteProperties` was added + +* `models.ResourceSkuZoneDetails` was added + +* `models.CloudLinkProperties` was added + +* `models.IscsiPath$Definition` was added + +* `models.ResourceSkuRestrictionsType` was added + +* `implementation.models.PrivateCloudList` was added + +* `implementation.models.ClusterList` was added + +* `models.DatastoreProperties` was added + +* `models.ResourceSkuResourceType` was added + +* `models.ResourceSkuRestrictions` was added + +* `implementation.models.CloudLinkList` was added + +* `models.WorkloadNetworkDnsZoneProperties` was added + +* `models.WorkloadNetworkPortMirroringProperties` was added + +* `implementation.models.AddonList` was added + +* `models.ScriptPackageProperties` was added + +* `implementation.models.WorkloadNetworkDnsServicesList` was added + +* `implementation.models.PagedResourceSku` was added + +* `models.ProvisionedNetworkProvisioningState` was added + +* `models.PrivateCloudProperties` was added + +* `implementation.models.WorkloadNetworkGatewayList` was added + +* `models.PureStorageVolume` was added + +* `implementation.models.PlacementPoliciesList` was added + +* `models.ResourceSkuCapabilities` was added + +* `models.Hosts` was added + +* `models.ScriptExecutionPropertiesNamedOutput` was added + +* `models.WorkloadNetworkSegmentProperties` was added + +* `implementation.models.WorkloadNetworkVMGroupsList` was added + +* `models.ExpressRouteAuthorizationProperties` was added + +* `implementation.models.WorkloadNetworkDhcpList` was added + +* `models.ProvisionedNetworkProperties` was added + +* `implementation.models.WorkloadNetworkVirtualMachinesList` was added + +* `implementation.models.ScriptExecutionsList` was added + +* `implementation.models.HostListResult` was added + +* `implementation.models.WorkloadNetworkDnsZonesList` was added + +* `models.ScriptExecutionProperties` was added + +* `implementation.models.HcxEnterpriseSiteList` was added + +* `models.IscsiPathProperties` was added + +* `implementation.models.IscsiPathListResult` was added + +* `models.ScriptCmdletProperties` was added + +* `implementation.models.WorkloadNetworkSegmentsList` was added + +* `implementation.models.WorkloadNetworkPublicIPsList` was added + +* `models.ClusterProperties` was added + +* `implementation.models.ScriptCmdletsList` was added + +* `implementation.models.WorkloadNetworkPortMirroringList` was added + +* `models.GlobalReachConnectionProperties` was added + +* `implementation.models.ProvisionedNetworkListResult` was added + +* `implementation.models.OperationListResult` was added + +* `implementation.models.GlobalReachConnectionList` was added + +* `models.ProvisionedNetworkTypes` was added + +#### `models.CloudLink$Definition` was modified + +* `withProperties(models.CloudLinkProperties)` was added + +#### `models.Cluster$Definition` was modified + +* `withProperties(models.ClusterProperties)` was added + +#### `models.ScriptExecution$Update` was modified + +* `withProperties(models.ScriptExecutionProperties)` was added + +#### `models.ScriptCmdlet` was modified + +* `properties()` was added + +#### `models.Cluster` was modified + +* `properties()` was added + +#### `models.GlobalReachConnection` was modified + +* `properties()` was added + +#### `models.WorkloadNetworkDnsZone$Update` was modified + +* `withProperties(models.WorkloadNetworkDnsZoneProperties)` was added + +#### `models.IscsiPath` was modified + +* `refresh(com.azure.core.util.Context)` was added +* `update()` was added +* `properties()` was added +* `refresh()` was added +* `resourceGroupName()` was added + +#### `models.WorkloadNetworks` was modified + +* `deleteDhcp(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `listDnsZones(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getSegment(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `getVirtualMachine(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `get(java.lang.String,java.lang.String,java.lang.String)` was added +* `getVirtualMachineWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getPublicIPByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `getPublicIP(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `getPortMirroring(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `listDhcp(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getVMGroupWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listVirtualMachines(java.lang.String,java.lang.String,java.lang.String)` was added +* `listDnsService(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getGatewayWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `deleteDhcp(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listPublicIPs(java.lang.String,java.lang.String,java.lang.String)` was added +* `getPublicIPById(java.lang.String)` was added +* `listPortMirroring(java.lang.String,java.lang.String,java.lang.String)` was added +* `getWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getDnsServiceWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listPublicIPs(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `deleteSegment(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `getPortMirroringWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getSegmentWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getDnsService(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `listDnsService(java.lang.String,java.lang.String,java.lang.String)` was added +* `listVMGroups(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getDnsZoneWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getDnsZone(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `listSegments(java.lang.String,java.lang.String,java.lang.String)` was added +* `listPortMirroring(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listSegments(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listDhcp(java.lang.String,java.lang.String,java.lang.String)` was added +* `getVMGroup(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `getGateway(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `definePublicIP(java.lang.String)` was added +* `listVMGroups(java.lang.String,java.lang.String,java.lang.String)` was added +* `listGateways(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `deleteSegment(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getPublicIPWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listVirtualMachines(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `deletePublicIP(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `deletePublicIP(java.lang.String,java.lang.String,java.lang.String)` was added +* `listDnsZones(java.lang.String,java.lang.String,java.lang.String)` was added +* `listGateways(java.lang.String,java.lang.String,java.lang.String)` was added +* `defineSegment(java.lang.String)` was added + +#### `models.WorkloadNetworkDhcp$Definition` was modified + +* `withExistingWorkloadNetwork(java.lang.String,java.lang.String,java.lang.String)` was added + +#### `models.ExpressRouteAuthorization` was modified + +* `properties()` was added + +#### `models.VirtualMachine` was modified + +* `properties()` was added + +#### `models.WorkloadNetworkSegment$Definition` was modified + +* `withExistingWorkloadNetwork(java.lang.String,java.lang.String,java.lang.String)` was added +* `withProperties(models.WorkloadNetworkSegmentProperties)` was added + +#### `models.WorkloadNetworkPublicIp$Definition` was modified + +* `withExistingWorkloadNetwork(java.lang.String,java.lang.String,java.lang.String)` was added +* `withProperties(models.WorkloadNetworkPublicIpProperties)` was added + +#### `models.IscsiPaths` was modified + +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `deleteById(java.lang.String)` was added +* `getWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `define(java.lang.String)` was added +* `getById(java.lang.String)` was added +* `get(java.lang.String,java.lang.String,java.lang.String)` was added +* `delete(java.lang.String,java.lang.String,java.lang.String)` was added +* `delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was added + +#### `models.WorkloadNetworkDnsZone` was modified + +* `properties()` was added + +#### `models.ScriptPackage` was modified + +* `properties()` was added + +#### `models.WorkloadNetworkSegment$Update` was modified + +* `withProperties(models.WorkloadNetworkSegmentProperties)` was added + +#### `models.Datastore` was modified + +* `properties()` was added + +#### `models.WorkloadNetworkSegment` was modified + +* `properties()` was added + +#### `models.Datastore$Definition` was modified + +* `withProperties(models.DatastoreProperties)` was added + +#### `models.WorkloadNetworkDnsService$Update` was modified + +* `withProperties(models.WorkloadNetworkDnsServiceProperties)` was added + +#### `models.ScriptExecution$Definition` was modified + +* `withProperties(models.ScriptExecutionProperties)` was added + +#### `models.WorkloadNetworkVMGroup$Update` was modified + +* `withProperties(models.WorkloadNetworkVMGroupProperties)` was added + +#### `models.HcxEnterpriseSite$Update` was modified + +* `withProperties(models.HcxEnterpriseSiteProperties)` was added + +#### `models.WorkloadNetworkVMGroup$Definition` was modified + +* `withExistingWorkloadNetwork(java.lang.String,java.lang.String,java.lang.String)` was added +* `withProperties(models.WorkloadNetworkVMGroupProperties)` was added + +#### `models.GlobalReachConnection$Definition` was modified + +* `withProperties(models.GlobalReachConnectionProperties)` was added + +#### `models.WorkloadNetworkVirtualMachine` was modified + +* `properties()` was added + +#### `AvsManager` was modified + +* `hosts()` was added +* `skus()` was added +* `provisionedNetworks()` was added + +#### `models.WorkloadNetworkPortMirroring$Update` was modified + +* `withProperties(models.WorkloadNetworkPortMirroringProperties)` was added + +#### `models.CloudLink` was modified + +* `properties()` was added + +#### `models.WorkloadNetwork` was modified + +* `properties()` was added + +#### `models.WorkloadNetworkDnsZone$Definition` was modified + +* `withProperties(models.WorkloadNetworkDnsZoneProperties)` was added +* `withExistingWorkloadNetwork(java.lang.String,java.lang.String,java.lang.String)` was added + +#### `models.HcxEnterpriseSite$Definition` was modified + +* `withProperties(models.HcxEnterpriseSiteProperties)` was added + +#### `models.WorkloadNetworkPortMirroring` was modified + +* `properties()` was added + +#### `models.ScriptExecution` was modified + +* `properties()` was added + +#### `models.WorkloadNetworkPublicIp` was modified + +* `properties()` was added + +#### `models.WorkloadNetworkPortMirroring$Definition` was modified + +* `withExistingWorkloadNetwork(java.lang.String,java.lang.String,java.lang.String)` was added +* `withProperties(models.WorkloadNetworkPortMirroringProperties)` was added + +#### `models.PrivateCloud$Definition` was modified + +* `withZones(java.util.List)` was added +* `withProperties(models.PrivateCloudProperties)` was added + +#### `models.CloudLink$Update` was modified + +* `withProperties(models.CloudLinkProperties)` was added + +#### `models.WorkloadNetworkVMGroup` was modified + +* `properties()` was added + +#### `models.ExpressRouteAuthorization$Definition` was modified + +* `withProperties(models.ExpressRouteAuthorizationProperties)` was added + +#### `models.ExpressRouteAuthorization$Update` was modified + +* `withProperties(models.ExpressRouteAuthorizationProperties)` was added + +#### `models.AddonHcxProperties` was modified + +* `withUplinkNetwork(java.lang.String)` was added +* `withManagementNetwork(java.lang.String)` was added +* `managementNetwork()` was added +* `uplinkNetwork()` was added + +#### `models.WorkloadNetworkDnsService$Definition` was modified + +* `withExistingWorkloadNetwork(java.lang.String,java.lang.String,java.lang.String)` was added +* `withProperties(models.WorkloadNetworkDnsServiceProperties)` was added + +#### `models.HcxEnterpriseSite` was modified + +* `properties()` was added + +#### `models.Datastore$Update` was modified + +* `withProperties(models.DatastoreProperties)` was added + +#### `models.PrivateCloudIdentity` was modified + +* `withType(models.SystemAssignedServiceIdentityType)` was added + +#### `models.GlobalReachConnection$Update` was modified + +* `withProperties(models.GlobalReachConnectionProperties)` was added + +#### `models.WorkloadNetworkGateway` was modified + +* `properties()` was added + +#### `models.PrivateCloud` was modified + +* `properties()` was added +* `zones()` was added + +#### `models.WorkloadNetworkDnsService` was modified -### Other Changes +* `properties()` was added ## 1.2.0 (2024-09-11) diff --git a/sdk/avs/azure-resourcemanager-avs/README.md b/sdk/avs/azure-resourcemanager-avs/README.md index 416361b2a4c2..0b7088e25b9e 100644 --- a/sdk/avs/azure-resourcemanager-avs/README.md +++ b/sdk/avs/azure-resourcemanager-avs/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager Avs client library for Java +# Azure Resource Manager avs client library for Java -Azure Resource Manager Avs client library for Java. +Azure Resource Manager avs client library for Java. -This package contains Microsoft Azure SDK for Avs Management SDK. Azure VMware Solution API. Package tag package-2023-09-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for avs Management SDK. Azure VMware Solution API. 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 @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ AvsManager manager = AvsManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -111,5 +111,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [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/avs/azure-resourcemanager-avs/SAMPLE.md b/sdk/avs/azure-resourcemanager-avs/SAMPLE.md index 7cc376ef9f14..0599942c253b 100644 --- a/sdk/avs/azure-resourcemanager-avs/SAMPLE.md +++ b/sdk/avs/azure-resourcemanager-avs/SAMPLE.md @@ -52,6 +52,11 @@ - [Get](#hcxenterprisesites_get) - [List](#hcxenterprisesites_list) +## Hosts + +- [Get](#hosts_get) +- [List](#hosts_list) + ## IscsiPaths - [CreateOrUpdate](#iscsipaths_createorupdate) @@ -88,6 +93,11 @@ - [RotateVcenterPassword](#privateclouds_rotatevcenterpassword) - [Update](#privateclouds_update) +## ProvisionedNetworks + +- [Get](#provisionednetworks_get) +- [List](#provisionednetworks_list) + ## ScriptCmdlets - [Get](#scriptcmdlets_get) @@ -106,6 +116,10 @@ - [Get](#scriptpackages_get) - [List](#scriptpackages_list) +## Skus + +- [List](#skus_list) + ## VirtualMachines - [Get](#virtualmachines_get) @@ -118,14 +132,14 @@ - [CreateDnsService](#workloadnetworks_creatednsservice) - [CreateDnsZone](#workloadnetworks_creatednszone) - [CreatePortMirroring](#workloadnetworks_createportmirroring) -- [CreatePublicIp](#workloadnetworks_createpublicip) -- [CreateSegments](#workloadnetworks_createsegments) +- [CreatePublicIP](#workloadnetworks_createpublicip) +- [CreateSegment](#workloadnetworks_createsegment) - [CreateVMGroup](#workloadnetworks_createvmgroup) - [DeleteDhcp](#workloadnetworks_deletedhcp) - [DeleteDnsService](#workloadnetworks_deletednsservice) - [DeleteDnsZone](#workloadnetworks_deletednszone) - [DeletePortMirroring](#workloadnetworks_deleteportmirroring) -- [DeletePublicIp](#workloadnetworks_deletepublicip) +- [DeletePublicIP](#workloadnetworks_deletepublicip) - [DeleteSegment](#workloadnetworks_deletesegment) - [DeleteVMGroup](#workloadnetworks_deletevmgroup) - [Get](#workloadnetworks_get) @@ -134,13 +148,13 @@ - [GetDnsZone](#workloadnetworks_getdnszone) - [GetGateway](#workloadnetworks_getgateway) - [GetPortMirroring](#workloadnetworks_getportmirroring) -- [GetPublicIp](#workloadnetworks_getpublicip) +- [GetPublicIP](#workloadnetworks_getpublicip) - [GetSegment](#workloadnetworks_getsegment) - [GetVMGroup](#workloadnetworks_getvmgroup) - [GetVirtualMachine](#workloadnetworks_getvirtualmachine) - [List](#workloadnetworks_list) - [ListDhcp](#workloadnetworks_listdhcp) -- [ListDnsServices](#workloadnetworks_listdnsservices) +- [ListDnsService](#workloadnetworks_listdnsservice) - [ListDnsZones](#workloadnetworks_listdnszones) - [ListGateways](#workloadnetworks_listgateways) - [ListPortMirroring](#workloadnetworks_listportmirroring) @@ -148,90 +162,39 @@ - [ListSegments](#workloadnetworks_listsegments) - [ListVMGroups](#workloadnetworks_listvmgroups) - [ListVirtualMachines](#workloadnetworks_listvirtualmachines) -- [UpdateDhcp](#workloadnetworks_updatedhcp) - [UpdateDnsService](#workloadnetworks_updatednsservice) - [UpdateDnsZone](#workloadnetworks_updatednszone) - [UpdatePortMirroring](#workloadnetworks_updateportmirroring) -- [UpdateSegments](#workloadnetworks_updatesegments) +- [UpdateSegment](#workloadnetworks_updatesegment) - [UpdateVMGroup](#workloadnetworks_updatevmgroup) ### Addons_CreateOrUpdate ```java -import com.azure.resourcemanager.avs.models.AddonArcProperties; -import com.azure.resourcemanager.avs.models.AddonHcxProperties; -import com.azure.resourcemanager.avs.models.AddonSrmProperties; -import com.azure.resourcemanager.avs.models.AddonVrProperties; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProperties; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; +import java.util.Arrays; /** - * Samples for Addons CreateOrUpdate. + * Samples for WorkloadNetworks CreateSegment. */ -public final class AddonsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_HCX.json - */ - /** - * Sample code: Addons_CreateOrUpdate_HCX. - * - * @param manager Entry point to AvsManager. - */ - public static void addonsCreateOrUpdateHCX(com.azure.resourcemanager.avs.AvsManager manager) { - manager.addons() - .define("hcx") - .withExistingPrivateCloud("group1", "cloud1") - .withProperties(new AddonHcxProperties().withOffer("VMware MaaS Cloud Provider (Enterprise)")) - .create(); - } - - /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_SRM.json - */ - /** - * Sample code: Addons_CreateOrUpdate_SRM. - * - * @param manager Entry point to AvsManager. - */ - public static void addonsCreateOrUpdateSRM(com.azure.resourcemanager.avs.AvsManager manager) { - manager.addons() - .define("srm") - .withExistingPrivateCloud("group1", "cloud1") - .withProperties(new AddonSrmProperties().withLicenseKey("fakeTokenPlaceholder")) - .create(); - } - - /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_ArcReg.json - */ - /** - * Sample code: Addons_CreateOrUpdate_ArcReg. - * - * @param manager Entry point to AvsManager. - */ - public static void addonsCreateOrUpdateArcReg(com.azure.resourcemanager.avs.AvsManager manager) { - manager.addons() - .define("arc") - .withExistingPrivateCloud("group1", "cloud1") - .withProperties(new AddonArcProperties().withVCenter( - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter")) - .create(); - } - +public final class WorkloadNetworksCreateSegmentSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_VR.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateSegments.json */ /** - * Sample code: Addons_CreateOrUpdate_VR. + * Sample code: WorkloadNetworks_CreateSegments. * * @param manager Entry point to AvsManager. */ - public static void addonsCreateOrUpdateVR(com.azure.resourcemanager.avs.AvsManager manager) { - manager.addons() - .define("vr") - .withExistingPrivateCloud("group1", "cloud1") - .withProperties(new AddonVrProperties().withVrsCount(1)) + public static void workloadNetworksCreateSegments(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .defineSegment("segment1") + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties(new WorkloadNetworkSegmentProperties().withDisplayName("segment1") + .withConnectedGateway("/infra/tier-1s/gateway") + .withSubnet(new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("40.20.0.0-40.20.0.1")) + .withGatewayAddress("40.20.20.20/16")) + .withRevision(1L)) .create(); } } @@ -241,20 +204,20 @@ public final class AddonsCreateOrUpdateSamples { ```java /** - * Samples for Addons Delete. + * Samples for GlobalReachConnections Get. */ -public final class AddonsDeleteSamples { +public final class GlobalReachConnectionsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Delete.json + * x-ms-original-file: 2024-09-01/GlobalReachConnections_Get.json */ /** - * Sample code: Addons_Delete. + * Sample code: GlobalReachConnections_Get. * * @param manager Entry point to AvsManager. */ - public static void addonsDelete(com.azure.resourcemanager.avs.AvsManager manager) { - manager.addons().delete("group1", "cloud1", "srm", com.azure.core.util.Context.NONE); + public static void globalReachConnectionsGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.globalReachConnections() + .getWithResponse("group1", "cloud1", "connection1", com.azure.core.util.Context.NONE); } } ``` @@ -263,59 +226,19 @@ public final class AddonsDeleteSamples { ```java /** - * Samples for Addons Get. + * Samples for IscsiPaths Get. */ -public final class AddonsGetSamples { - /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_SRM.json - */ - /** - * Sample code: Addons_Get_SRM. - * - * @param manager Entry point to AvsManager. - */ - public static void addonsGetSRM(com.azure.resourcemanager.avs.AvsManager manager) { - manager.addons().getWithResponse("group1", "cloud1", "srm", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_VR.json - */ - /** - * Sample code: Addons_Get_VR. - * - * @param manager Entry point to AvsManager. - */ - public static void addonsGetVR(com.azure.resourcemanager.avs.AvsManager manager) { - manager.addons().getWithResponse("group1", "cloud1", "vr", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_HCX.json - */ - /** - * Sample code: Addons_Get_HCX. - * - * @param manager Entry point to AvsManager. - */ - public static void addonsGetHCX(com.azure.resourcemanager.avs.AvsManager manager) { - manager.addons().getWithResponse("group1", "cloud1", "hcx", com.azure.core.util.Context.NONE); - } - +public final class IscsiPathsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_ArcReg.json + * x-ms-original-file: 2024-09-01/IscsiPaths_Get.json */ /** - * Sample code: Addons_Get_ArcReg. + * Sample code: IscsiPaths_Get. * * @param manager Entry point to AvsManager. */ - public static void addonsGetArcReg(com.azure.resourcemanager.avs.AvsManager manager) { - manager.addons().getWithResponse("group1", "cloud1", "arc", com.azure.core.util.Context.NONE); + public static void iscsiPathsGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.iscsiPaths().getWithResponse("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } ``` @@ -323,21 +246,26 @@ public final class AddonsGetSamples { ### Addons_List ```java +import com.azure.resourcemanager.avs.models.IscsiPathProperties; + /** - * Samples for Addons List. + * Samples for IscsiPaths CreateOrUpdate. */ -public final class AddonsListSamples { +public final class IscsiPathsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_List.json + * x-ms-original-file: 2024-09-01/IscsiPaths_CreateOrUpdate.json */ /** - * Sample code: Addons_List. + * Sample code: IscsiPaths_CreateOrUpdate. * * @param manager Entry point to AvsManager. */ - public static void addonsList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.addons().list("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void iscsiPathsCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + manager.iscsiPaths() + .define("default") + .withExistingPrivateCloud("group1", "cloud1") + .withProperties(new IscsiPathProperties().withNetworkBlock("192.168.0.0/24")) + .create(); } } ``` @@ -346,20 +274,19 @@ public final class AddonsListSamples { ```java /** - * Samples for Authorizations CreateOrUpdate. + * Samples for IscsiPaths Delete. */ -public final class AuthorizationsCreateOrUpdateSamples { +public final class IscsiPathsDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/IscsiPaths_Delete.json */ /** - * Sample code: Authorizations_CreateOrUpdate. + * Sample code: IscsiPaths_Delete. * * @param manager Entry point to AvsManager. */ - public static void authorizationsCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - manager.authorizations().define("authorization1").withExistingPrivateCloud("group1", "cloud1").create(); + public static void iscsiPathsDelete(com.azure.resourcemanager.avs.AvsManager manager) { + manager.iscsiPaths().delete("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } ``` @@ -368,20 +295,19 @@ public final class AuthorizationsCreateOrUpdateSamples { ```java /** - * Samples for Authorizations Delete. + * Samples for WorkloadNetworks ListVirtualMachines. */ -public final class AuthorizationsDeleteSamples { +public final class WorkloadNetworksListVirtualMachinesSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_Delete.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListVirtualMachines.json */ /** - * Sample code: Authorizations_Delete. + * Sample code: WorkloadNetworks_ListVirtualMachines. * * @param manager Entry point to AvsManager. */ - public static void authorizationsDelete(com.azure.resourcemanager.avs.AvsManager manager) { - manager.authorizations().delete("group1", "cloud1", "authorization1", com.azure.core.util.Context.NONE); + public static void workloadNetworksListVirtualMachines(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().listVirtualMachines("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } ``` @@ -389,22 +315,29 @@ public final class AuthorizationsDeleteSamples { ### Authorizations_Get ```java +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProperties; +import java.util.Arrays; + /** - * Samples for Authorizations Get. + * Samples for WorkloadNetworks CreateVMGroup. */ -public final class AuthorizationsGetSamples { +public final class WorkloadNetworksCreateVMGroupSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_Get.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateVMGroup.json */ /** - * Sample code: Authorizations_Get. + * Sample code: WorkloadNetworks_CreateVMGroup. * * @param manager Entry point to AvsManager. */ - public static void authorizationsGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.authorizations() - .getWithResponse("group1", "cloud1", "authorization1", com.azure.core.util.Context.NONE); + public static void workloadNetworksCreateVMGroup(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .defineVMGroup("vmGroup1") + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties(new WorkloadNetworkVMGroupProperties().withDisplayName("vmGroup1") + .withMembers(Arrays.asList("564d43da-fefc-2a3b-1d92-42855622fa50")) + .withRevision(1L)) + .create(); } } ``` @@ -413,20 +346,21 @@ public final class AuthorizationsGetSamples { ```java /** - * Samples for Authorizations List. + * Samples for ScriptCmdlets Get. */ -public final class AuthorizationsListSamples { +public final class ScriptCmdletsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_List.json + * x-ms-original-file: 2024-09-01/ScriptCmdlets_Get.json */ /** - * Sample code: Authorizations_List. + * Sample code: ScriptCmdlets_Get. * * @param manager Entry point to AvsManager. */ - public static void authorizationsList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.authorizations().list("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void scriptCmdletsGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.scriptCmdlets() + .getWithResponse("group1", "cloud1", "package@1.0.2", "New-ExternalSsoDomain", + com.azure.core.util.Context.NONE); } } ``` @@ -434,26 +368,33 @@ public final class AuthorizationsListSamples { ### CloudLinks_CreateOrUpdate ```java +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZone; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProperties; +import java.util.Arrays; + /** - * Samples for CloudLinks CreateOrUpdate. + * Samples for WorkloadNetworks UpdateDnsZone. */ -public final class CloudLinksCreateOrUpdateSamples { +public final class WorkloadNetworksUpdateDnsZoneSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateDnsZone.json */ /** - * Sample code: CloudLinks_CreateOrUpdate. + * Sample code: WorkloadNetworks_UpdateDnsZone. * * @param manager Entry point to AvsManager. */ - public static void cloudLinksCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - manager.cloudLinks() - .define("cloudLink1") - .withExistingPrivateCloud("group1", "cloud1") - .withLinkedCloud( - "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2") - .create(); + public static void workloadNetworksUpdateDnsZone(com.azure.resourcemanager.avs.AvsManager manager) { + WorkloadNetworkDnsZone resource = manager.workloadNetworks() + .getDnsZoneWithResponse("group1", "cloud1", null, "dnsZone1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new WorkloadNetworkDnsZoneProperties().withDisplayName("dnsZone1") + .withDomain(Arrays.asList()) + .withDnsServerIps(Arrays.asList("1.1.1.1")) + .withSourceIp("8.8.8.8") + .withRevision(1L)) + .apply(); } } ``` @@ -462,20 +403,19 @@ public final class CloudLinksCreateOrUpdateSamples { ```java /** - * Samples for CloudLinks Delete. + * Samples for PrivateClouds ListAdminCredentials. */ -public final class CloudLinksDeleteSamples { +public final class PrivateCloudsListAdminCredentialsSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_Delete.json + * x-ms-original-file: 2024-09-01/PrivateClouds_ListAdminCredentials.json */ /** - * Sample code: CloudLinks_Delete. + * Sample code: PrivateClouds_ListAdminCredentials. * * @param manager Entry point to AvsManager. */ - public static void cloudLinksDelete(com.azure.resourcemanager.avs.AvsManager manager) { - manager.cloudLinks().delete("group1", "cloud1", "cloudLink1", com.azure.core.util.Context.NONE); + public static void privateCloudsListAdminCredentials(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds().listAdminCredentialsWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE); } } ``` @@ -483,21 +423,31 @@ public final class CloudLinksDeleteSamples { ### CloudLinks_Get ```java +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProperties; +import java.util.Arrays; + /** - * Samples for CloudLinks Get. + * Samples for WorkloadNetworks CreateDnsZone. */ -public final class CloudLinksGetSamples { +public final class WorkloadNetworksCreateDnsZoneSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_Get.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateDnsZone.json */ /** - * Sample code: CloudLinks_Get. + * Sample code: WorkloadNetworks_CreateDnsZone. * * @param manager Entry point to AvsManager. */ - public static void cloudLinksGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.cloudLinks().getWithResponse("group1", "cloud1", "cloudLink1", com.azure.core.util.Context.NONE); + public static void workloadNetworksCreateDnsZone(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .defineDnsZone("dnsZone1") + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties(new WorkloadNetworkDnsZoneProperties().withDisplayName("dnsZone1") + .withDomain(Arrays.asList()) + .withDnsServerIps(Arrays.asList("1.1.1.1")) + .withSourceIp("8.8.8.8") + .withRevision(1L)) + .create(); } } ``` @@ -506,20 +456,19 @@ public final class CloudLinksGetSamples { ```java /** - * Samples for CloudLinks List. + * Samples for HcxEnterpriseSites Delete. */ -public final class CloudLinksListSamples { +public final class HcxEnterpriseSitesDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_List.json + * x-ms-original-file: 2024-09-01/HcxEnterpriseSites_Delete.json */ /** - * Sample code: CloudLinks_List. + * Sample code: HcxEnterpriseSites_Delete. * * @param manager Entry point to AvsManager. */ - public static void cloudLinksList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.cloudLinks().list("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void hcxEnterpriseSitesDelete(com.azure.resourcemanager.avs.AvsManager manager) { + manager.hcxEnterpriseSites().deleteWithResponse("group1", "cloud1", "site1", com.azure.core.util.Context.NONE); } } ``` @@ -527,28 +476,33 @@ public final class CloudLinksListSamples { ### Clusters_CreateOrUpdate ```java -import com.azure.resourcemanager.avs.models.Sku; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProperties; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; +import java.util.Arrays; /** - * Samples for Clusters CreateOrUpdate. + * Samples for WorkloadNetworks UpdateSegment. */ -public final class ClustersCreateOrUpdateSamples { +public final class WorkloadNetworksUpdateSegmentSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateSegments.json */ /** - * Sample code: Clusters_CreateOrUpdate. + * Sample code: WorkloadNetworks_UpdateSegments. * * @param manager Entry point to AvsManager. */ - public static void clustersCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - manager.clusters() - .define("cluster1") - .withExistingPrivateCloud("group1", "cloud1") - .withSku(new Sku().withName("AV20")) - .withClusterSize(3) - .create(); + public static void workloadNetworksUpdateSegments(com.azure.resourcemanager.avs.AvsManager manager) { + WorkloadNetworkSegment resource = manager.workloadNetworks() + .getSegmentWithResponse("group1", "cloud1", null, "segment1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new WorkloadNetworkSegmentProperties().withConnectedGateway("/infra/tier-1s/gateway") + .withSubnet(new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("40.20.0.0-40.20.0.1")) + .withGatewayAddress("40.20.20.20/16")) + .withRevision(1L)) + .apply(); } } ``` @@ -557,20 +511,19 @@ public final class ClustersCreateOrUpdateSamples { ```java /** - * Samples for Clusters Delete. + * Samples for CloudLinks Get. */ -public final class ClustersDeleteSamples { +public final class CloudLinksGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_Delete.json + * x-ms-original-file: 2024-09-01/CloudLinks_Get.json */ /** - * Sample code: Clusters_Delete. + * Sample code: CloudLinks_Get. * * @param manager Entry point to AvsManager. */ - public static void clustersDelete(com.azure.resourcemanager.avs.AvsManager manager) { - manager.clusters().delete("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); + public static void cloudLinksGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.cloudLinks().getWithResponse("group1", "cloud1", "cloudLink1", com.azure.core.util.Context.NONE); } } ``` @@ -579,20 +532,19 @@ public final class ClustersDeleteSamples { ```java /** - * Samples for Clusters Get. + * Samples for ScriptExecutions Delete. */ -public final class ClustersGetSamples { +public final class ScriptExecutionsDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_Get.json + * x-ms-original-file: 2024-09-01/ScriptExecutions_Delete.json */ /** - * Sample code: Clusters_Get. + * Sample code: ScriptExecutions_Delete. * * @param manager Entry point to AvsManager. */ - public static void clustersGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.clusters().getWithResponse("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); + public static void scriptExecutionsDelete(com.azure.resourcemanager.avs.AvsManager manager) { + manager.scriptExecutions().delete("group1", "cloud1", "addSsoServer", com.azure.core.util.Context.NONE); } } ``` @@ -601,20 +553,19 @@ public final class ClustersGetSamples { ```java /** - * Samples for Clusters List. + * Samples for Datastores List. */ -public final class ClustersListSamples { +public final class DatastoresListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_List.json + * x-ms-original-file: 2024-09-01/Datastores_List.json */ /** - * Sample code: Clusters_List. + * Sample code: Datastores_List. * * @param manager Entry point to AvsManager. */ - public static void clustersList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.clusters().list("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void datastoresList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.datastores().list("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); } } ``` @@ -623,33 +574,19 @@ public final class ClustersListSamples { ```java /** - * Samples for Clusters ListZones. + * Samples for PlacementPolicies List. */ -public final class ClustersListZonesSamples { - /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_ListZones.json - */ - /** - * Sample code: Clusters_ListZones. - * - * @param manager Entry point to AvsManager. - */ - public static void clustersListZones(com.azure.resourcemanager.avs.AvsManager manager) { - manager.clusters().listZonesWithResponse("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); - } - +public final class PlacementPoliciesListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_ListZones_Stretched.json + * x-ms-original-file: 2024-09-01/PlacementPolicies_List.json */ /** - * Sample code: Clusters_ListZones_Stretched. + * Sample code: PlacementPolicies_List. * * @param manager Entry point to AvsManager. */ - public static void clustersListZonesStretched(com.azure.resourcemanager.avs.AvsManager manager) { - manager.clusters().listZonesWithResponse("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); + public static void placementPoliciesList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.placementPolicies().list("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); } } ``` @@ -657,26 +594,20 @@ public final class ClustersListZonesSamples { ### Clusters_Update ```java -import com.azure.resourcemanager.avs.models.Cluster; - /** - * Samples for Clusters Update. + * Samples for HcxEnterpriseSites CreateOrUpdate. */ -public final class ClustersUpdateSamples { +public final class HcxEnterpriseSitesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_Update.json + * x-ms-original-file: 2024-09-01/HcxEnterpriseSites_CreateOrUpdate.json */ /** - * Sample code: Clusters_Update. + * Sample code: HcxEnterpriseSites_CreateOrUpdate. * * @param manager Entry point to AvsManager. */ - public static void clustersUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - Cluster resource = manager.clusters() - .getWithResponse("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withClusterSize(4).apply(); + public static void hcxEnterpriseSitesCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + manager.hcxEnterpriseSites().define("site1").withExistingPrivateCloud("group1", "cloud1").create(); } } ``` @@ -684,28 +615,38 @@ public final class ClustersUpdateSamples { ### Datastores_CreateOrUpdate ```java -import com.azure.resourcemanager.avs.models.NetAppVolume; +import com.azure.resourcemanager.avs.models.AffinityStrength; +import com.azure.resourcemanager.avs.models.AzureHybridBenefitType; +import com.azure.resourcemanager.avs.models.PlacementPolicy; +import com.azure.resourcemanager.avs.models.PlacementPolicyState; +import java.util.Arrays; /** - * Samples for Datastores CreateOrUpdate. + * Samples for PlacementPolicies Update. */ -public final class DatastoresCreateOrUpdateSamples { +public final class PlacementPoliciesUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/PlacementPolicies_Update.json */ /** - * Sample code: Datastores_CreateOrUpdate. + * Sample code: PlacementPolicies_Update. * * @param manager Entry point to AvsManager. */ - public static void datastoresCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - manager.datastores() - .define("datastore1") - .withExistingCluster("group1", "cloud1", "cluster1") - .withNetAppVolume(new NetAppVolume().withId( - "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1")) - .create(); + public static void placementPoliciesUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + PlacementPolicy resource = manager.placementPolicies() + .getWithResponse("group1", "cloud1", "cluster1", "policy1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withState(PlacementPolicyState.DISABLED) + .withVmMembers(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256")) + .withHostMembers(Arrays.asList("fakehost22.nyc1.kubernetes.center", "fakehost23.nyc1.kubernetes.center", + "fakehost24.nyc1.kubernetes.center")) + .withAffinityStrength(AffinityStrength.MUST) + .withAzureHybridBenefitType(AzureHybridBenefitType.SQL_HOST) + .apply(); } } ``` @@ -714,20 +655,31 @@ public final class DatastoresCreateOrUpdateSamples { ```java /** - * Samples for Datastores Delete. + * Samples for PrivateClouds ListByResourceGroup. */ -public final class DatastoresDeleteSamples { +public final class PrivateCloudsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_Delete.json + * x-ms-original-file: 2024-09-01/PrivateClouds_List.json */ /** - * Sample code: Datastores_Delete. + * Sample code: PrivateClouds_List. * * @param manager Entry point to AvsManager. */ - public static void datastoresDelete(com.azure.resourcemanager.avs.AvsManager manager) { - manager.datastores().delete("group1", "cloud1", "cluster1", "datastore1", com.azure.core.util.Context.NONE); + public static void privateCloudsList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds().listByResourceGroup("group1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-09-01/PrivateClouds_List_Stretched.json + */ + /** + * Sample code: PrivateClouds_List_Stretched. + * + * @param manager Entry point to AvsManager. + */ + public static void privateCloudsListStretched(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds().listByResourceGroup("group1", com.azure.core.util.Context.NONE); } } ``` @@ -736,21 +688,19 @@ public final class DatastoresDeleteSamples { ```java /** - * Samples for Datastores Get. + * Samples for ProvisionedNetworks Get. */ -public final class DatastoresGetSamples { +public final class ProvisionedNetworksGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_Get.json + * x-ms-original-file: 2024-09-01/ProvisionedNetworks_Get.json */ /** - * Sample code: Datastores_Get. + * Sample code: ProvisionedNetworks_Get. * * @param manager Entry point to AvsManager. */ - public static void datastoresGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.datastores() - .getWithResponse("group1", "cloud1", "cluster1", "datastore1", com.azure.core.util.Context.NONE); + public static void provisionedNetworksGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.provisionedNetworks().getWithResponse("group1", "cloud1", "vsan", com.azure.core.util.Context.NONE); } } ``` @@ -758,21 +708,28 @@ public final class DatastoresGetSamples { ### Datastores_List ```java +import com.azure.resourcemanager.avs.models.ClusterProperties; +import com.azure.resourcemanager.avs.models.Sku; + /** - * Samples for Datastores List. + * Samples for Clusters CreateOrUpdate. */ -public final class DatastoresListSamples { +public final class ClustersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_List.json + * x-ms-original-file: 2024-09-01/Clusters_CreateOrUpdate.json */ /** - * Sample code: Datastores_List. + * Sample code: Clusters_CreateOrUpdate. * * @param manager Entry point to AvsManager. */ - public static void datastoresList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.datastores().list("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); + public static void clustersCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + manager.clusters() + .define("cluster1") + .withExistingPrivateCloud("group1", "cloud1") + .withSku(new Sku().withName("AV20")) + .withProperties(new ClusterProperties().withClusterSize(3)) + .create(); } } ``` @@ -781,26 +738,19 @@ public final class DatastoresListSamples { ```java /** - * Samples for GlobalReachConnections CreateOrUpdate. + * Samples for Clusters Get. */ -public final class GlobalReachConnectionsCreateOrUpdateSamples { +public final class ClustersGetSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * GlobalReachConnections_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/Clusters_Get.json */ /** - * Sample code: GlobalReachConnections_CreateOrUpdate. + * Sample code: Clusters_Get. * * @param manager Entry point to AvsManager. */ - public static void globalReachConnectionsCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - manager.globalReachConnections() - .define("connection1") - .withExistingPrivateCloud("group1", "cloud1") - .withAuthorizationKey("01010101-0101-0101-0101-010101010101") - .withPeerExpressRouteCircuit( - "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer") - .create(); + public static void clustersGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.clusters().getWithResponse("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); } } ``` @@ -809,20 +759,19 @@ public final class GlobalReachConnectionsCreateOrUpdateSamples { ```java /** - * Samples for GlobalReachConnections Delete. + * Samples for Authorizations CreateOrUpdate. */ -public final class GlobalReachConnectionsDeleteSamples { +public final class AuthorizationsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_Delete.json + * x-ms-original-file: 2024-09-01/Authorizations_CreateOrUpdate.json */ /** - * Sample code: GlobalReachConnections_Delete. + * Sample code: Authorizations_CreateOrUpdate. * * @param manager Entry point to AvsManager. */ - public static void globalReachConnectionsDelete(com.azure.resourcemanager.avs.AvsManager manager) { - manager.globalReachConnections().delete("group1", "cloud1", "connection1", com.azure.core.util.Context.NONE); + public static void authorizationsCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + manager.authorizations().define("authorization1").withExistingPrivateCloud("group1", "cloud1").create(); } } ``` @@ -831,21 +780,20 @@ public final class GlobalReachConnectionsDeleteSamples { ```java /** - * Samples for GlobalReachConnections Get. + * Samples for WorkloadNetworks GetDnsZone. */ -public final class GlobalReachConnectionsGetSamples { +public final class WorkloadNetworksGetDnsZoneSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_Get.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetDnsZone.json */ /** - * Sample code: GlobalReachConnections_Get. + * Sample code: WorkloadNetworks_GetDnsZone. * * @param manager Entry point to AvsManager. */ - public static void globalReachConnectionsGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.globalReachConnections() - .getWithResponse("group1", "cloud1", "connection1", com.azure.core.util.Context.NONE); + public static void workloadNetworksGetDnsZone(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .getDnsZoneWithResponse("group1", "cloud1", null, "dnsZone1", com.azure.core.util.Context.NONE); } } ``` @@ -854,20 +802,19 @@ public final class GlobalReachConnectionsGetSamples { ```java /** - * Samples for GlobalReachConnections List. + * Samples for VirtualMachines List. */ -public final class GlobalReachConnectionsListSamples { +public final class VirtualMachinesListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_List.json + * x-ms-original-file: 2024-09-01/VirtualMachines_List.json */ /** - * Sample code: GlobalReachConnections_List. + * Sample code: VirtualMachines_List. * * @param manager Entry point to AvsManager. */ - public static void globalReachConnectionsList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.globalReachConnections().list("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void virtualMachinesList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.virtualMachines().list("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); } } ``` @@ -875,22 +822,26 @@ public final class GlobalReachConnectionsListSamples { ### HcxEnterpriseSites_CreateOrUpdate ```java +import com.azure.resourcemanager.avs.models.VirtualMachineRestrictMovement; +import com.azure.resourcemanager.avs.models.VirtualMachineRestrictMovementState; + /** - * Samples for HcxEnterpriseSites CreateOrUpdate. + * Samples for VirtualMachines RestrictMovement. */ -public final class HcxEnterpriseSitesCreateOrUpdateSamples { +public final class VirtualMachinesRestrictMovementSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_CreateOrUpdate. - * json + * x-ms-original-file: 2024-09-01/VirtualMachines_RestrictMovement.json */ /** - * Sample code: HcxEnterpriseSites_CreateOrUpdate. + * Sample code: VirtualMachines_RestrictMovement. * * @param manager Entry point to AvsManager. */ - public static void hcxEnterpriseSitesCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - manager.hcxEnterpriseSites().define("site1").withExistingPrivateCloud("group1", "cloud1").create(); + public static void virtualMachinesRestrictMovement(com.azure.resourcemanager.avs.AvsManager manager) { + manager.virtualMachines() + .restrictMovement("group1", "cloud1", "cluster1", "vm-209", + new VirtualMachineRestrictMovement().withRestrictMovement(VirtualMachineRestrictMovementState.ENABLED), + com.azure.core.util.Context.NONE); } } ``` @@ -899,20 +850,19 @@ public final class HcxEnterpriseSitesCreateOrUpdateSamples { ```java /** - * Samples for HcxEnterpriseSites Delete. + * Samples for WorkloadNetworks DeleteVMGroup. */ -public final class HcxEnterpriseSitesDeleteSamples { +public final class WorkloadNetworksDeleteVMGroupSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_Delete.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteVMGroup.json */ /** - * Sample code: HcxEnterpriseSites_Delete. + * Sample code: WorkloadNetworks_DeleteVMGroup. * * @param manager Entry point to AvsManager. */ - public static void hcxEnterpriseSitesDelete(com.azure.resourcemanager.avs.AvsManager manager) { - manager.hcxEnterpriseSites().deleteWithResponse("group1", "cloud1", "site1", com.azure.core.util.Context.NONE); + public static void workloadNetworksDeleteVMGroup(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().deleteVMGroup("group1", "vmGroup1", "cloud1", com.azure.core.util.Context.NONE); } } ``` @@ -921,20 +871,19 @@ public final class HcxEnterpriseSitesDeleteSamples { ```java /** - * Samples for HcxEnterpriseSites Get. + * Samples for PlacementPolicies Delete. */ -public final class HcxEnterpriseSitesGetSamples { +public final class PlacementPoliciesDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_Get.json + * x-ms-original-file: 2024-09-01/PlacementPolicies_Delete.json */ /** - * Sample code: HcxEnterpriseSites_Get. + * Sample code: PlacementPolicies_Delete. * * @param manager Entry point to AvsManager. */ - public static void hcxEnterpriseSitesGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.hcxEnterpriseSites().getWithResponse("group1", "cloud1", "site1", com.azure.core.util.Context.NONE); + public static void placementPoliciesDelete(com.azure.resourcemanager.avs.AvsManager manager) { + manager.placementPolicies().delete("group1", "cloud1", "cluster1", "policy1", com.azure.core.util.Context.NONE); } } ``` @@ -943,420 +892,433 @@ public final class HcxEnterpriseSitesGetSamples { ```java /** - * Samples for HcxEnterpriseSites List. + * Samples for WorkloadNetworks ListSegments. */ -public final class HcxEnterpriseSitesListSamples { +public final class WorkloadNetworksListSegmentsSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_List.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListSegments.json */ /** - * Sample code: HcxEnterpriseSites_List. + * Sample code: WorkloadNetworks_ListSegments. * * @param manager Entry point to AvsManager. */ - public static void hcxEnterpriseSitesList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.hcxEnterpriseSites().list("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksListSegments(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().listSegments("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } ``` -### IscsiPaths_CreateOrUpdate +### Hosts_Get ```java -import com.azure.resourcemanager.avs.fluent.models.IscsiPathInner; - /** - * Samples for IscsiPaths CreateOrUpdate. + * Samples for Authorizations List. */ -public final class IscsiPathsCreateOrUpdateSamples { +public final class AuthorizationsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/Authorizations_List.json */ /** - * Sample code: IscsiPaths_CreateOrUpdate. + * Sample code: Authorizations_List. * * @param manager Entry point to AvsManager. */ - public static void iscsiPathsCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - manager.iscsiPaths() - .createOrUpdate("group1", "cloud1", new IscsiPathInner().withNetworkBlock("192.168.0.0/24"), - com.azure.core.util.Context.NONE); + public static void authorizationsList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.authorizations().list("group1", "cloud1", com.azure.core.util.Context.NONE); } } ``` -### IscsiPaths_Delete +### Hosts_List ```java /** - * Samples for IscsiPaths Delete. + * Samples for WorkloadNetworks GetDhcp. */ -public final class IscsiPathsDeleteSamples { +public final class WorkloadNetworksGetDhcpSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_Delete.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetDhcp.json */ /** - * Sample code: IscsiPaths_Delete. + * Sample code: WorkloadNetworks_GetDhcp. * * @param manager Entry point to AvsManager. */ - public static void iscsiPathsDelete(com.azure.resourcemanager.avs.AvsManager manager) { - manager.iscsiPaths().delete("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksGetDhcp(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().getDhcpWithResponse("group1", "dhcp1", "cloud1", com.azure.core.util.Context.NONE); } } ``` -### IscsiPaths_Get +### IscsiPaths_CreateOrUpdate ```java /** - * Samples for IscsiPaths Get. + * Samples for WorkloadNetworks ListDhcp. */ -public final class IscsiPathsGetSamples { +public final class WorkloadNetworksListDhcpSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_Get.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListDhcp.json */ /** - * Sample code: IscsiPaths_Get. + * Sample code: WorkloadNetworks_ListDhcp. * * @param manager Entry point to AvsManager. */ - public static void iscsiPathsGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.iscsiPaths().getWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksListDhcp(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().listDhcp("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } ``` -### IscsiPaths_ListByPrivateCloud +### IscsiPaths_Delete ```java /** - * Samples for IscsiPaths ListByPrivateCloud. + * Samples for GlobalReachConnections List. */ -public final class IscsiPathsListByPrivateCloudSamples { +public final class GlobalReachConnectionsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_List.json + * x-ms-original-file: 2024-09-01/GlobalReachConnections_List.json */ /** - * Sample code: IscsiPaths_ListByPrivateCloud. + * Sample code: GlobalReachConnections_List. * * @param manager Entry point to AvsManager. */ - public static void iscsiPathsListByPrivateCloud(com.azure.resourcemanager.avs.AvsManager manager) { - manager.iscsiPaths().listByPrivateCloud("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void globalReachConnectionsList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.globalReachConnections().list("group1", "cloud1", com.azure.core.util.Context.NONE); } } ``` -### Locations_CheckQuotaAvailability +### IscsiPaths_Get ```java /** - * Samples for Locations CheckQuotaAvailability. + * Samples for Datastores Get. */ -public final class LocationsCheckQuotaAvailabilitySamples { +public final class DatastoresGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Locations_CheckQuotaAvailability. - * json + * x-ms-original-file: 2024-09-01/Datastores_Get.json */ /** - * Sample code: Locations_CheckQuotaAvailability. + * Sample code: Datastores_Get. * * @param manager Entry point to AvsManager. */ - public static void locationsCheckQuotaAvailability(com.azure.resourcemanager.avs.AvsManager manager) { - manager.locations().checkQuotaAvailabilityWithResponse("eastus", com.azure.core.util.Context.NONE); + public static void datastoresGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.datastores() + .getWithResponse("group1", "cloud1", "cluster1", "datastore1", com.azure.core.util.Context.NONE); } } ``` -### Locations_CheckTrialAvailability +### IscsiPaths_ListByPrivateCloud ```java -import com.azure.resourcemanager.avs.models.Sku; +/** + * Samples for IscsiPaths ListByPrivateCloud. + */ +public final class IscsiPathsListByPrivateCloudSamples { + /* + * x-ms-original-file: 2024-09-01/IscsiPaths_List.json + */ + /** + * Sample code: IscsiPaths_ListByPrivateCloud. + * + * @param manager Entry point to AvsManager. + */ + public static void iscsiPathsListByPrivateCloud(com.azure.resourcemanager.avs.AvsManager manager) { + manager.iscsiPaths().listByPrivateCloud("group1", "cloud1", com.azure.core.util.Context.NONE); + } +} +``` + +### Locations_CheckQuotaAvailability +```java /** - * Samples for Locations CheckTrialAvailability. + * Samples for Clusters ListZones. */ -public final class LocationsCheckTrialAvailabilitySamples { +public final class ClustersListZonesSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Locations_CheckTrialAvailability. - * json + * x-ms-original-file: 2024-09-01/Clusters_ListZones.json */ /** - * Sample code: Locations_CheckTrialAvailability. + * Sample code: Clusters_ListZones. * * @param manager Entry point to AvsManager. */ - public static void locationsCheckTrialAvailability(com.azure.resourcemanager.avs.AvsManager manager) { - manager.locations().checkTrialAvailabilityWithResponse("eastus", null, com.azure.core.util.Context.NONE); + public static void clustersListZones(com.azure.resourcemanager.avs.AvsManager manager) { + manager.clusters().listZonesWithResponse("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * Locations_CheckTrialAvailabilityWithSku.json + * x-ms-original-file: 2024-09-01/Clusters_ListZones_Stretched.json */ /** - * Sample code: Locations_CheckTrialAvailabilityWithSku. + * Sample code: Clusters_ListZones_Stretched. * * @param manager Entry point to AvsManager. */ - public static void locationsCheckTrialAvailabilityWithSku(com.azure.resourcemanager.avs.AvsManager manager) { - manager.locations() - .checkTrialAvailabilityWithResponse("eastus", new Sku().withName("avs52t"), - com.azure.core.util.Context.NONE); + public static void clustersListZonesStretched(com.azure.resourcemanager.avs.AvsManager manager) { + manager.clusters().listZonesWithResponse("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### Locations_CheckTrialAvailability ```java +import com.azure.resourcemanager.avs.models.GlobalReachConnectionProperties; + /** - * Samples for Operations List. + * Samples for GlobalReachConnections CreateOrUpdate. */ -public final class OperationsListSamples { +public final class GlobalReachConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Operations_List.json + * x-ms-original-file: 2024-09-01/GlobalReachConnections_CreateOrUpdate.json */ /** - * Sample code: Operations_List. + * Sample code: GlobalReachConnections_CreateOrUpdate. * * @param manager Entry point to AvsManager. */ - public static void operationsList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void globalReachConnectionsCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + manager.globalReachConnections() + .define("connection1") + .withExistingPrivateCloud("group1", "cloud1") + .withProperties(new GlobalReachConnectionProperties().withAuthorizationKey("fakeTokenPlaceholder") + .withPeerExpressRouteCircuit( + "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer")) + .create(); } } ``` -### PlacementPolicies_CreateOrUpdate +### Operations_List ```java -import com.azure.resourcemanager.avs.models.AffinityStrength; -import com.azure.resourcemanager.avs.models.AffinityType; -import com.azure.resourcemanager.avs.models.AzureHybridBenefitType; -import com.azure.resourcemanager.avs.models.VmHostPlacementPolicyProperties; -import java.util.Arrays; - /** - * Samples for PlacementPolicies CreateOrUpdate. + * Samples for VirtualMachines Get. */ -public final class PlacementPoliciesCreateOrUpdateSamples { +public final class VirtualMachinesGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_CreateOrUpdate. - * json + * x-ms-original-file: 2024-09-01/VirtualMachines_Get.json */ /** - * Sample code: PlacementPolicies_CreateOrUpdate. + * Sample code: VirtualMachines_Get. * * @param manager Entry point to AvsManager. */ - public static void placementPoliciesCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - manager.placementPolicies() - .define("policy1") - .withExistingCluster("group1", "cloud1", "cluster1") - .withProperties(new VmHostPlacementPolicyProperties().withVmMembers(Arrays.asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256")) - .withHostMembers(Arrays.asList("fakehost22.nyc1.kubernetes.center", "fakehost23.nyc1.kubernetes.center", - "fakehost24.nyc1.kubernetes.center")) - .withAffinityType(AffinityType.ANTI_AFFINITY) - .withAffinityStrength(AffinityStrength.MUST) - .withAzureHybridBenefitType(AzureHybridBenefitType.SQL_HOST)) - .create(); + public static void virtualMachinesGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.virtualMachines() + .getWithResponse("group1", "cloud1", "cluster1", "vm-209", com.azure.core.util.Context.NONE); } } ``` -### PlacementPolicies_Delete +### PlacementPolicies_CreateOrUpdate ```java /** - * Samples for PlacementPolicies Delete. + * Samples for Authorizations Delete. */ -public final class PlacementPoliciesDeleteSamples { +public final class AuthorizationsDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_Delete.json + * x-ms-original-file: 2024-09-01/Authorizations_Delete.json */ /** - * Sample code: PlacementPolicies_Delete. + * Sample code: Authorizations_Delete. * * @param manager Entry point to AvsManager. */ - public static void placementPoliciesDelete(com.azure.resourcemanager.avs.AvsManager manager) { - manager.placementPolicies().delete("group1", "cloud1", "cluster1", "policy1", com.azure.core.util.Context.NONE); + public static void authorizationsDelete(com.azure.resourcemanager.avs.AvsManager manager) { + manager.authorizations().delete("group1", "cloud1", "authorization1", com.azure.core.util.Context.NONE); } } ``` -### PlacementPolicies_Get +### PlacementPolicies_Delete ```java +import com.azure.resourcemanager.avs.models.AddonArcProperties; +import com.azure.resourcemanager.avs.models.AddonHcxProperties; +import com.azure.resourcemanager.avs.models.AddonSrmProperties; +import com.azure.resourcemanager.avs.models.AddonVrProperties; + /** - * Samples for PlacementPolicies Get. + * Samples for Addons CreateOrUpdate. */ -public final class PlacementPoliciesGetSamples { +public final class AddonsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_Get.json + * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_HCX.json */ /** - * Sample code: PlacementPolicies_Get. + * Sample code: Addons_CreateOrUpdate_HCX. * * @param manager Entry point to AvsManager. */ - public static void placementPoliciesGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.placementPolicies() - .getWithResponse("group1", "cloud1", "cluster1", "policy1", com.azure.core.util.Context.NONE); + public static void addonsCreateOrUpdateHCX(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons() + .define("hcx") + .withExistingPrivateCloud("group1", "cloud1") + .withProperties(new AddonHcxProperties().withOffer("VMware MaaS Cloud Provider (Enterprise)")) + .create(); + } + + /* + * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_SRM.json + */ + /** + * Sample code: Addons_CreateOrUpdate_SRM. + * + * @param manager Entry point to AvsManager. + */ + public static void addonsCreateOrUpdateSRM(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons() + .define("srm") + .withExistingPrivateCloud("group1", "cloud1") + .withProperties(new AddonSrmProperties().withLicenseKey("fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_HCX_With_Networks.json + */ + /** + * Sample code: Addons_CreateOrUpdate_HCX_With_Networks. + * + * @param manager Entry point to AvsManager. + */ + public static void addonsCreateOrUpdateHCXWithNetworks(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons() + .define("hcx") + .withExistingPrivateCloud("group1", "cloud1") + .withProperties(new AddonHcxProperties().withOffer("VMware MaaS Cloud Provider (Enterprise)") + .withManagementNetwork("10.3.1.0/24") + .withUplinkNetwork("10.3.2.0/24")) + .create(); + } + + /* + * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_ArcReg.json + */ + /** + * Sample code: Addons_CreateOrUpdate_ArcReg. + * + * @param manager Entry point to AvsManager. + */ + public static void addonsCreateOrUpdateArcReg(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons() + .define("arc") + .withExistingPrivateCloud("group1", "cloud1") + .withProperties(new AddonArcProperties().withVCenter( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter")) + .create(); + } + + /* + * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_VR.json + */ + /** + * Sample code: Addons_CreateOrUpdate_VR. + * + * @param manager Entry point to AvsManager. + */ + public static void addonsCreateOrUpdateVR(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons() + .define("vr") + .withExistingPrivateCloud("group1", "cloud1") + .withProperties(new AddonVrProperties().withVrsCount(1)) + .create(); } } ``` -### PlacementPolicies_List +### PlacementPolicies_Get ```java /** - * Samples for PlacementPolicies List. + * Samples for WorkloadNetworks DeleteSegment. */ -public final class PlacementPoliciesListSamples { +public final class WorkloadNetworksDeleteSegmentSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_List.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteSegment.json */ /** - * Sample code: PlacementPolicies_List. + * Sample code: WorkloadNetworks_DeleteSegment. * * @param manager Entry point to AvsManager. */ - public static void placementPoliciesList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.placementPolicies().list("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); + public static void workloadNetworksDeleteSegment(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .deleteSegment("group1", "cloud1", null, "segment1", com.azure.core.util.Context.NONE); } } ``` -### PlacementPolicies_Update +### PlacementPolicies_List ```java -import com.azure.resourcemanager.avs.models.AffinityStrength; -import com.azure.resourcemanager.avs.models.AzureHybridBenefitType; -import com.azure.resourcemanager.avs.models.PlacementPolicy; -import com.azure.resourcemanager.avs.models.PlacementPolicyState; -import java.util.Arrays; - /** - * Samples for PlacementPolicies Update. + * Samples for Operations List. */ -public final class PlacementPoliciesUpdateSamples { +public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_Update.json + * x-ms-original-file: 2024-09-01/Operations_List.json */ /** - * Sample code: PlacementPolicies_Update. + * Sample code: Operations_List. * * @param manager Entry point to AvsManager. */ - public static void placementPoliciesUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - PlacementPolicy resource = manager.placementPolicies() - .getWithResponse("group1", "cloud1", "cluster1", "policy1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withState(PlacementPolicyState.DISABLED) - .withVmMembers(Arrays.asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256")) - .withHostMembers(Arrays.asList("fakehost22.nyc1.kubernetes.center", "fakehost23.nyc1.kubernetes.center", - "fakehost24.nyc1.kubernetes.center")) - .withAffinityStrength(AffinityStrength.MUST) - .withAzureHybridBenefitType(AzureHybridBenefitType.SQL_HOST) - .apply(); + public static void operationsList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### PrivateClouds_CreateOrUpdate +### PlacementPolicies_Update ```java -import com.azure.resourcemanager.avs.models.AvailabilityProperties; -import com.azure.resourcemanager.avs.models.AvailabilityStrategy; -import com.azure.resourcemanager.avs.models.ManagementCluster; -import com.azure.resourcemanager.avs.models.PrivateCloudIdentity; -import com.azure.resourcemanager.avs.models.ResourceIdentityType; -import com.azure.resourcemanager.avs.models.Sku; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for PrivateClouds CreateOrUpdate. + * Samples for ProvisionedNetworks List. */ -public final class PrivateCloudsCreateOrUpdateSamples { +public final class ProvisionedNetworksListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/ProvisionedNetworks_List.json */ /** - * Sample code: PrivateClouds_CreateOrUpdate. + * Sample code: ProvisionedNetworks_List. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - manager.privateClouds() - .define("cloud1") - .withRegion("eastus2") - .withExistingResourceGroup("group1") - .withSku(new Sku().withName("AV36")) - .withTags(mapOf()) - .withIdentity(new PrivateCloudIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withManagementCluster(new ManagementCluster().withClusterSize(4)) - .withNetworkBlock("192.168.48.0/22") - .create(); + public static void provisionedNetworksList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.provisionedNetworks().list("group1", "cloud1", com.azure.core.util.Context.NONE); } +} +``` + +### PrivateClouds_CreateOrUpdate +```java +/** + * Samples for WorkloadNetworks ListPublicIPs. + */ +public final class WorkloadNetworksListPublicIPsSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * PrivateClouds_CreateOrUpdate_Stretched.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListPublicIPs.json */ /** - * Sample code: PrivateClouds_CreateOrUpdate_Stretched. + * Sample code: WorkloadNetworks_ListPublicIPs. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsCreateOrUpdateStretched(com.azure.resourcemanager.avs.AvsManager manager) { - manager.privateClouds() - .define("cloud1") - .withRegion("eastus2") - .withExistingResourceGroup("group1") - .withSku(new Sku().withName("AV36")) - .withTags(mapOf()) - .withManagementCluster(new ManagementCluster().withClusterSize(4)) - .withAvailability(new AvailabilityProperties().withStrategy(AvailabilityStrategy.DUAL_ZONE) - .withZone(1) - .withSecondaryZone(2)) - .withNetworkBlock("192.168.48.0/22") - .create(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void workloadNetworksListPublicIPs(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().listPublicIPs("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } ``` @@ -1365,20 +1327,20 @@ public final class PrivateCloudsCreateOrUpdateSamples { ```java /** - * Samples for PrivateClouds Delete. + * Samples for WorkloadNetworks GetDnsService. */ -public final class PrivateCloudsDeleteSamples { +public final class WorkloadNetworksGetDnsServiceSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Delete.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetDnsService.json */ /** - * Sample code: PrivateClouds_Delete. + * Sample code: WorkloadNetworks_GetDnsService. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsDelete(com.azure.resourcemanager.avs.AvsManager manager) { - manager.privateClouds().delete("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksGetDnsService(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .getDnsServiceWithResponse("group1", "cloud1", null, "dnsService1", com.azure.core.util.Context.NONE); } } ``` @@ -1387,132 +1349,184 @@ public final class PrivateCloudsDeleteSamples { ```java /** - * Samples for PrivateClouds GetByResourceGroup. + * Samples for Authorizations Get. */ -public final class PrivateCloudsGetByResourceGroupSamples { +public final class AuthorizationsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Get.json + * x-ms-original-file: 2024-09-01/Authorizations_Get.json */ /** - * Sample code: PrivateClouds_Get. + * Sample code: Authorizations_Get. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.privateClouds().getByResourceGroupWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void authorizationsGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.authorizations() + .getWithResponse("group1", "cloud1", "authorization1", com.azure.core.util.Context.NONE); } +} +``` + +### PrivateClouds_List +```java +/** + * Samples for ScriptCmdlets List. + */ +public final class ScriptCmdletsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Get_Stretched.json + * x-ms-original-file: 2024-09-01/ScriptCmdlets_List.json */ /** - * Sample code: PrivateClouds_Get_Stretched. + * Sample code: ScriptCmdlets_List. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsGetStretched(com.azure.resourcemanager.avs.AvsManager manager) { - manager.privateClouds().getByResourceGroupWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void scriptCmdletsList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.scriptCmdlets().list("group1", "cloud1", "package@1.0.2", com.azure.core.util.Context.NONE); } } ``` -### PrivateClouds_List +### PrivateClouds_ListAdminCredentials ```java /** - * Samples for PrivateClouds List. + * Samples for WorkloadNetworks ListGateways. */ -public final class PrivateCloudsListSamples { +public final class WorkloadNetworksListGatewaysSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListInSubscription. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListGateways.json */ /** - * Sample code: PrivateClouds_ListInSubscription. + * Sample code: WorkloadNetworks_ListGateways. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsListInSubscription(com.azure.resourcemanager.avs.AvsManager manager) { - manager.privateClouds().list(com.azure.core.util.Context.NONE); + public static void workloadNetworksListGateways(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().listGateways("group1", "cloud1", null, com.azure.core.util.Context.NONE); } +} +``` + +### PrivateClouds_ListByResourceGroup +```java +/** + * Samples for PlacementPolicies Get. + */ +public final class PlacementPoliciesGetSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * PrivateClouds_ListInSubscription_Stretched.json + * x-ms-original-file: 2024-09-01/PlacementPolicies_Get.json */ /** - * Sample code: PrivateClouds_ListInSubscription_Stretched. + * Sample code: PlacementPolicies_Get. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsListInSubscriptionStretched(com.azure.resourcemanager.avs.AvsManager manager) { - manager.privateClouds().list(com.azure.core.util.Context.NONE); + public static void placementPoliciesGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.placementPolicies() + .getWithResponse("group1", "cloud1", "cluster1", "policy1", com.azure.core.util.Context.NONE); } } ``` -### PrivateClouds_ListAdminCredentials +### PrivateClouds_RotateNsxtPassword ```java /** - * Samples for PrivateClouds ListAdminCredentials. + * Samples for ScriptExecutions Get. */ -public final class PrivateCloudsListAdminCredentialsSamples { +public final class ScriptExecutionsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListAdminCredentials - * .json + * x-ms-original-file: 2024-09-01/ScriptExecutions_Get.json */ /** - * Sample code: PrivateClouds_ListAdminCredentials. + * Sample code: ScriptExecutions_Get. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsListAdminCredentials(com.azure.resourcemanager.avs.AvsManager manager) { - manager.privateClouds().listAdminCredentialsWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void scriptExecutionsGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.scriptExecutions() + .getWithResponse("group1", "cloud1", "addSsoServer", com.azure.core.util.Context.NONE); } } ``` -### PrivateClouds_ListByResourceGroup +### PrivateClouds_RotateVcenterPassword ```java /** - * Samples for PrivateClouds ListByResourceGroup. + * Samples for CloudLinks List. */ -public final class PrivateCloudsListByResourceGroupSamples { +public final class CloudLinksListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_List.json + * x-ms-original-file: 2024-09-01/CloudLinks_List.json */ /** - * Sample code: PrivateClouds_List. + * Sample code: CloudLinks_List. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.privateClouds().listByResourceGroup("group1", com.azure.core.util.Context.NONE); + public static void cloudLinksList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.cloudLinks().list("group1", "cloud1", com.azure.core.util.Context.NONE); } +} +``` +### PrivateClouds_Update + +```java +/** + * Samples for Hosts Get. + */ +public final class HostsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_List_Stretched.json + * x-ms-original-file: 2024-09-01/Hosts_Get.json */ /** - * Sample code: PrivateClouds_List_Stretched. + * Sample code: Hosts_Get. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsListStretched(com.azure.resourcemanager.avs.AvsManager manager) { - manager.privateClouds().listByResourceGroup("group1", com.azure.core.util.Context.NONE); + public static void hostsGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.hosts() + .getWithResponse("group1", "cloud1", "cluster1", + "esx03-r52.1111111111111111111.westcentralus.prod.azure.com", com.azure.core.util.Context.NONE); } } ``` -### PrivateClouds_RotateNsxtPassword +### ProvisionedNetworks_Get + +```java +import com.azure.resourcemanager.avs.models.DatastoreProperties; +import com.azure.resourcemanager.avs.models.NetAppVolume; + +/** + * Samples for Datastores CreateOrUpdate. + */ +public final class DatastoresCreateOrUpdateSamples { + /* + * x-ms-original-file: 2024-09-01/Datastores_CreateOrUpdate.json + */ + /** + * Sample code: Datastores_CreateOrUpdate. + * + * @param manager Entry point to AvsManager. + */ + public static void datastoresCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + manager.datastores() + .define("datastore1") + .withExistingCluster("group1", "cloud1", "cluster1") + .withProperties(new DatastoreProperties().withNetAppVolume(new NetAppVolume().withId( + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"))) + .create(); + } +} +``` + +### ProvisionedNetworks_List ```java /** @@ -1520,9 +1534,7 @@ public final class PrivateCloudsListByResourceGroupSamples { */ public final class PrivateCloudsRotateNsxtPasswordSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_RotateNsxtPassword. - * json + * x-ms-original-file: 2024-09-01/PrivateClouds_RotateNsxtPassword.json */ /** * Sample code: PrivateClouds_RotateNsxtPassword. @@ -1535,309 +1547,300 @@ public final class PrivateCloudsRotateNsxtPasswordSamples { } ``` -### PrivateClouds_RotateVcenterPassword +### ScriptCmdlets_Get ```java +import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsService; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProperties; +import java.util.Arrays; + /** - * Samples for PrivateClouds RotateVcenterPassword. + * Samples for WorkloadNetworks UpdateDnsService. */ -public final class PrivateCloudsRotateVcenterPasswordSamples { +public final class WorkloadNetworksUpdateDnsServiceSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * PrivateClouds_RotateVcenterPassword.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateDnsService.json */ /** - * Sample code: PrivateClouds_RotateVcenterPassword. + * Sample code: WorkloadNetworks_UpdateDnsService. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsRotateVcenterPassword(com.azure.resourcemanager.avs.AvsManager manager) { - manager.privateClouds().rotateVcenterPassword("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksUpdateDnsService(com.azure.resourcemanager.avs.AvsManager manager) { + WorkloadNetworkDnsService resource = manager.workloadNetworks() + .getDnsServiceWithResponse("group1", "cloud1", null, "dnsService1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new WorkloadNetworkDnsServiceProperties().withDisplayName("dnsService1") + .withDnsServiceIp("5.5.5.5") + .withDefaultDnsZone("defaultDnsZone1") + .withFqdnZones(Arrays.asList("fqdnZone1")) + .withLogLevel(DnsServiceLogLevelEnum.INFO) + .withRevision(1L)) + .apply(); } } ``` -### PrivateClouds_Update +### ScriptCmdlets_List ```java -import com.azure.resourcemanager.avs.models.Encryption; -import com.azure.resourcemanager.avs.models.EncryptionKeyVaultProperties; -import com.azure.resourcemanager.avs.models.EncryptionState; -import com.azure.resourcemanager.avs.models.ManagementCluster; -import com.azure.resourcemanager.avs.models.PrivateCloud; -import com.azure.resourcemanager.avs.models.PrivateCloudIdentity; -import com.azure.resourcemanager.avs.models.ResourceIdentityType; - /** - * Samples for PrivateClouds Update. + * Samples for Datastores Delete. */ -public final class PrivateCloudsUpdateSamples { +public final class DatastoresDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Update.json + * x-ms-original-file: 2024-09-01/Datastores_Delete.json */ /** - * Sample code: PrivateClouds_Update. + * Sample code: Datastores_Delete. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - PrivateCloud resource = manager.privateClouds() - .getByResourceGroupWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withIdentity(new PrivateCloudIdentity().withType(ResourceIdentityType.NONE)) - .withManagementCluster(new ManagementCluster().withClusterSize(4)) - .withEncryption(new Encryption().withStatus(EncryptionState.ENABLED) - .withKeyVaultProperties(new EncryptionKeyVaultProperties().withKeyName("fakeTokenPlaceholder") - .withKeyVersion("fakeTokenPlaceholder") - .withKeyVaultUrl("fakeTokenPlaceholder"))) - .apply(); + public static void datastoresDelete(com.azure.resourcemanager.avs.AvsManager manager) { + manager.datastores().delete("group1", "cloud1", "cluster1", "datastore1", com.azure.core.util.Context.NONE); } +} +``` + +### ScriptExecutions_CreateOrUpdate +```java +/** + * Samples for Clusters Delete. + */ +public final class ClustersDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Update_Stretched. - * json + * x-ms-original-file: 2024-09-01/Clusters_Delete.json */ /** - * Sample code: PrivateClouds_Update_Stretched. + * Sample code: Clusters_Delete. * * @param manager Entry point to AvsManager. */ - public static void privateCloudsUpdateStretched(com.azure.resourcemanager.avs.AvsManager manager) { - PrivateCloud resource = manager.privateClouds() - .getByResourceGroupWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withManagementCluster(new ManagementCluster().withClusterSize(4)).apply(); + public static void clustersDelete(com.azure.resourcemanager.avs.AvsManager manager) { + manager.clusters().delete("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); } } ``` -### ScriptCmdlets_Get +### ScriptExecutions_Delete ```java /** - * Samples for ScriptCmdlets Get. + * Samples for Clusters List. */ -public final class ScriptCmdletsGetSamples { +public final class ClustersListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptCmdlets_Get.json + * x-ms-original-file: 2024-09-01/Clusters_List.json */ /** - * Sample code: ScriptCmdlets_Get. + * Sample code: Clusters_List. * * @param manager Entry point to AvsManager. */ - public static void scriptCmdletsGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.scriptCmdlets() - .getWithResponse("group1", "cloud1", "package@1.0.2", "New-ExternalSsoDomain", - com.azure.core.util.Context.NONE); + public static void clustersList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.clusters().list("group1", "cloud1", com.azure.core.util.Context.NONE); } } ``` -### ScriptCmdlets_List +### ScriptExecutions_Get ```java /** - * Samples for ScriptCmdlets List. + * Samples for GlobalReachConnections Delete. */ -public final class ScriptCmdletsListSamples { +public final class GlobalReachConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptCmdlets_List.json + * x-ms-original-file: 2024-09-01/GlobalReachConnections_Delete.json */ /** - * Sample code: ScriptCmdlets_List. + * Sample code: GlobalReachConnections_Delete. * * @param manager Entry point to AvsManager. */ - public static void scriptCmdletsList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.scriptCmdlets().list("group1", "cloud1", "package@1.0.2", com.azure.core.util.Context.NONE); + public static void globalReachConnectionsDelete(com.azure.resourcemanager.avs.AvsManager manager) { + manager.globalReachConnections().delete("group1", "cloud1", "connection1", com.azure.core.util.Context.NONE); } } ``` -### ScriptExecutions_CreateOrUpdate +### ScriptExecutions_GetExecutionLogs ```java -import com.azure.resourcemanager.avs.models.ScriptSecureStringExecutionParameter; -import com.azure.resourcemanager.avs.models.ScriptStringExecutionParameter; -import java.util.Arrays; +/** + * Samples for PrivateClouds List. + */ +public final class PrivateCloudsListSamples { + /* + * x-ms-original-file: 2024-09-01/PrivateClouds_ListInSubscription.json + */ + /** + * Sample code: PrivateClouds_ListInSubscription. + * + * @param manager Entry point to AvsManager. + */ + public static void privateCloudsListInSubscription(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds().list(com.azure.core.util.Context.NONE); + } -/** - * Samples for ScriptExecutions CreateOrUpdate. - */ -public final class ScriptExecutionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_CreateOrUpdate. - * json + * x-ms-original-file: 2024-09-01/PrivateClouds_ListInSubscription_Stretched.json */ /** - * Sample code: ScriptExecutions_CreateOrUpdate. + * Sample code: PrivateClouds_ListInSubscription_Stretched. * * @param manager Entry point to AvsManager. */ - public static void scriptExecutionsCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { - manager.scriptExecutions() - .define("addSsoServer") - .withExistingPrivateCloud("group1", "cloud1") - .withScriptCmdletId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptPackages/AVS.PowerCommands@1.0.0/scriptCmdlets/New-SsoExternalIdentitySource") - .withParameters(Arrays.asList( - new ScriptStringExecutionParameter().withName("DomainName").withValue("placeholderDomain.local"), - new ScriptStringExecutionParameter().withName("BaseUserDN") - .withValue("DC=placeholder, DC=placeholder"))) - .withHiddenParameters(Arrays.asList( - new ScriptSecureStringExecutionParameter().withName("Password").withSecureValue("PlaceholderPassword"))) - .withTimeout("P0Y0M0DT0H60M60S") - .withRetention("P0Y0M60DT0H60M60S") - .create(); + public static void privateCloudsListInSubscriptionStretched(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds().list(com.azure.core.util.Context.NONE); } } ``` -### ScriptExecutions_Delete +### ScriptExecutions_List ```java /** - * Samples for ScriptExecutions Delete. + * Samples for WorkloadNetworks DeleteDnsZone. */ -public final class ScriptExecutionsDeleteSamples { +public final class WorkloadNetworksDeleteDnsZoneSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_Delete.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteDnsZone.json */ /** - * Sample code: ScriptExecutions_Delete. + * Sample code: WorkloadNetworks_DeleteDnsZone. * * @param manager Entry point to AvsManager. */ - public static void scriptExecutionsDelete(com.azure.resourcemanager.avs.AvsManager manager) { - manager.scriptExecutions().delete("group1", "cloud1", "addSsoServer", com.azure.core.util.Context.NONE); + public static void workloadNetworksDeleteDnsZone(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().deleteDnsZone("group1", "dnsZone1", "cloud1", com.azure.core.util.Context.NONE); } } ``` -### ScriptExecutions_Get +### ScriptPackages_Get ```java /** - * Samples for ScriptExecutions Get. + * Samples for Addons Delete. */ -public final class ScriptExecutionsGetSamples { +public final class AddonsDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_Get.json + * x-ms-original-file: 2024-09-01/Addons_Delete.json */ /** - * Sample code: ScriptExecutions_Get. + * Sample code: Addons_Delete. * * @param manager Entry point to AvsManager. */ - public static void scriptExecutionsGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.scriptExecutions() - .getWithResponse("group1", "cloud1", "addSsoServer", com.azure.core.util.Context.NONE); + public static void addonsDelete(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons().delete("group1", "cloud1", "srm", com.azure.core.util.Context.NONE); } } ``` -### ScriptExecutions_GetExecutionLogs +### ScriptPackages_List ```java -import com.azure.resourcemanager.avs.models.ScriptOutputStreamType; +import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProperties; import java.util.Arrays; /** - * Samples for ScriptExecutions GetExecutionLogs. + * Samples for WorkloadNetworks CreateDnsService. */ -public final class ScriptExecutionsGetExecutionLogsSamples { +public final class WorkloadNetworksCreateDnsServiceSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_GetExecutionLogs. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateDnsService.json */ /** - * Sample code: ScriptExecutions_GetExecutionLogs. + * Sample code: WorkloadNetworks_CreateDnsService. * * @param manager Entry point to AvsManager. */ - public static void scriptExecutionsGetExecutionLogs(com.azure.resourcemanager.avs.AvsManager manager) { - manager.scriptExecutions() - .getExecutionLogsWithResponse("group1", "cloud1", "addSsoServer", - Arrays.asList(ScriptOutputStreamType.INFORMATION, ScriptOutputStreamType.fromString("Warnings"), - ScriptOutputStreamType.fromString("Errors"), ScriptOutputStreamType.OUTPUT), - com.azure.core.util.Context.NONE); + public static void workloadNetworksCreateDnsService(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .defineDnsService("dnsService1") + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties(new WorkloadNetworkDnsServiceProperties().withDisplayName("dnsService1") + .withDnsServiceIp("5.5.5.5") + .withDefaultDnsZone("defaultDnsZone1") + .withFqdnZones(Arrays.asList("fqdnZone1")) + .withLogLevel(DnsServiceLogLevelEnum.INFO) + .withRevision(1L)) + .create(); } } ``` -### ScriptExecutions_List +### Skus_List ```java /** - * Samples for ScriptExecutions List. + * Samples for Addons Get. */ -public final class ScriptExecutionsListSamples { +public final class AddonsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_List.json + * x-ms-original-file: 2024-09-01/Addons_Get_HCX_With_Networks.json */ /** - * Sample code: ScriptExecutions_List. + * Sample code: Addons_Get_HCX_With_Networks. * * @param manager Entry point to AvsManager. */ - public static void scriptExecutionsList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.scriptExecutions().list("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void addonsGetHCXWithNetworks(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons().getWithResponse("group1", "cloud1", "hcx", com.azure.core.util.Context.NONE); } -} -``` -### ScriptPackages_Get + /* + * x-ms-original-file: 2024-09-01/Addons_Get_SRM.json + */ + /** + * Sample code: Addons_Get_SRM. + * + * @param manager Entry point to AvsManager. + */ + public static void addonsGetSRM(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons().getWithResponse("group1", "cloud1", "srm", com.azure.core.util.Context.NONE); + } -```java -/** - * Samples for ScriptPackages Get. - */ -public final class ScriptPackagesGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptPackages_Get.json + * x-ms-original-file: 2024-09-01/Addons_Get_VR.json */ /** - * Sample code: ScriptPackages_Get. + * Sample code: Addons_Get_VR. * * @param manager Entry point to AvsManager. */ - public static void scriptPackagesGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.scriptPackages() - .getWithResponse("group1", "cloud1", "Microsoft.AVS.Management@3.0.48", com.azure.core.util.Context.NONE); + public static void addonsGetVR(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons().getWithResponse("group1", "cloud1", "vr", com.azure.core.util.Context.NONE); } -} -``` -### ScriptPackages_List + /* + * x-ms-original-file: 2024-09-01/Addons_Get_HCX.json + */ + /** + * Sample code: Addons_Get_HCX. + * + * @param manager Entry point to AvsManager. + */ + public static void addonsGetHCX(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons().getWithResponse("group1", "cloud1", "hcx", com.azure.core.util.Context.NONE); + } -```java -/** - * Samples for ScriptPackages List. - */ -public final class ScriptPackagesListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptPackages_List.json + * x-ms-original-file: 2024-09-01/Addons_Get_ArcReg.json */ /** - * Sample code: ScriptPackages_List. + * Sample code: Addons_Get_ArcReg. * * @param manager Entry point to AvsManager. */ - public static void scriptPackagesList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.scriptPackages().list("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void addonsGetArcReg(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons().getWithResponse("group1", "cloud1", "arc", com.azure.core.util.Context.NONE); } } ``` @@ -1846,21 +1849,19 @@ public final class ScriptPackagesListSamples { ```java /** - * Samples for VirtualMachines Get. + * Samples for WorkloadNetworks Get. */ -public final class VirtualMachinesGetSamples { +public final class WorkloadNetworksGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/VirtualMachines_Get.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_Get.json */ /** - * Sample code: VirtualMachines_Get. + * Sample code: WorkloadNetworks_Get. * * @param manager Entry point to AvsManager. */ - public static void virtualMachinesGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.virtualMachines() - .getWithResponse("group1", "cloud1", "cluster1", "vm-209", com.azure.core.util.Context.NONE); + public static void workloadNetworksGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().getWithResponse("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } ``` @@ -1869,20 +1870,19 @@ public final class VirtualMachinesGetSamples { ```java /** - * Samples for VirtualMachines List. + * Samples for WorkloadNetworks DeletePublicIP. */ -public final class VirtualMachinesListSamples { +public final class WorkloadNetworksDeletePublicIPSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/VirtualMachines_List.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeletePublicIP.json */ /** - * Sample code: VirtualMachines_List. + * Sample code: WorkloadNetworks_DeletePublicIP. * * @param manager Entry point to AvsManager. */ - public static void virtualMachinesList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.virtualMachines().list("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); + public static void workloadNetworksDeletePublicIP(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().deletePublicIP("group1", "publicIP1", "cloud1", com.azure.core.util.Context.NONE); } } ``` @@ -1890,28 +1890,20 @@ public final class VirtualMachinesListSamples { ### VirtualMachines_RestrictMovement ```java -import com.azure.resourcemanager.avs.models.VirtualMachineRestrictMovement; -import com.azure.resourcemanager.avs.models.VirtualMachineRestrictMovementState; - /** - * Samples for VirtualMachines RestrictMovement. + * Samples for Locations CheckQuotaAvailability. */ -public final class VirtualMachinesRestrictMovementSamples { +public final class LocationsCheckQuotaAvailabilitySamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/VirtualMachines_RestrictMovement. - * json + * x-ms-original-file: 2024-09-01/Locations_CheckQuotaAvailability.json */ /** - * Sample code: VirtualMachines_RestrictMovement. + * Sample code: Locations_CheckQuotaAvailability. * * @param manager Entry point to AvsManager. */ - public static void virtualMachinesRestrictMovement(com.azure.resourcemanager.avs.AvsManager manager) { - manager.virtualMachines() - .restrictMovement("group1", "cloud1", "cluster1", "vm-209", - new VirtualMachineRestrictMovement().withRestrictMovement(VirtualMachineRestrictMovementState.ENABLED), - com.azure.core.util.Context.NONE); + public static void locationsCheckQuotaAvailability(com.azure.resourcemanager.avs.AvsManager manager) { + manager.locations().checkQuotaAvailabilityWithResponse("eastus", com.azure.core.util.Context.NONE); } } ``` @@ -1919,30 +1911,20 @@ public final class VirtualMachinesRestrictMovementSamples { ### WorkloadNetworks_CreateDhcp ```java -import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpServer; - /** - * Samples for WorkloadNetworks CreateDhcp. + * Samples for Skus List. */ -public final class WorkloadNetworksCreateDhcpSamples { +public final class SkusListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateDhcp.json + * x-ms-original-file: 2024-09-01/Skus_List.json */ /** - * Sample code: WorkloadNetworks_CreateDhcp. + * Sample code: Skus_List. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksCreateDhcp(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .defineDhcp("dhcp1") - .withExistingPrivateCloud("group1", "cloud1") - .withProperties(new WorkloadNetworkDhcpServer().withDisplayName("dhcpConfigurations1") - .withRevision(1L) - .withServerAddress("40.1.5.1/24") - .withLeaseTime(86400L)) - .create(); + public static void skusList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.skus().list(com.azure.core.util.Context.NONE); } } ``` @@ -1950,33 +1932,26 @@ public final class WorkloadNetworksCreateDhcpSamples { ### WorkloadNetworks_CreateDnsService ```java -import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; -import java.util.Arrays; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIpProperties; /** - * Samples for WorkloadNetworks CreateDnsService. + * Samples for WorkloadNetworks CreatePublicIP. */ -public final class WorkloadNetworksCreateDnsServiceSamples { +public final class WorkloadNetworksCreatePublicIPSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateDnsService. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreatePublicIP.json */ /** - * Sample code: WorkloadNetworks_CreateDnsService. + * Sample code: WorkloadNetworks_CreatePublicIP. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksCreateDnsService(com.azure.resourcemanager.avs.AvsManager manager) { + public static void workloadNetworksCreatePublicIP(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() - .defineDnsService("dnsService1") - .withExistingPrivateCloud("group1", "cloud1") - .withDisplayName("dnsService1") - .withDnsServiceIp("5.5.5.5") - .withDefaultDnsZone("defaultDnsZone1") - .withFqdnZones(Arrays.asList("fqdnZone1")) - .withLogLevel(DnsServiceLogLevelEnum.INFO) - .withRevision(1L) + .definePublicIP("publicIP1") + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties( + new WorkloadNetworkPublicIpProperties().withDisplayName("publicIP1").withNumberOfPublicIPs(32L)) .create(); } } @@ -1985,31 +1960,28 @@ public final class WorkloadNetworksCreateDnsServiceSamples { ### WorkloadNetworks_CreateDnsZone ```java -import java.util.Arrays; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpServer; /** - * Samples for WorkloadNetworks CreateDnsZone. + * Samples for WorkloadNetworks CreateDhcp. */ -public final class WorkloadNetworksCreateDnsZoneSamples { +public final class WorkloadNetworksCreateDhcpSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateDnsZone. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateDhcp.json */ /** - * Sample code: WorkloadNetworks_CreateDnsZone. + * Sample code: WorkloadNetworks_CreateDhcp. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksCreateDnsZone(com.azure.resourcemanager.avs.AvsManager manager) { + public static void workloadNetworksCreateDhcp(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() - .defineDnsZone("dnsZone1") - .withExistingPrivateCloud("group1", "cloud1") - .withDisplayName("dnsZone1") - .withDomain(Arrays.asList()) - .withDnsServerIps(Arrays.asList("1.1.1.1")) - .withSourceIp("8.8.8.8") - .withRevision(1L) + .defineDhcp("dhcp1") + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties(new WorkloadNetworkDhcpServer().withDisplayName("dhcpConfigurations1") + .withRevision(1L) + .withServerAddress("40.1.5.1/24") + .withLeaseTime(86400L)) .create(); } } @@ -2018,93 +1990,87 @@ public final class WorkloadNetworksCreateDnsZoneSamples { ### WorkloadNetworks_CreatePortMirroring ```java -import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; +import com.azure.resourcemanager.avs.models.Cluster; /** - * Samples for WorkloadNetworks CreatePortMirroring. + * Samples for Clusters Update. */ -public final class WorkloadNetworksCreatePortMirroringSamples { +public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * WorkloadNetworks_CreatePortMirroring.json + * x-ms-original-file: 2024-09-01/Clusters_Update.json */ /** - * Sample code: WorkloadNetworks_CreatePortMirroring. + * Sample code: Clusters_Update. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksCreatePortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .definePortMirroring("portMirroring1") - .withExistingPrivateCloud("group1", "cloud1") - .withDisplayName("portMirroring1") - .withDirection(PortMirroringDirectionEnum.BIDIRECTIONAL) - .withSource("vmGroup1") - .withDestination("vmGroup2") - .withRevision(1L) - .create(); + public static void clustersUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + Cluster resource = manager.clusters() + .getWithResponse("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withClusterSize(4).apply(); } } ``` -### WorkloadNetworks_CreatePublicIp +### WorkloadNetworks_CreatePublicIP ```java +import com.azure.resourcemanager.avs.models.CloudLinkProperties; + /** - * Samples for WorkloadNetworks CreatePublicIp. + * Samples for CloudLinks CreateOrUpdate. */ -public final class WorkloadNetworksCreatePublicIpSamples { +public final class CloudLinksCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreatePublicIP. - * json + * x-ms-original-file: 2024-09-01/CloudLinks_CreateOrUpdate.json */ /** - * Sample code: WorkloadNetworks_CreatePublicIP. + * Sample code: CloudLinks_CreateOrUpdate. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksCreatePublicIP(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .definePublicIp("publicIP1") + public static void cloudLinksCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + manager.cloudLinks() + .define("cloudLink1") .withExistingPrivateCloud("group1", "cloud1") - .withDisplayName("publicIP1") - .withNumberOfPublicIPs(32L) + .withProperties(new CloudLinkProperties().withLinkedCloud( + "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2")) .create(); } } ``` -### WorkloadNetworks_CreateSegments +### WorkloadNetworks_CreateSegment ```java -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; -import java.util.Arrays; +import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroring; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProperties; /** - * Samples for WorkloadNetworks CreateSegments. + * Samples for WorkloadNetworks UpdatePortMirroring. */ -public final class WorkloadNetworksCreateSegmentsSamples { +public final class WorkloadNetworksUpdatePortMirroringSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateSegments. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdatePortMirroring.json */ /** - * Sample code: WorkloadNetworks_CreateSegments. + * Sample code: WorkloadNetworks_UpdatePortMirroring. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksCreateSegments(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .defineSegments("segment1") - .withExistingPrivateCloud("group1", "cloud1") - .withDisplayName("segment1") - .withConnectedGateway("/infra/tier-1s/gateway") - .withSubnet(new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("40.20.0.0-40.20.0.1")) - .withGatewayAddress("40.20.20.20/16")) - .withRevision(1L) - .create(); + public static void workloadNetworksUpdatePortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { + WorkloadNetworkPortMirroring resource = manager.workloadNetworks() + .getPortMirroringWithResponse("group1", "cloud1", null, "portMirroring1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties( + new WorkloadNetworkPortMirroringProperties().withDirection(PortMirroringDirectionEnum.BIDIRECTIONAL) + .withSource("vmGroup1") + .withDestination("vmGroup2") + .withRevision(1L)) + .apply(); } } ``` @@ -2112,30 +2078,20 @@ public final class WorkloadNetworksCreateSegmentsSamples { ### WorkloadNetworks_CreateVMGroup ```java -import java.util.Arrays; - /** - * Samples for WorkloadNetworks CreateVMGroup. + * Samples for CloudLinks Delete. */ -public final class WorkloadNetworksCreateVMGroupSamples { +public final class CloudLinksDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateVMGroup. - * json + * x-ms-original-file: 2024-09-01/CloudLinks_Delete.json */ /** - * Sample code: WorkloadNetworks_CreateVMGroup. - * - * @param manager Entry point to AvsManager. - */ - public static void workloadNetworksCreateVMGroup(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .defineVMGroup("vmGroup1") - .withExistingPrivateCloud("group1", "cloud1") - .withDisplayName("vmGroup1") - .withMembers(Arrays.asList("564d43da-fefc-2a3b-1d92-42855622fa50")) - .withRevision(1L) - .create(); + * Sample code: CloudLinks_Delete. + * + * @param manager Entry point to AvsManager. + */ + public static void cloudLinksDelete(com.azure.resourcemanager.avs.AvsManager manager) { + manager.cloudLinks().delete("group1", "cloud1", "cloudLink1", com.azure.core.util.Context.NONE); } } ``` @@ -2144,20 +2100,19 @@ public final class WorkloadNetworksCreateVMGroupSamples { ```java /** - * Samples for WorkloadNetworks DeleteDhcp. + * Samples for HcxEnterpriseSites List. */ -public final class WorkloadNetworksDeleteDhcpSamples { +public final class HcxEnterpriseSitesListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteDhcp.json + * x-ms-original-file: 2024-09-01/HcxEnterpriseSites_List.json */ /** - * Sample code: WorkloadNetworks_DeleteDhcp. + * Sample code: HcxEnterpriseSites_List. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksDeleteDhcp(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().deleteDhcp("group1", "cloud1", "dhcp1", com.azure.core.util.Context.NONE); + public static void hcxEnterpriseSitesList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.hcxEnterpriseSites().list("group1", "cloud1", com.azure.core.util.Context.NONE); } } ``` @@ -2165,23 +2120,31 @@ public final class WorkloadNetworksDeleteDhcpSamples { ### WorkloadNetworks_DeleteDnsService ```java +import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProperties; + /** - * Samples for WorkloadNetworks DeleteDnsService. + * Samples for WorkloadNetworks CreatePortMirroring. */ -public final class WorkloadNetworksDeleteDnsServiceSamples { +public final class WorkloadNetworksCreatePortMirroringSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteDnsService. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreatePortMirroring.json */ /** - * Sample code: WorkloadNetworks_DeleteDnsService. + * Sample code: WorkloadNetworks_CreatePortMirroring. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksDeleteDnsService(com.azure.resourcemanager.avs.AvsManager manager) { + public static void workloadNetworksCreatePortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() - .deleteDnsService("group1", "dnsService1", "cloud1", com.azure.core.util.Context.NONE); + .definePortMirroring("portMirroring1") + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties(new WorkloadNetworkPortMirroringProperties().withDisplayName("portMirroring1") + .withDirection(PortMirroringDirectionEnum.BIDIRECTIONAL) + .withSource("vmGroup1") + .withDestination("vmGroup2") + .withRevision(1L)) + .create(); } } ``` @@ -2190,21 +2153,20 @@ public final class WorkloadNetworksDeleteDnsServiceSamples { ```java /** - * Samples for WorkloadNetworks DeleteDnsZone. + * Samples for WorkloadNetworks GetPublicIP. */ -public final class WorkloadNetworksDeleteDnsZoneSamples { +public final class WorkloadNetworksGetPublicIPSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteDnsZone. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetPublicIP.json */ /** - * Sample code: WorkloadNetworks_DeleteDnsZone. + * Sample code: WorkloadNetworks_GetPublicIP. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksDeleteDnsZone(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().deleteDnsZone("group1", "dnsZone1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksGetPublicIP(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .getPublicIPWithResponse("group1", "cloud1", null, "publicIP1", com.azure.core.util.Context.NONE); } } ``` @@ -2213,44 +2175,41 @@ public final class WorkloadNetworksDeleteDnsZoneSamples { ```java /** - * Samples for WorkloadNetworks DeletePortMirroring. + * Samples for PrivateClouds Delete. */ -public final class WorkloadNetworksDeletePortMirroringSamples { +public final class PrivateCloudsDeleteSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * WorkloadNetworks_DeletePortMirroring.json + * x-ms-original-file: 2024-09-01/PrivateClouds_Delete.json */ /** - * Sample code: WorkloadNetworks_DeletePortMirroring. + * Sample code: PrivateClouds_Delete. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksDeletePortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .deletePortMirroring("group1", "portMirroring1", "cloud1", com.azure.core.util.Context.NONE); + public static void privateCloudsDelete(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds().delete("group1", "cloud1", com.azure.core.util.Context.NONE); } } ``` -### WorkloadNetworks_DeletePublicIp +### WorkloadNetworks_DeletePublicIP ```java /** - * Samples for WorkloadNetworks DeletePublicIp. + * Samples for WorkloadNetworks GetGateway. */ -public final class WorkloadNetworksDeletePublicIpSamples { +public final class WorkloadNetworksGetGatewaySamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeletePublicIP. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetGateway.json */ /** - * Sample code: WorkloadNetworks_DeletePublicIP. + * Sample code: WorkloadNetworks_GetGateway. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksDeletePublicIP(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().deletePublicIp("group1", "publicIP1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksGetGateway(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .getGatewayWithResponse("group1", "cloud1", null, "gateway1", com.azure.core.util.Context.NONE); } } ``` @@ -2259,21 +2218,19 @@ public final class WorkloadNetworksDeletePublicIpSamples { ```java /** - * Samples for WorkloadNetworks DeleteSegment. + * Samples for WorkloadNetworks ListDnsZones. */ -public final class WorkloadNetworksDeleteSegmentSamples { +public final class WorkloadNetworksListDnsZonesSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteSegment. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListDnsZones.json */ /** - * Sample code: WorkloadNetworks_DeleteSegment. + * Sample code: WorkloadNetworks_ListDnsZones. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksDeleteSegment(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().deleteSegment("group1", "cloud1", "segment1", com.azure.core.util.Context.NONE); + public static void workloadNetworksListDnsZones(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().listDnsZones("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } ``` @@ -2282,21 +2239,19 @@ public final class WorkloadNetworksDeleteSegmentSamples { ```java /** - * Samples for WorkloadNetworks DeleteVMGroup. + * Samples for PrivateClouds RotateVcenterPassword. */ -public final class WorkloadNetworksDeleteVMGroupSamples { +public final class PrivateCloudsRotateVcenterPasswordSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteVMGroup. - * json + * x-ms-original-file: 2024-09-01/PrivateClouds_RotateVcenterPassword.json */ /** - * Sample code: WorkloadNetworks_DeleteVMGroup. + * Sample code: PrivateClouds_RotateVcenterPassword. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksDeleteVMGroup(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().deleteVMGroup("group1", "vmGroup1", "cloud1", com.azure.core.util.Context.NONE); + public static void privateCloudsRotateVcenterPassword(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds().rotateVcenterPassword("group1", "cloud1", com.azure.core.util.Context.NONE); } } ``` @@ -2305,20 +2260,19 @@ public final class WorkloadNetworksDeleteVMGroupSamples { ```java /** - * Samples for WorkloadNetworks Get. + * Samples for WorkloadNetworks ListDnsService. */ -public final class WorkloadNetworksGetSamples { +public final class WorkloadNetworksListDnsServiceSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_Get.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListDnsServices.json */ /** - * Sample code: WorkloadNetworks_Get. + * Sample code: WorkloadNetworks_ListDnsServices. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().getWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksListDnsServices(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().listDnsService("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } ``` @@ -2327,20 +2281,19 @@ public final class WorkloadNetworksGetSamples { ```java /** - * Samples for WorkloadNetworks GetDhcp. + * Samples for WorkloadNetworks DeleteDhcp. */ -public final class WorkloadNetworksGetDhcpSamples { +public final class WorkloadNetworksDeleteDhcpSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetDhcp.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteDhcp.json */ /** - * Sample code: WorkloadNetworks_GetDhcp. + * Sample code: WorkloadNetworks_DeleteDhcp. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksGetDhcp(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().getDhcpWithResponse("group1", "dhcp1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksDeleteDhcp(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().deleteDhcp("group1", "cloud1", null, "dhcp1", com.azure.core.util.Context.NONE); } } ``` @@ -2349,22 +2302,20 @@ public final class WorkloadNetworksGetDhcpSamples { ```java /** - * Samples for WorkloadNetworks GetDnsService. + * Samples for WorkloadNetworks GetPortMirroring. */ -public final class WorkloadNetworksGetDnsServiceSamples { +public final class WorkloadNetworksGetPortMirroringSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetDnsService. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetPortMirroring.json */ /** - * Sample code: WorkloadNetworks_GetDnsService. + * Sample code: WorkloadNetworks_GetPortMirroring. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksGetDnsService(com.azure.resourcemanager.avs.AvsManager manager) { + public static void workloadNetworksGetPortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() - .getDnsServiceWithResponse("group1", "cloud1", "dnsService1", com.azure.core.util.Context.NONE); + .getPortMirroringWithResponse("group1", "cloud1", null, "portMirroring1", com.azure.core.util.Context.NONE); } } ``` @@ -2373,21 +2324,19 @@ public final class WorkloadNetworksGetDnsServiceSamples { ```java /** - * Samples for WorkloadNetworks GetDnsZone. + * Samples for Addons List. */ -public final class WorkloadNetworksGetDnsZoneSamples { +public final class AddonsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetDnsZone.json + * x-ms-original-file: 2024-09-01/Addons_List.json */ /** - * Sample code: WorkloadNetworks_GetDnsZone. + * Sample code: Addons_List. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksGetDnsZone(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .getDnsZoneWithResponse("group1", "cloud1", "dnsZone1", com.azure.core.util.Context.NONE); + public static void addonsList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons().list("group1", "cloud1", com.azure.core.util.Context.NONE); } } ``` @@ -2395,22 +2344,124 @@ public final class WorkloadNetworksGetDnsZoneSamples { ### WorkloadNetworks_GetGateway ```java +import com.azure.resourcemanager.avs.models.AvailabilityProperties; +import com.azure.resourcemanager.avs.models.AvailabilityStrategy; +import com.azure.resourcemanager.avs.models.DnsZoneType; +import com.azure.resourcemanager.avs.models.ManagementCluster; +import com.azure.resourcemanager.avs.models.PrivateCloudIdentity; +import com.azure.resourcemanager.avs.models.PrivateCloudProperties; +import com.azure.resourcemanager.avs.models.Sku; +import com.azure.resourcemanager.avs.models.SystemAssignedServiceIdentityType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for WorkloadNetworks GetGateway. + * Samples for PrivateClouds CreateOrUpdate. */ -public final class WorkloadNetworksGetGatewaySamples { +public final class PrivateCloudsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetGateway.json + * x-ms-original-file: 2024-09-01/PrivateClouds_CreateOrUpdate.json */ /** - * Sample code: WorkloadNetworks_GetGateway. + * Sample code: PrivateClouds_CreateOrUpdate. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksGetGateway(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .getGatewayWithResponse("group1", "cloud1", "gateway1", com.azure.core.util.Context.NONE); + public static void privateCloudsCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds() + .define("cloud1") + .withRegion("eastus2") + .withExistingResourceGroup("group1") + .withSku(new Sku().withName("AV36")) + .withTags(mapOf()) + .withProperties( + new PrivateCloudProperties().withManagementCluster(new ManagementCluster().withClusterSize(4)) + .withNetworkBlock("192.168.48.0/22")) + .withIdentity(new PrivateCloudIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .create(); + } + + /* + * x-ms-original-file: 2024-09-01/PrivateClouds_CreateOrUpdate_StretchedZones.json + */ + /** + * Sample code: PrivateClouds_CreateOrUpdate_StretchedZones. + * + * @param manager Entry point to AvsManager. + */ + public static void privateCloudsCreateOrUpdateStretchedZones(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds() + .define("cloud1") + .withRegion("eastus2") + .withExistingResourceGroup("group1") + .withSku(new Sku().withName("AV36")) + .withTags(mapOf()) + .withProperties( + new PrivateCloudProperties().withManagementCluster(new ManagementCluster().withClusterSize(4)) + .withNetworkBlock("192.168.48.0/22")) + .withZones(Arrays.asList("1", "2")) + .create(); + } + + /* + * x-ms-original-file: 2024-09-01/PrivateClouds_CreateOrUpdate_FleetNative.json + */ + /** + * Sample code: PrivateClouds_CreateOrUpdate_FleetNative. + * + * @param manager Entry point to AvsManager. + */ + public static void privateCloudsCreateOrUpdateFleetNative(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds() + .define("cloud1") + .withRegion("eastus2") + .withExistingResourceGroup("group1") + .withSku(new Sku().withName("AV64")) + .withTags(mapOf()) + .withProperties(new PrivateCloudProperties() + .withManagementCluster(new ManagementCluster().withClusterSize(4)) + .withNetworkBlock("192.168.48.0/22") + .withVirtualNetworkId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/vnet") + .withDnsZoneType(DnsZoneType.PRIVATE)) + .create(); + } + + /* + * x-ms-original-file: 2024-09-01/PrivateClouds_CreateOrUpdate_Stretched.json + */ + /** + * Sample code: PrivateClouds_CreateOrUpdate_Stretched. + * + * @param manager Entry point to AvsManager. + */ + public static void privateCloudsCreateOrUpdateStretched(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds() + .define("cloud1") + .withRegion("eastus2") + .withExistingResourceGroup("group1") + .withSku(new Sku().withName("AV36")) + .withTags(mapOf()) + .withProperties( + new PrivateCloudProperties().withManagementCluster(new ManagementCluster().withClusterSize(4)) + .withAvailability(new AvailabilityProperties().withStrategy(AvailabilityStrategy.DUAL_ZONE) + .withZone(1) + .withSecondaryZone(2)) + .withNetworkBlock("192.168.48.0/22")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` @@ -2418,69 +2469,122 @@ public final class WorkloadNetworksGetGatewaySamples { ### WorkloadNetworks_GetPortMirroring ```java +import com.azure.resourcemanager.avs.models.Encryption; +import com.azure.resourcemanager.avs.models.EncryptionKeyVaultProperties; +import com.azure.resourcemanager.avs.models.EncryptionState; +import com.azure.resourcemanager.avs.models.ManagementCluster; +import com.azure.resourcemanager.avs.models.PrivateCloud; +import com.azure.resourcemanager.avs.models.PrivateCloudIdentity; +import com.azure.resourcemanager.avs.models.SystemAssignedServiceIdentityType; + +/** + * Samples for PrivateClouds Update. + */ +public final class PrivateCloudsUpdateSamples { + /* + * x-ms-original-file: 2024-09-01/PrivateClouds_Update.json + */ + /** + * Sample code: PrivateClouds_Update. + * + * @param manager Entry point to AvsManager. + */ + public static void privateCloudsUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + PrivateCloud resource = manager.privateClouds() + .getByResourceGroupWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withIdentity(new PrivateCloudIdentity().withType(SystemAssignedServiceIdentityType.NONE)) + .withManagementCluster(new ManagementCluster().withClusterSize(4)) + .withEncryption(new Encryption().withStatus(EncryptionState.ENABLED) + .withKeyVaultProperties(new EncryptionKeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUrl("fakeTokenPlaceholder"))) + .apply(); + } + + /* + * x-ms-original-file: 2024-09-01/PrivateClouds_Update_Stretched.json + */ + /** + * Sample code: PrivateClouds_Update_Stretched. + * + * @param manager Entry point to AvsManager. + */ + public static void privateCloudsUpdateStretched(com.azure.resourcemanager.avs.AvsManager manager) { + PrivateCloud resource = manager.privateClouds() + .getByResourceGroupWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withManagementCluster(new ManagementCluster().withClusterSize(4)).apply(); + } +} +``` + +### WorkloadNetworks_GetPublicIP + +```java +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroup; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProperties; +import java.util.Arrays; + /** - * Samples for WorkloadNetworks GetPortMirroring. + * Samples for WorkloadNetworks UpdateVMGroup. */ -public final class WorkloadNetworksGetPortMirroringSamples { +public final class WorkloadNetworksUpdateVMGroupSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetPortMirroring. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateVMGroup.json */ /** - * Sample code: WorkloadNetworks_GetPortMirroring. + * Sample code: WorkloadNetworks_UpdateVMGroup. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksGetPortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .getPortMirroringWithResponse("group1", "cloud1", "portMirroring1", com.azure.core.util.Context.NONE); + public static void workloadNetworksUpdateVMGroup(com.azure.resourcemanager.avs.AvsManager manager) { + WorkloadNetworkVMGroup resource = manager.workloadNetworks() + .getVMGroupWithResponse("group1", "cloud1", null, "vmGroup1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new WorkloadNetworkVMGroupProperties() + .withMembers(Arrays.asList("564d43da-fefc-2a3b-1d92-42855622fa50")) + .withRevision(1L)) + .apply(); } } ``` -### WorkloadNetworks_GetPublicIp +### WorkloadNetworks_GetSegment ```java +import com.azure.resourcemanager.avs.models.Sku; + /** - * Samples for WorkloadNetworks GetPublicIp. + * Samples for Locations CheckTrialAvailability. */ -public final class WorkloadNetworksGetPublicIpSamples { +public final class LocationsCheckTrialAvailabilitySamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetPublicIP.json + * x-ms-original-file: 2024-09-01/Locations_CheckTrialAvailability.json */ /** - * Sample code: WorkloadNetworks_GetPublicIP. + * Sample code: Locations_CheckTrialAvailability. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksGetPublicIP(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .getPublicIpWithResponse("group1", "cloud1", "publicIP1", com.azure.core.util.Context.NONE); + public static void locationsCheckTrialAvailability(com.azure.resourcemanager.avs.AvsManager manager) { + manager.locations().checkTrialAvailabilityWithResponse("eastus", null, com.azure.core.util.Context.NONE); } -} -``` - -### WorkloadNetworks_GetSegment -```java -/** - * Samples for WorkloadNetworks GetSegment. - */ -public final class WorkloadNetworksGetSegmentSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetSegment.json + * x-ms-original-file: 2024-09-01/Locations_CheckTrialAvailabilityWithSku.json */ /** - * Sample code: WorkloadNetworks_GetSegment. + * Sample code: Locations_CheckTrialAvailabilityWithSku. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksGetSegment(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .getSegmentWithResponse("group1", "cloud1", "segment1", com.azure.core.util.Context.NONE); + public static void locationsCheckTrialAvailabilityWithSku(com.azure.resourcemanager.avs.AvsManager manager) { + manager.locations() + .checkTrialAvailabilityWithResponse("eastus", new Sku().withName("avs52t"), + com.azure.core.util.Context.NONE); } } ``` @@ -2489,21 +2593,19 @@ public final class WorkloadNetworksGetSegmentSamples { ```java /** - * Samples for WorkloadNetworks GetVMGroup. + * Samples for HcxEnterpriseSites Get. */ -public final class WorkloadNetworksGetVMGroupSamples { +public final class HcxEnterpriseSitesGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetVMGroup.json + * x-ms-original-file: 2024-09-01/HcxEnterpriseSites_Get.json */ /** - * Sample code: WorkloadNetworks_GetVMGroup. + * Sample code: HcxEnterpriseSites_Get. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksGetVMGroup(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .getVMGroupWithResponse("group1", "cloud1", "vmGroup1", com.azure.core.util.Context.NONE); + public static void hcxEnterpriseSitesGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.hcxEnterpriseSites().getWithResponse("group1", "cloud1", "site1", com.azure.core.util.Context.NONE); } } ``` @@ -2512,22 +2614,19 @@ public final class WorkloadNetworksGetVMGroupSamples { ```java /** - * Samples for WorkloadNetworks GetVirtualMachine. + * Samples for Hosts List. */ -public final class WorkloadNetworksGetVirtualMachineSamples { +public final class HostsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetVirtualMachine - * .json + * x-ms-original-file: 2024-09-01/Hosts_List.json */ /** - * Sample code: WorkloadNetworks_GetVirtualMachine. + * Sample code: Hosts_List. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksGetVirtualMachine(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .getVirtualMachineWithResponse("group1", "cloud1", "vm1", com.azure.core.util.Context.NONE); + public static void hostsList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.hosts().list("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); } } ``` @@ -2536,20 +2635,20 @@ public final class WorkloadNetworksGetVirtualMachineSamples { ```java /** - * Samples for WorkloadNetworks List. + * Samples for WorkloadNetworks GetVirtualMachine. */ -public final class WorkloadNetworksListSamples { +public final class WorkloadNetworksGetVirtualMachineSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_List.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetVirtualMachine.json */ /** - * Sample code: WorkloadNetworks_List. + * Sample code: WorkloadNetworks_GetVirtualMachine. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksList(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().list("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksGetVirtualMachine(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .getVirtualMachineWithResponse("group1", "cloud1", null, "vm1", com.azure.core.util.Context.NONE); } } ``` @@ -2558,43 +2657,41 @@ public final class WorkloadNetworksListSamples { ```java /** - * Samples for WorkloadNetworks ListDhcp. + * Samples for ScriptExecutions List. */ -public final class WorkloadNetworksListDhcpSamples { +public final class ScriptExecutionsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListDhcp.json + * x-ms-original-file: 2024-09-01/ScriptExecutions_List.json */ /** - * Sample code: WorkloadNetworks_ListDhcp. + * Sample code: ScriptExecutions_List. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksListDhcp(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listDhcp("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void scriptExecutionsList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.scriptExecutions().list("group1", "cloud1", com.azure.core.util.Context.NONE); } } ``` -### WorkloadNetworks_ListDnsServices +### WorkloadNetworks_ListDnsService ```java /** - * Samples for WorkloadNetworks ListDnsServices. + * Samples for WorkloadNetworks DeleteDnsService. */ -public final class WorkloadNetworksListDnsServicesSamples { +public final class WorkloadNetworksDeleteDnsServiceSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListDnsServices. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteDnsService.json */ /** - * Sample code: WorkloadNetworks_ListDnsServices. + * Sample code: WorkloadNetworks_DeleteDnsService. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksListDnsServices(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listDnsServices("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksDeleteDnsService(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .deleteDnsService("group1", "dnsService1", "cloud1", com.azure.core.util.Context.NONE); } } ``` @@ -2602,21 +2699,38 @@ public final class WorkloadNetworksListDnsServicesSamples { ### WorkloadNetworks_ListDnsZones ```java +import com.azure.resourcemanager.avs.models.ScriptExecutionProperties; +import com.azure.resourcemanager.avs.models.ScriptSecureStringExecutionParameter; +import com.azure.resourcemanager.avs.models.ScriptStringExecutionParameter; +import java.util.Arrays; + /** - * Samples for WorkloadNetworks ListDnsZones. + * Samples for ScriptExecutions CreateOrUpdate. */ -public final class WorkloadNetworksListDnsZonesSamples { +public final class ScriptExecutionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListDnsZones.json + * x-ms-original-file: 2024-09-01/ScriptExecutions_CreateOrUpdate.json */ /** - * Sample code: WorkloadNetworks_ListDnsZones. + * Sample code: ScriptExecutions_CreateOrUpdate. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksListDnsZones(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listDnsZones("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void scriptExecutionsCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + manager.scriptExecutions() + .define("addSsoServer") + .withExistingPrivateCloud("group1", "cloud1") + .withProperties(new ScriptExecutionProperties().withScriptCmdletId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptPackages/AVS.PowerCommands@1.0.0/scriptCmdlets/New-SsoExternalIdentitySource") + .withParameters(Arrays.asList( + new ScriptStringExecutionParameter().withName("DomainName").withValue("placeholderDomain.local"), + new ScriptStringExecutionParameter().withName("BaseUserDN") + .withValue("DC=placeholder, DC=placeholder"))) + .withHiddenParameters(Arrays.asList(new ScriptSecureStringExecutionParameter().withName("Password") + .withSecureValue("PlaceholderPassword"))) + .withTimeout("P0Y0M0DT0H60M60S") + .withRetention("P0Y0M60DT0H60M60S")) + .create(); } } ``` @@ -2625,20 +2739,20 @@ public final class WorkloadNetworksListDnsZonesSamples { ```java /** - * Samples for WorkloadNetworks ListGateways. + * Samples for WorkloadNetworks GetVMGroup. */ -public final class WorkloadNetworksListGatewaysSamples { +public final class WorkloadNetworksGetVMGroupSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListGateways.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetVMGroup.json */ /** - * Sample code: WorkloadNetworks_ListGateways. + * Sample code: WorkloadNetworks_GetVMGroup. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksListGateways(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listGateways("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksGetVMGroup(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .getVMGroupWithResponse("group1", "cloud1", null, "vmGroup1", com.azure.core.util.Context.NONE); } } ``` @@ -2647,21 +2761,20 @@ public final class WorkloadNetworksListGatewaysSamples { ```java /** - * Samples for WorkloadNetworks ListPortMirroring. + * Samples for WorkloadNetworks GetSegment. */ -public final class WorkloadNetworksListPortMirroringSamples { +public final class WorkloadNetworksGetSegmentSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListPortMirroring - * .json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetSegment.json */ /** - * Sample code: WorkloadNetworks_ListPortMirroring. + * Sample code: WorkloadNetworks_GetSegment. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksListPortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listPortMirroring("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksGetSegment(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .getSegmentWithResponse("group1", "cloud1", null, "segment1", com.azure.core.util.Context.NONE); } } ``` @@ -2670,118 +2783,95 @@ public final class WorkloadNetworksListPortMirroringSamples { ```java /** - * Samples for WorkloadNetworks ListPublicIPs. + * Samples for PrivateClouds GetByResourceGroup. */ -public final class WorkloadNetworksListPublicIPsSamples { +public final class PrivateCloudsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListPublicIPs. - * json + * x-ms-original-file: 2024-09-01/PrivateClouds_Get.json */ /** - * Sample code: WorkloadNetworks_ListPublicIPs. + * Sample code: PrivateClouds_Get. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksListPublicIPs(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listPublicIPs("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void privateCloudsGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds().getByResourceGroupWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE); } -} -``` -### WorkloadNetworks_ListSegments - -```java -/** - * Samples for WorkloadNetworks ListSegments. - */ -public final class WorkloadNetworksListSegmentsSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListSegments.json + * x-ms-original-file: 2024-09-01/PrivateClouds_Get_Stretched.json */ /** - * Sample code: WorkloadNetworks_ListSegments. + * Sample code: PrivateClouds_Get_Stretched. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksListSegments(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listSegments("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void privateCloudsGetStretched(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds().getByResourceGroupWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE); } } ``` -### WorkloadNetworks_ListVMGroups +### WorkloadNetworks_ListSegments ```java /** - * Samples for WorkloadNetworks ListVMGroups. + * Samples for ScriptPackages Get. */ -public final class WorkloadNetworksListVMGroupsSamples { +public final class ScriptPackagesGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListVMGroups.json + * x-ms-original-file: 2024-09-01/ScriptPackages_Get.json */ /** - * Sample code: WorkloadNetworks_ListVMGroups. + * Sample code: ScriptPackages_Get. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksListVMGroups(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listVMGroups("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void scriptPackagesGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.scriptPackages() + .getWithResponse("group1", "cloud1", "Microsoft.AVS.Management@3.0.48", com.azure.core.util.Context.NONE); } } ``` -### WorkloadNetworks_ListVirtualMachines +### WorkloadNetworks_ListVMGroups ```java /** - * Samples for WorkloadNetworks ListVirtualMachines. + * Samples for WorkloadNetworks ListVMGroups. */ -public final class WorkloadNetworksListVirtualMachinesSamples { +public final class WorkloadNetworksListVMGroupsSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * WorkloadNetworks_ListVirtualMachines.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListVMGroups.json */ /** - * Sample code: WorkloadNetworks_ListVirtualMachines. + * Sample code: WorkloadNetworks_ListVMGroups. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksListVirtualMachines(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listVirtualMachines("group1", "cloud1", com.azure.core.util.Context.NONE); + public static void workloadNetworksListVMGroups(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().listVMGroups("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } ``` -### WorkloadNetworks_UpdateDhcp +### WorkloadNetworks_ListVirtualMachines ```java -import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcp; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpServer; - /** - * Samples for WorkloadNetworks UpdateDhcp. + * Samples for ScriptPackages List. */ -public final class WorkloadNetworksUpdateDhcpSamples { +public final class ScriptPackagesListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateDhcp.json + * x-ms-original-file: 2024-09-01/ScriptPackages_List.json */ /** - * Sample code: WorkloadNetworks_UpdateDhcp. + * Sample code: ScriptPackages_List. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksUpdateDhcp(com.azure.resourcemanager.avs.AvsManager manager) { - WorkloadNetworkDhcp resource = manager.workloadNetworks() - .getDhcpWithResponse("group1", "dhcp1", "cloud1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties( - new WorkloadNetworkDhcpServer().withRevision(1L).withServerAddress("40.1.5.1/24").withLeaseTime(86400L)) - .apply(); + public static void scriptPackagesList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.scriptPackages().list("group1", "cloud1", com.azure.core.util.Context.NONE); } } ``` @@ -2789,36 +2879,27 @@ public final class WorkloadNetworksUpdateDhcpSamples { ### WorkloadNetworks_UpdateDnsService ```java -import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsService; +import com.azure.resourcemanager.avs.models.ScriptOutputStreamType; import java.util.Arrays; /** - * Samples for WorkloadNetworks UpdateDnsService. + * Samples for ScriptExecutions GetExecutionLogs. */ -public final class WorkloadNetworksUpdateDnsServiceSamples { +public final class ScriptExecutionsGetExecutionLogsSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateDnsService. - * json + * x-ms-original-file: 2024-09-01/ScriptExecutions_GetExecutionLogs.json */ /** - * Sample code: WorkloadNetworks_UpdateDnsService. + * Sample code: ScriptExecutions_GetExecutionLogs. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksUpdateDnsService(com.azure.resourcemanager.avs.AvsManager manager) { - WorkloadNetworkDnsService resource = manager.workloadNetworks() - .getDnsServiceWithResponse("group1", "cloud1", "dnsService1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDisplayName("dnsService1") - .withDnsServiceIp("5.5.5.5") - .withDefaultDnsZone("defaultDnsZone1") - .withFqdnZones(Arrays.asList("fqdnZone1")) - .withLogLevel(DnsServiceLogLevelEnum.INFO) - .withRevision(1L) - .apply(); + public static void scriptExecutionsGetExecutionLogs(com.azure.resourcemanager.avs.AvsManager manager) { + manager.scriptExecutions() + .getExecutionLogsWithResponse("group1", "cloud1", "addSsoServer", + Arrays.asList(ScriptOutputStreamType.INFORMATION, ScriptOutputStreamType.fromString("Warnings"), + ScriptOutputStreamType.fromString("Errors"), ScriptOutputStreamType.OUTPUT), + com.azure.core.util.Context.NONE); } } ``` @@ -2826,34 +2907,20 @@ public final class WorkloadNetworksUpdateDnsServiceSamples { ### WorkloadNetworks_UpdateDnsZone ```java -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZone; -import java.util.Arrays; - /** - * Samples for WorkloadNetworks UpdateDnsZone. + * Samples for WorkloadNetworks List. */ -public final class WorkloadNetworksUpdateDnsZoneSamples { +public final class WorkloadNetworksListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateDnsZone. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_List.json */ /** - * Sample code: WorkloadNetworks_UpdateDnsZone. + * Sample code: WorkloadNetworks_List. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksUpdateDnsZone(com.azure.resourcemanager.avs.AvsManager manager) { - WorkloadNetworkDnsZone resource = manager.workloadNetworks() - .getDnsZoneWithResponse("group1", "cloud1", "dnsZone1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDisplayName("dnsZone1") - .withDomain(Arrays.asList()) - .withDnsServerIps(Arrays.asList("1.1.1.1")) - .withSourceIp("8.8.8.8") - .withRevision(1L) - .apply(); + public static void workloadNetworksList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().list("group1", "cloud1", com.azure.core.util.Context.NONE); } } ``` @@ -2861,67 +2928,42 @@ public final class WorkloadNetworksUpdateDnsZoneSamples { ### WorkloadNetworks_UpdatePortMirroring ```java -import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroring; - /** - * Samples for WorkloadNetworks UpdatePortMirroring. + * Samples for WorkloadNetworks DeletePortMirroring. */ -public final class WorkloadNetworksUpdatePortMirroringSamples { +public final class WorkloadNetworksDeletePortMirroringSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * WorkloadNetworks_UpdatePortMirroring.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeletePortMirroring.json */ /** - * Sample code: WorkloadNetworks_UpdatePortMirroring. + * Sample code: WorkloadNetworks_DeletePortMirroring. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksUpdatePortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { - WorkloadNetworkPortMirroring resource = manager.workloadNetworks() - .getPortMirroringWithResponse("group1", "cloud1", "portMirroring1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDirection(PortMirroringDirectionEnum.BIDIRECTIONAL) - .withSource("vmGroup1") - .withDestination("vmGroup2") - .withRevision(1L) - .apply(); + public static void workloadNetworksDeletePortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .deletePortMirroring("group1", "portMirroring1", "cloud1", com.azure.core.util.Context.NONE); } } ``` -### WorkloadNetworks_UpdateSegments +### WorkloadNetworks_UpdateSegment ```java -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; -import java.util.Arrays; - /** - * Samples for WorkloadNetworks UpdateSegments. + * Samples for WorkloadNetworks ListPortMirroring. */ -public final class WorkloadNetworksUpdateSegmentsSamples { +public final class WorkloadNetworksListPortMirroringSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateSegments. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListPortMirroring.json */ /** - * Sample code: WorkloadNetworks_UpdateSegments. + * Sample code: WorkloadNetworks_ListPortMirroring. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksUpdateSegments(com.azure.resourcemanager.avs.AvsManager manager) { - WorkloadNetworkSegment resource = manager.workloadNetworks() - .getSegmentWithResponse("group1", "cloud1", "segment1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withConnectedGateway("/infra/tier-1s/gateway") - .withSubnet(new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("40.20.0.0-40.20.0.1")) - .withGatewayAddress("40.20.20.20/16")) - .withRevision(1L) - .apply(); + public static void workloadNetworksListPortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().listPortMirroring("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } ``` @@ -2929,28 +2971,37 @@ public final class WorkloadNetworksUpdateSegmentsSamples { ### WorkloadNetworks_UpdateVMGroup ```java -import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroup; +import com.azure.resourcemanager.avs.models.AffinityStrength; +import com.azure.resourcemanager.avs.models.AffinityType; +import com.azure.resourcemanager.avs.models.AzureHybridBenefitType; +import com.azure.resourcemanager.avs.models.VmHostPlacementPolicyProperties; import java.util.Arrays; /** - * Samples for WorkloadNetworks UpdateVMGroup. + * Samples for PlacementPolicies CreateOrUpdate. */ -public final class WorkloadNetworksUpdateVMGroupSamples { +public final class PlacementPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateVMGroup. - * json + * x-ms-original-file: 2024-09-01/PlacementPolicies_CreateOrUpdate.json */ /** - * Sample code: WorkloadNetworks_UpdateVMGroup. + * Sample code: PlacementPolicies_CreateOrUpdate. * * @param manager Entry point to AvsManager. */ - public static void workloadNetworksUpdateVMGroup(com.azure.resourcemanager.avs.AvsManager manager) { - WorkloadNetworkVMGroup resource = manager.workloadNetworks() - .getVMGroupWithResponse("group1", "cloud1", "vmGroup1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withMembers(Arrays.asList("564d43da-fefc-2a3b-1d92-42855622fa50")).withRevision(1L).apply(); + public static void placementPoliciesCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + manager.placementPolicies() + .define("policy1") + .withExistingCluster("group1", "cloud1", "cluster1") + .withProperties(new VmHostPlacementPolicyProperties().withVmMembers(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256")) + .withHostMembers(Arrays.asList("fakehost22.nyc1.kubernetes.center", "fakehost23.nyc1.kubernetes.center", + "fakehost24.nyc1.kubernetes.center")) + .withAffinityType(AffinityType.ANTI_AFFINITY) + .withAffinityStrength(AffinityStrength.MUST) + .withAzureHybridBenefitType(AzureHybridBenefitType.SQL_HOST)) + .create(); } } ``` diff --git a/sdk/avs/azure-resourcemanager-avs/pom.xml b/sdk/avs/azure-resourcemanager-avs/pom.xml index 462b4827737d..80b1e647a4de 100644 --- a/sdk/avs/azure-resourcemanager-avs/pom.xml +++ b/sdk/avs/azure-resourcemanager-avs/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -17,8 +17,8 @@ 1.3.0-beta.1 jar - Microsoft Azure SDK for Avs Management - This package contains Microsoft Azure SDK for Avs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure VMware Solution API. Package tag package-2023-09-01. + Microsoft Azure SDK for avs Management + This package contains Microsoft Azure SDK for avs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure VMware Solution API. https://github.com/Azure/azure-sdk-for-java @@ -48,11 +48,6 @@ true - - com.azure - azure-json - 1.5.0 - com.azure azure-core @@ -75,6 +70,11 @@ 1.16.0 test + + com.azure + azure-json + 1.5.0 + com.azure.resourcemanager azure-resourcemanager-resources diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java index 43adf5e6af2e..fc3c6bc05fc0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs; @@ -11,17 +11,18 @@ 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.HttpLoggingPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; 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.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.AvsClient; import com.azure.resourcemanager.avs.implementation.AddonsImpl; @@ -32,14 +33,17 @@ import com.azure.resourcemanager.avs.implementation.DatastoresImpl; import com.azure.resourcemanager.avs.implementation.GlobalReachConnectionsImpl; import com.azure.resourcemanager.avs.implementation.HcxEnterpriseSitesImpl; +import com.azure.resourcemanager.avs.implementation.HostsImpl; import com.azure.resourcemanager.avs.implementation.IscsiPathsImpl; import com.azure.resourcemanager.avs.implementation.LocationsImpl; import com.azure.resourcemanager.avs.implementation.OperationsImpl; import com.azure.resourcemanager.avs.implementation.PlacementPoliciesImpl; import com.azure.resourcemanager.avs.implementation.PrivateCloudsImpl; +import com.azure.resourcemanager.avs.implementation.ProvisionedNetworksImpl; import com.azure.resourcemanager.avs.implementation.ScriptCmdletsImpl; import com.azure.resourcemanager.avs.implementation.ScriptExecutionsImpl; import com.azure.resourcemanager.avs.implementation.ScriptPackagesImpl; +import com.azure.resourcemanager.avs.implementation.SkusImpl; import com.azure.resourcemanager.avs.implementation.VirtualMachinesImpl; import com.azure.resourcemanager.avs.implementation.WorkloadNetworksImpl; import com.azure.resourcemanager.avs.models.Addons; @@ -49,20 +53,24 @@ import com.azure.resourcemanager.avs.models.Datastores; import com.azure.resourcemanager.avs.models.GlobalReachConnections; import com.azure.resourcemanager.avs.models.HcxEnterpriseSites; +import com.azure.resourcemanager.avs.models.Hosts; import com.azure.resourcemanager.avs.models.IscsiPaths; import com.azure.resourcemanager.avs.models.Locations; import com.azure.resourcemanager.avs.models.Operations; import com.azure.resourcemanager.avs.models.PlacementPolicies; import com.azure.resourcemanager.avs.models.PrivateClouds; +import com.azure.resourcemanager.avs.models.ProvisionedNetworks; import com.azure.resourcemanager.avs.models.ScriptCmdlets; import com.azure.resourcemanager.avs.models.ScriptExecutions; import com.azure.resourcemanager.avs.models.ScriptPackages; +import com.azure.resourcemanager.avs.models.Skus; import com.azure.resourcemanager.avs.models.VirtualMachines; import com.azure.resourcemanager.avs.models.WorkloadNetworks; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -71,39 +79,45 @@ * Azure VMware Solution API. */ public final class AvsManager { + private WorkloadNetworks workloadNetworks; + private Operations operations; private Locations locations; private PrivateClouds privateClouds; - private Addons addons; + private Clusters clusters; + + private Datastores datastores; + + private HcxEnterpriseSites hcxEnterpriseSites; private Authorizations authorizations; + private GlobalReachConnections globalReachConnections; + private CloudLinks cloudLinks; - private Clusters clusters; + private Addons addons; - private Datastores datastores; + private VirtualMachines virtualMachines; private PlacementPolicies placementPolicies; - private VirtualMachines virtualMachines; + private ScriptPackages scriptPackages; - private GlobalReachConnections globalReachConnections; + private ScriptCmdlets scriptCmdlets; - private HcxEnterpriseSites hcxEnterpriseSites; + private ScriptExecutions scriptExecutions; private IscsiPaths iscsiPaths; - private ScriptExecutions scriptExecutions; - - private ScriptPackages scriptPackages; + private Hosts hosts; - private ScriptCmdlets scriptCmdlets; + private ProvisionedNetworks provisionedNetworks; - private WorkloadNetworks workloadNetworks; + private Skus skus; private final AvsClient clientObject; @@ -118,11 +132,11 @@ private AvsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration def } /** - * Creates an instance of Avs service API entry point. + * Creates an instance of avs service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the Avs service API instance. + * @return the avs service API instance. */ public static AvsManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); @@ -131,11 +145,11 @@ public static AvsManager authenticate(TokenCredential credential, AzureProfile p } /** - * Creates an instance of Avs service API entry point. + * Creates an instance of avs service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the Avs service API instance. + * @return the avs service API instance. */ public static AvsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); @@ -157,6 +171,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-avs.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -254,22 +271,24 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of Avs service API entry point. + * Creates an instance of avs service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the Avs service API instance. + * @return the avs service API instance. */ public AvsManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.avs") .append("/") - .append("1.2.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -302,7 +321,7 @@ public AvsManager authenticate(TokenCredential credential, AzureProfile profile) HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .collect(Collectors.toList())); @@ -315,6 +334,20 @@ public AvsManager authenticate(TokenCredential credential, AzureProfile profile) } } + /** + * Gets the resource collection API of WorkloadNetworks. It manages WorkloadNetworkDhcp, WorkloadNetworkDnsService, + * WorkloadNetworkDnsZone, WorkloadNetworkPortMirroring, WorkloadNetworkPublicIp, WorkloadNetworkSegment, + * WorkloadNetworkVMGroup. + * + * @return Resource collection API of WorkloadNetworks. + */ + public WorkloadNetworks workloadNetworks() { + if (this.workloadNetworks == null) { + this.workloadNetworks = new WorkloadNetworksImpl(clientObject.getWorkloadNetworks(), this); + } + return workloadNetworks; + } + /** * Gets the resource collection API of Operations. * @@ -352,15 +385,39 @@ public PrivateClouds privateClouds() { } /** - * Gets the resource collection API of Addons. It manages Addon. + * Gets the resource collection API of Clusters. It manages Cluster. * - * @return Resource collection API of Addons. + * @return Resource collection API of Clusters. */ - public Addons addons() { - if (this.addons == null) { - this.addons = new AddonsImpl(clientObject.getAddons(), this); + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); } - return addons; + return clusters; + } + + /** + * Gets the resource collection API of Datastores. It manages Datastore. + * + * @return Resource collection API of Datastores. + */ + public Datastores datastores() { + if (this.datastores == null) { + this.datastores = new DatastoresImpl(clientObject.getDatastores(), this); + } + return datastores; + } + + /** + * Gets the resource collection API of HcxEnterpriseSites. It manages HcxEnterpriseSite. + * + * @return Resource collection API of HcxEnterpriseSites. + */ + public HcxEnterpriseSites hcxEnterpriseSites() { + if (this.hcxEnterpriseSites == null) { + this.hcxEnterpriseSites = new HcxEnterpriseSitesImpl(clientObject.getHcxEnterpriseSites(), this); + } + return hcxEnterpriseSites; } /** @@ -375,6 +432,19 @@ public Authorizations authorizations() { return authorizations; } + /** + * Gets the resource collection API of GlobalReachConnections. It manages GlobalReachConnection. + * + * @return Resource collection API of GlobalReachConnections. + */ + public GlobalReachConnections globalReachConnections() { + if (this.globalReachConnections == null) { + this.globalReachConnections + = new GlobalReachConnectionsImpl(clientObject.getGlobalReachConnections(), this); + } + return globalReachConnections; + } + /** * Gets the resource collection API of CloudLinks. It manages CloudLink. * @@ -388,27 +458,27 @@ public CloudLinks cloudLinks() { } /** - * Gets the resource collection API of Clusters. It manages Cluster. + * Gets the resource collection API of Addons. It manages Addon. * - * @return Resource collection API of Clusters. + * @return Resource collection API of Addons. */ - public Clusters clusters() { - if (this.clusters == null) { - this.clusters = new ClustersImpl(clientObject.getClusters(), this); + public Addons addons() { + if (this.addons == null) { + this.addons = new AddonsImpl(clientObject.getAddons(), this); } - return clusters; + return addons; } /** - * Gets the resource collection API of Datastores. It manages Datastore. + * Gets the resource collection API of VirtualMachines. * - * @return Resource collection API of Datastores. + * @return Resource collection API of VirtualMachines. */ - public Datastores datastores() { - if (this.datastores == null) { - this.datastores = new DatastoresImpl(clientObject.getDatastores(), this); + public VirtualMachines virtualMachines() { + if (this.virtualMachines == null) { + this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this); } - return datastores; + return virtualMachines; } /** @@ -424,44 +494,43 @@ public PlacementPolicies placementPolicies() { } /** - * Gets the resource collection API of VirtualMachines. + * Gets the resource collection API of ScriptPackages. * - * @return Resource collection API of VirtualMachines. + * @return Resource collection API of ScriptPackages. */ - public VirtualMachines virtualMachines() { - if (this.virtualMachines == null) { - this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this); + public ScriptPackages scriptPackages() { + if (this.scriptPackages == null) { + this.scriptPackages = new ScriptPackagesImpl(clientObject.getScriptPackages(), this); } - return virtualMachines; + return scriptPackages; } /** - * Gets the resource collection API of GlobalReachConnections. It manages GlobalReachConnection. + * Gets the resource collection API of ScriptCmdlets. * - * @return Resource collection API of GlobalReachConnections. + * @return Resource collection API of ScriptCmdlets. */ - public GlobalReachConnections globalReachConnections() { - if (this.globalReachConnections == null) { - this.globalReachConnections - = new GlobalReachConnectionsImpl(clientObject.getGlobalReachConnections(), this); + public ScriptCmdlets scriptCmdlets() { + if (this.scriptCmdlets == null) { + this.scriptCmdlets = new ScriptCmdletsImpl(clientObject.getScriptCmdlets(), this); } - return globalReachConnections; + return scriptCmdlets; } /** - * Gets the resource collection API of HcxEnterpriseSites. It manages HcxEnterpriseSite. + * Gets the resource collection API of ScriptExecutions. It manages ScriptExecution. * - * @return Resource collection API of HcxEnterpriseSites. + * @return Resource collection API of ScriptExecutions. */ - public HcxEnterpriseSites hcxEnterpriseSites() { - if (this.hcxEnterpriseSites == null) { - this.hcxEnterpriseSites = new HcxEnterpriseSitesImpl(clientObject.getHcxEnterpriseSites(), this); + public ScriptExecutions scriptExecutions() { + if (this.scriptExecutions == null) { + this.scriptExecutions = new ScriptExecutionsImpl(clientObject.getScriptExecutions(), this); } - return hcxEnterpriseSites; + return scriptExecutions; } /** - * Gets the resource collection API of IscsiPaths. + * Gets the resource collection API of IscsiPaths. It manages IscsiPath. * * @return Resource collection API of IscsiPaths. */ @@ -473,53 +542,39 @@ public IscsiPaths iscsiPaths() { } /** - * Gets the resource collection API of ScriptExecutions. It manages ScriptExecution. - * - * @return Resource collection API of ScriptExecutions. - */ - public ScriptExecutions scriptExecutions() { - if (this.scriptExecutions == null) { - this.scriptExecutions = new ScriptExecutionsImpl(clientObject.getScriptExecutions(), this); - } - return scriptExecutions; - } - - /** - * Gets the resource collection API of ScriptPackages. + * Gets the resource collection API of Hosts. * - * @return Resource collection API of ScriptPackages. + * @return Resource collection API of Hosts. */ - public ScriptPackages scriptPackages() { - if (this.scriptPackages == null) { - this.scriptPackages = new ScriptPackagesImpl(clientObject.getScriptPackages(), this); + public Hosts hosts() { + if (this.hosts == null) { + this.hosts = new HostsImpl(clientObject.getHosts(), this); } - return scriptPackages; + return hosts; } /** - * Gets the resource collection API of ScriptCmdlets. + * Gets the resource collection API of ProvisionedNetworks. * - * @return Resource collection API of ScriptCmdlets. + * @return Resource collection API of ProvisionedNetworks. */ - public ScriptCmdlets scriptCmdlets() { - if (this.scriptCmdlets == null) { - this.scriptCmdlets = new ScriptCmdletsImpl(clientObject.getScriptCmdlets(), this); + public ProvisionedNetworks provisionedNetworks() { + if (this.provisionedNetworks == null) { + this.provisionedNetworks = new ProvisionedNetworksImpl(clientObject.getProvisionedNetworks(), this); } - return scriptCmdlets; + return provisionedNetworks; } /** - * Gets the resource collection API of WorkloadNetworks. It manages WorkloadNetworkDhcp, WorkloadNetworkDnsService, - * WorkloadNetworkDnsZone, WorkloadNetworkPortMirroring, WorkloadNetworkPublicIp, WorkloadNetworkSegment, - * WorkloadNetworkVMGroup. + * Gets the resource collection API of Skus. * - * @return Resource collection API of WorkloadNetworks. + * @return Resource collection API of Skus. */ - public WorkloadNetworks workloadNetworks() { - if (this.workloadNetworks == null) { - this.workloadNetworks = new WorkloadNetworksImpl(clientObject.getWorkloadNetworks(), this); + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); } - return workloadNetworks; + return skus; } /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AddonsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AddonsClient.java index afdf1f6ba3ed..c7fcac6a3974 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AddonsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AddonsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AuthorizationsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AuthorizationsClient.java index a7e16f2f83b9..ff65cfeb48ae 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AuthorizationsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AuthorizationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java index c21c292eb9e4..9583b9daf858 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; @@ -12,26 +12,26 @@ */ public interface AvsClient { /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -46,6 +46,13 @@ public interface AvsClient { */ Duration getDefaultPollInterval(); + /** + * Gets the WorkloadNetworksClient object to access its operations. + * + * @return the WorkloadNetworksClient object. + */ + WorkloadNetworksClient getWorkloadNetworks(); + /** * Gets the OperationsClient object to access its operations. * @@ -68,11 +75,25 @@ public interface AvsClient { PrivateCloudsClient getPrivateClouds(); /** - * Gets the AddonsClient object to access its operations. + * Gets the ClustersClient object to access its operations. * - * @return the AddonsClient object. + * @return the ClustersClient object. */ - AddonsClient getAddons(); + ClustersClient getClusters(); + + /** + * Gets the DatastoresClient object to access its operations. + * + * @return the DatastoresClient object. + */ + DatastoresClient getDatastores(); + + /** + * Gets the HcxEnterpriseSitesClient object to access its operations. + * + * @return the HcxEnterpriseSitesClient object. + */ + HcxEnterpriseSitesClient getHcxEnterpriseSites(); /** * Gets the AuthorizationsClient object to access its operations. @@ -81,6 +102,13 @@ public interface AvsClient { */ AuthorizationsClient getAuthorizations(); + /** + * Gets the GlobalReachConnectionsClient object to access its operations. + * + * @return the GlobalReachConnectionsClient object. + */ + GlobalReachConnectionsClient getGlobalReachConnections(); + /** * Gets the CloudLinksClient object to access its operations. * @@ -89,18 +117,18 @@ public interface AvsClient { CloudLinksClient getCloudLinks(); /** - * Gets the ClustersClient object to access its operations. + * Gets the AddonsClient object to access its operations. * - * @return the ClustersClient object. + * @return the AddonsClient object. */ - ClustersClient getClusters(); + AddonsClient getAddons(); /** - * Gets the DatastoresClient object to access its operations. + * Gets the VirtualMachinesClient object to access its operations. * - * @return the DatastoresClient object. + * @return the VirtualMachinesClient object. */ - DatastoresClient getDatastores(); + VirtualMachinesClient getVirtualMachines(); /** * Gets the PlacementPoliciesClient object to access its operations. @@ -110,25 +138,25 @@ public interface AvsClient { PlacementPoliciesClient getPlacementPolicies(); /** - * Gets the VirtualMachinesClient object to access its operations. + * Gets the ScriptPackagesClient object to access its operations. * - * @return the VirtualMachinesClient object. + * @return the ScriptPackagesClient object. */ - VirtualMachinesClient getVirtualMachines(); + ScriptPackagesClient getScriptPackages(); /** - * Gets the GlobalReachConnectionsClient object to access its operations. + * Gets the ScriptCmdletsClient object to access its operations. * - * @return the GlobalReachConnectionsClient object. + * @return the ScriptCmdletsClient object. */ - GlobalReachConnectionsClient getGlobalReachConnections(); + ScriptCmdletsClient getScriptCmdlets(); /** - * Gets the HcxEnterpriseSitesClient object to access its operations. + * Gets the ScriptExecutionsClient object to access its operations. * - * @return the HcxEnterpriseSitesClient object. + * @return the ScriptExecutionsClient object. */ - HcxEnterpriseSitesClient getHcxEnterpriseSites(); + ScriptExecutionsClient getScriptExecutions(); /** * Gets the IscsiPathsClient object to access its operations. @@ -138,30 +166,23 @@ public interface AvsClient { IscsiPathsClient getIscsiPaths(); /** - * Gets the ScriptExecutionsClient object to access its operations. + * Gets the HostsClient object to access its operations. * - * @return the ScriptExecutionsClient object. + * @return the HostsClient object. */ - ScriptExecutionsClient getScriptExecutions(); + HostsClient getHosts(); /** - * Gets the ScriptPackagesClient object to access its operations. + * Gets the ProvisionedNetworksClient object to access its operations. * - * @return the ScriptPackagesClient object. + * @return the ProvisionedNetworksClient object. */ - ScriptPackagesClient getScriptPackages(); + ProvisionedNetworksClient getProvisionedNetworks(); /** - * Gets the ScriptCmdletsClient object to access its operations. + * Gets the SkusClient object to access its operations. * - * @return the ScriptCmdletsClient object. + * @return the SkusClient object. */ - ScriptCmdletsClient getScriptCmdlets(); - - /** - * Gets the WorkloadNetworksClient object to access its operations. - * - * @return the WorkloadNetworksClient object. - */ - WorkloadNetworksClient getWorkloadNetworks(); + SkusClient getSkus(); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/CloudLinksClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/CloudLinksClient.java index b8cb20adc8e1..c6a3a980d869 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/CloudLinksClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/CloudLinksClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ClustersClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ClustersClient.java index 4dcbd4af4e20..5691f41990f7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ClustersClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ClustersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; @@ -148,7 +148,7 @@ ClusterInner createOrUpdate(String resourceGroupName, String privateCloudName, S * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. + * @param clusterUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -164,7 +164,7 @@ SyncPoller, ClusterInner> beginUpdate(String resourceGr * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. + * @param clusterUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -181,7 +181,7 @@ SyncPoller, ClusterInner> beginUpdate(String resourceGr * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. + * @param clusterUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -197,7 +197,7 @@ ClusterInner update(String resourceGroupName, String privateCloudName, String cl * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. + * @param clusterUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/DatastoresClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/DatastoresClient.java index 327061fc2d0c..0e7ccac05a54 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/DatastoresClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/DatastoresClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/GlobalReachConnectionsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/GlobalReachConnectionsClient.java index ce9a7351d72b..937d58ed9148 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/GlobalReachConnectionsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/GlobalReachConnectionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/HcxEnterpriseSitesClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/HcxEnterpriseSitesClient.java index 63409fe329fd..d9e88bc7c1d7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/HcxEnterpriseSitesClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/HcxEnterpriseSitesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/HostsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/HostsClient.java new file mode 100644 index 000000000000..f48fac325a6c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/HostsClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.models.HostModelInner; + +/** + * An instance of this class provides access to all the operations defined in HostsClient. + */ +public interface HostsClient { + /** + * List Host resources by Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName); + + /** + * List Host resources by Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName, + Context context); + + /** + * Get a Host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @param hostId The host identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Host along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String privateCloudName, String clusterName, + String hostId, Context context); + + /** + * Get a Host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @param hostId The host identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HostModelInner get(String resourceGroupName, String privateCloudName, String clusterName, String hostId); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/IscsiPathsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/IscsiPathsClient.java index 43d5ec7ade27..b17dab94dbc9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/IscsiPathsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/IscsiPathsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; @@ -50,6 +50,7 @@ PagedIterable listByPrivateCloud(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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. @@ -57,26 +58,29 @@ PagedIterable listByPrivateCloud(String resourceGroupName, Strin * @return a IscsiPath along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String privateCloudName, Context context); + Response getWithResponse(String resourceGroupName, String privateCloudName, String iscsiPathName, + Context context); /** * Get a IscsiPath. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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 a IscsiPath. */ @ServiceMethod(returns = ReturnType.SINGLE) - IscsiPathInner get(String resourceGroupName, String privateCloudName); + IscsiPathInner get(String resourceGroupName, String privateCloudName, String iscsiPathName); /** * Create a IscsiPath. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -85,13 +89,14 @@ PagedIterable listByPrivateCloud(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, IscsiPathInner> beginCreateOrUpdate(String resourceGroupName, - String privateCloudName, IscsiPathInner resource); + String privateCloudName, String iscsiPathName, IscsiPathInner resource); /** * Create a IscsiPath. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -101,13 +106,14 @@ SyncPoller, IscsiPathInner> beginCreateOrUpdate(Strin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, IscsiPathInner> beginCreateOrUpdate(String resourceGroupName, - String privateCloudName, IscsiPathInner resource, Context context); + String privateCloudName, String iscsiPathName, IscsiPathInner resource, Context context); /** * Create a IscsiPath. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -115,13 +121,15 @@ SyncPoller, IscsiPathInner> beginCreateOrUpdate(Strin * @return an iSCSI path resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - IscsiPathInner createOrUpdate(String resourceGroupName, String privateCloudName, IscsiPathInner resource); + IscsiPathInner createOrUpdate(String resourceGroupName, String privateCloudName, String iscsiPathName, + IscsiPathInner resource); /** * Create a IscsiPath. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -130,27 +138,30 @@ SyncPoller, IscsiPathInner> beginCreateOrUpdate(Strin * @return an iSCSI path resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - IscsiPathInner createOrUpdate(String resourceGroupName, String privateCloudName, IscsiPathInner resource, - Context context); + IscsiPathInner createOrUpdate(String resourceGroupName, String privateCloudName, String iscsiPathName, + IscsiPathInner resource, Context context); /** * Delete a IscsiPath. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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 long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName); + SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, + String iscsiPathName); /** * Delete a IscsiPath. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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. @@ -158,30 +169,33 @@ IscsiPathInner createOrUpdate(String resourceGroupName, String privateCloudName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, + String iscsiPathName, Context context); /** * Delete a IscsiPath. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String privateCloudName); + void delete(String resourceGroupName, String privateCloudName, String iscsiPathName); /** * Delete a IscsiPath. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String privateCloudName, Context context); + void delete(String resourceGroupName, String privateCloudName, String iscsiPathName, Context context); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/LocationsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/LocationsClient.java index 387314e8244c..86fb94fb5162 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/LocationsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/LocationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; @@ -17,53 +17,53 @@ */ public interface LocationsClient { /** - * Return quota for subscription by region. + * Return trial status for subscription by region. * - * @param location The name of the Azure region. + * @param location A location in a subscription. + * @param sku Optionally, check for a specific 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 subscription quotas along with {@link Response}. + * @return subscription trial availability along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkQuotaAvailabilityWithResponse(String location, Context context); + Response checkTrialAvailabilityWithResponse(String location, Sku sku, Context context); /** - * Return quota for subscription by region. + * Return trial status for subscription by region. * - * @param location The name of the Azure region. + * @param location A location in a subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription quotas. + * @return subscription trial availability. */ @ServiceMethod(returns = ReturnType.SINGLE) - QuotaInner checkQuotaAvailability(String location); + TrialInner checkTrialAvailability(String location); /** - * Return trial status for subscription by region. + * Return quota for subscription by region. * - * @param location The name of the Azure region. - * @param sku Optionally, check for a specific SKU. + * @param location A location in a subscription. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription trial availability along with {@link Response}. + * @return subscription quotas along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkTrialAvailabilityWithResponse(String location, Sku sku, Context context); + Response checkQuotaAvailabilityWithResponse(String location, Context context); /** - * Return trial status for subscription by region. + * Return quota for subscription by region. * - * @param location The name of the Azure region. + * @param location A location in a subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription trial availability. + * @return subscription quotas. */ @ServiceMethod(returns = ReturnType.SINGLE) - TrialInner checkTrialAvailability(String location); + QuotaInner checkQuotaAvailability(String location); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/OperationsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/OperationsClient.java index 5cdf6176912b..87310fdf3ceb 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/OperationsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PlacementPoliciesClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PlacementPoliciesClient.java index 1053a2e7d306..9cd743aee25b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PlacementPoliciesClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PlacementPoliciesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; @@ -159,7 +159,7 @@ PlacementPolicyInner createOrUpdate(String resourceGroupName, String privateClou * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. + * @param placementPolicyUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -177,7 +177,7 @@ SyncPoller, PlacementPolicyInner> beginUpdate(S * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. + * @param placementPolicyUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -196,7 +196,7 @@ SyncPoller, PlacementPolicyInner> beginUpdate(S * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. + * @param placementPolicyUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -213,7 +213,7 @@ PlacementPolicyInner update(String resourceGroupName, String privateCloudName, S * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. + * @param placementPolicyUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java index 749f3460f4f5..dfcb28233ee6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; @@ -20,18 +20,21 @@ */ public interface PrivateCloudsClient { /** - * List PrivateCloud resources by subscription ID. + * List PrivateCloud resources by 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 the response of a PrivateCloud list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * List PrivateCloud resources by subscription ID. + * List PrivateCloud resources by 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. @@ -39,24 +42,21 @@ public interface PrivateCloudsClient { * @return the response of a PrivateCloud list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * List PrivateCloud resources by resource group. + * List PrivateCloud resources by subscription ID. * - * @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 the response of a PrivateCloud list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable list(); /** - * List PrivateCloud resources by resource group. + * List PrivateCloud resources by subscription ID. * - * @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. @@ -64,7 +64,7 @@ public interface PrivateCloudsClient { * @return the response of a PrivateCloud list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable list(Context context); /** * Get a PrivateCloud. @@ -160,7 +160,7 @@ PrivateCloudInner createOrUpdate(String resourceGroupName, String privateCloudNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. + * @param privateCloudUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -175,7 +175,7 @@ SyncPoller, PrivateCloudInner> beginUpdate(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. + * @param privateCloudUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -191,7 +191,7 @@ SyncPoller, PrivateCloudInner> beginUpdate(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. + * @param privateCloudUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -205,7 +205,7 @@ SyncPoller, PrivateCloudInner> beginUpdate(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. + * @param privateCloudUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -269,48 +269,47 @@ PrivateCloudInner update(String resourceGroupName, String privateCloudName, Priv void delete(String resourceGroupName, String privateCloudName, Context context); /** - * List the admin credentials for the private cloud. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return administrative credentials for accessing vCenter and NSX-T along with {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAdminCredentialsWithResponse(String resourceGroupName, String privateCloudName, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRotateVcenterPassword(String resourceGroupName, String privateCloudName); /** - * List the admin credentials for the private cloud. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return administrative credentials for accessing vCenter and NSX-T. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdminCredentialsInner listAdminCredentials(String resourceGroupName, String privateCloudName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRotateVcenterPassword(String resourceGroupName, String privateCloudName, + Context context); /** - * Rotate the NSX-T Manager password. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked 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> beginRotateNsxtPassword(String resourceGroupName, String privateCloudName); + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateVcenterPassword(String resourceGroupName, String privateCloudName); /** - * Rotate the NSX-T Manager password. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. @@ -318,11 +317,9 @@ Response listAdminCredentialsWithResponse(String 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 long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRotateNsxtPassword(String resourceGroupName, String privateCloudName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context); /** * Rotate the NSX-T Manager password. @@ -332,9 +329,10 @@ SyncPoller, Void> beginRotateNsxtPassword(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void rotateNsxtPassword(String resourceGroupName, String privateCloudName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRotateNsxtPassword(String resourceGroupName, String privateCloudName); /** * Rotate the NSX-T Manager password. @@ -345,25 +343,26 @@ SyncPoller, Void> beginRotateNsxtPassword(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRotateNsxtPassword(String resourceGroupName, String privateCloudName, + Context context); /** - * Rotate the vCenter password. + * Rotate the NSX-T Manager password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked 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> beginRotateVcenterPassword(String resourceGroupName, String privateCloudName); + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateNsxtPassword(String resourceGroupName, String privateCloudName); /** - * Rotate the vCenter password. + * Rotate the NSX-T Manager password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. @@ -371,34 +370,35 @@ SyncPoller, Void> beginRotateNsxtPassword(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked 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> beginRotateVcenterPassword(String resourceGroupName, String privateCloudName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context); /** - * Rotate the vCenter password. + * List the admin credentials for the private cloud. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void rotateVcenterPassword(String resourceGroupName, String privateCloudName); + Response listAdminCredentialsWithResponse(String resourceGroupName, String privateCloudName, + Context context); /** - * Rotate the vCenter password. + * List the admin credentials for the private cloud. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. */ @ServiceMethod(returns = ReturnType.SINGLE) - void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context); + AdminCredentialsInner listAdminCredentials(String resourceGroupName, String privateCloudName); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ProvisionedNetworksClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ProvisionedNetworksClient.java new file mode 100644 index 000000000000..a8d94829aa3f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ProvisionedNetworksClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.models.ProvisionedNetworkInner; + +/** + * An instance of this class provides access to all the operations defined in ProvisionedNetworksClient. + */ +public interface ProvisionedNetworksClient { + /** + * List ProvisionedNetwork resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List ProvisionedNetwork resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a ProvisionedNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param provisionedNetworkName Name of the cloud link. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 ProvisionedNetwork along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String privateCloudName, + String provisionedNetworkName, Context context); + + /** + * Get a ProvisionedNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param provisionedNetworkName Name of the cloud link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 ProvisionedNetwork. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProvisionedNetworkInner get(String resourceGroupName, String privateCloudName, String provisionedNetworkName); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptCmdletsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptCmdletsClient.java index 1cd9ca32de8d..904c45b9afd4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptCmdletsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptCmdletsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptExecutionsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptExecutionsClient.java index f4776b2d7f70..063951a11565 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptExecutionsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptExecutionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptPackagesClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptPackagesClient.java index b5b2ef561f8e..cc7a294c98ef 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptPackagesClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptPackagesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/SkusClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/SkusClient.java new file mode 100644 index 000000000000..3478976a110c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/SkusClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.models.ResourceSkuInner; + +/** + * An instance of this class provides access to all the operations defined in SkusClient. + */ +public interface SkusClient { + /** + * A list of SKUs. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * A list of SKUs. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/VirtualMachinesClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/VirtualMachinesClient.java index 3b7548a5c8ec..517970820566 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/VirtualMachinesClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/VirtualMachinesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; @@ -88,7 +88,7 @@ VirtualMachineInner get(String resourceGroupName, String privateCloudName, Strin * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -105,7 +105,7 @@ SyncPoller, Void> beginRestrictMovement(String resourceGroupNam * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -123,7 +123,7 @@ SyncPoller, Void> beginRestrictMovement(String resourceGroupNam * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -139,7 +139,7 @@ void restrictMovement(String resourceGroupName, String privateCloudName, String * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/WorkloadNetworksClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/WorkloadNetworksClient.java index 54139e75dc3c..806be71927df 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/WorkloadNetworksClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/WorkloadNetworksClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent; @@ -19,8 +19,8 @@ import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; /** * An instance of this class provides access to all the operations defined in WorkloadNetworksClient. @@ -58,6 +58,7 @@ public interface WorkloadNetworksClient { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -65,39 +66,44 @@ public interface WorkloadNetworksClient { * @return a WorkloadNetwork along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String privateCloudName, Context context); + Response getWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, Context context); /** * Get a WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 WorkloadNetwork. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkInner get(String resourceGroupName, String privateCloudName); + WorkloadNetworkInner get(String resourceGroupName, String privateCloudName, String workloadNetworkName); /** * List WorkloadNetworkDhcp resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDhcp(String resourceGroupName, String privateCloudName); + PagedIterable listDhcp(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkDhcp resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -106,7 +112,7 @@ public interface WorkloadNetworksClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listDhcp(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkDhcp. @@ -143,6 +149,7 @@ Response getDhcpWithResponse(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -152,13 +159,15 @@ Response getDhcpWithResponse(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp(String resourceGroupName, - String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp); + String privateCloudName, String workloadNetworkName, String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp); /** * Create a WorkloadNetworkDhcp. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. * @param context The context to associate with this operation. @@ -169,13 +178,15 @@ SyncPoller, WorkloadNetworkDhcpInner> begin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp(String resourceGroupName, - String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context); + String privateCloudName, String workloadNetworkName, String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context); /** * Create a WorkloadNetworkDhcp. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -184,14 +195,15 @@ SyncPoller, WorkloadNetworkDhcpInner> begin * @return nSX DHCP. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, String dhcpId, - WorkloadNetworkDhcpInner workloadNetworkDhcp); + WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp); /** * Create a WorkloadNetworkDhcp. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. * @param context The context to associate with this operation. @@ -201,14 +213,15 @@ WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateClou * @return nSX DHCP. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, String dhcpId, - WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context); + WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context); /** * Update a WorkloadNetworkDhcp. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -218,13 +231,15 @@ WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateClou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp(String resourceGroupName, - String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp); + String privateCloudName, String workloadNetworkName, String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp); /** * Update a WorkloadNetworkDhcp. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. * @param context The context to associate with this operation. @@ -235,13 +250,15 @@ SyncPoller, WorkloadNetworkDhcpInner> begin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp(String resourceGroupName, - String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context); + String privateCloudName, String workloadNetworkName, String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context); /** * Update a WorkloadNetworkDhcp. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -250,14 +267,15 @@ SyncPoller, WorkloadNetworkDhcpInner> begin * @return nSX DHCP. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, String dhcpId, - WorkloadNetworkDhcpInner workloadNetworkDhcp); + WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp); /** * Update a WorkloadNetworkDhcp. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. * @param context The context to associate with this operation. @@ -267,14 +285,15 @@ WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateClou * @return nSX DHCP. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, String dhcpId, - WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context); + WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context); /** * Delete a WorkloadNetworkDhcp. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -283,13 +302,14 @@ WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateClou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, String privateCloudName, - String dhcpId); + String workloadNetworkName, String dhcpId); /** * Delete a WorkloadNetworkDhcp. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -298,27 +318,29 @@ SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, Str * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, - Context context); + SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dhcpId, Context context); /** * Delete a WorkloadNetworkDhcp. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId); + void deleteDhcp(String resourceGroupName, String privateCloudName, String workloadNetworkName, String dhcpId); /** * Delete a WorkloadNetworkDhcp. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -326,13 +348,15 @@ SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, Str * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context); + void deleteDhcp(String resourceGroupName, String privateCloudName, String workloadNetworkName, String dhcpId, + Context context); /** * List WorkloadNetworkDnsService resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -340,13 +364,15 @@ SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, Str * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDnsServices(String resourceGroupName, String privateCloudName); + PagedIterable listDnsService(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkDnsService resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -355,14 +381,15 @@ SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, Str * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDnsServices(String resourceGroupName, String privateCloudName, - Context context); + PagedIterable listDnsService(String resourceGroupName, String privateCloudName, + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkDnsService. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -372,13 +399,14 @@ PagedIterable listDnsServices(String resourceGro */ @ServiceMethod(returns = ReturnType.SINGLE) Response getDnsServiceWithResponse(String resourceGroupName, - String privateCloudName, String dnsServiceId, Context context); + String privateCloudName, String workloadNetworkName, String dnsServiceId, Context context); /** * Get a WorkloadNetworkDnsService. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -387,13 +415,14 @@ Response getDnsServiceWithResponse(String resour */ @ServiceMethod(returns = ReturnType.SINGLE) WorkloadNetworkDnsServiceInner getDnsService(String resourceGroupName, String privateCloudName, - String dnsServiceId); + String workloadNetworkName, String dnsServiceId); /** * Create a WorkloadNetworkDnsService. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -403,7 +432,7 @@ WorkloadNetworkDnsServiceInner getDnsService(String resourceGroupName, String pr */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService( - String resourceGroupName, String privateCloudName, String dnsServiceId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService); /** @@ -411,6 +440,7 @@ SyncPoller, WorkloadNetworkDnsService * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. * @param context The context to associate with this operation. @@ -421,7 +451,7 @@ SyncPoller, WorkloadNetworkDnsService */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService( - String resourceGroupName, String privateCloudName, String dnsServiceId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context); /** @@ -429,6 +459,7 @@ SyncPoller, WorkloadNetworkDnsService * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -438,13 +469,14 @@ SyncPoller, WorkloadNetworkDnsService */ @ServiceMethod(returns = ReturnType.SINGLE) WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, String privateCloudName, - String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService); + String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService); /** * Create a WorkloadNetworkDnsService. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. * @param context The context to associate with this operation. @@ -455,13 +487,15 @@ WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, String privateCloudName, - String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context); + String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context); /** * Update a WorkloadNetworkDnsService. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -471,7 +505,7 @@ WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService( - String resourceGroupName, String privateCloudName, String dnsServiceId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService); /** @@ -479,6 +513,7 @@ SyncPoller, WorkloadNetworkDnsService * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. * @param context The context to associate with this operation. @@ -489,7 +524,7 @@ SyncPoller, WorkloadNetworkDnsService */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService( - String resourceGroupName, String privateCloudName, String dnsServiceId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context); /** @@ -497,6 +532,7 @@ SyncPoller, WorkloadNetworkDnsService * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -506,13 +542,14 @@ SyncPoller, WorkloadNetworkDnsService */ @ServiceMethod(returns = ReturnType.SINGLE) WorkloadNetworkDnsServiceInner updateDnsService(String resourceGroupName, String privateCloudName, - String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService); + String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService); /** * Update a WorkloadNetworkDnsService. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. * @param context The context to associate with this operation. @@ -523,7 +560,8 @@ WorkloadNetworkDnsServiceInner updateDnsService(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) WorkloadNetworkDnsServiceInner updateDnsService(String resourceGroupName, String privateCloudName, - String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context); + String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context); /** * Delete a WorkloadNetworkDnsService. @@ -588,19 +626,22 @@ SyncPoller, Void> beginDeleteDnsService(String resourceGroupNam * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDnsZones(String resourceGroupName, String privateCloudName); + PagedIterable listDnsZones(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkDnsZone resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -609,13 +650,14 @@ SyncPoller, Void> beginDeleteDnsService(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listDnsZones(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkDnsZone. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -625,13 +667,14 @@ PagedIterable listDnsZones(String resourceGroupName */ @ServiceMethod(returns = ReturnType.SINGLE) Response getDnsZoneWithResponse(String resourceGroupName, String privateCloudName, - String dnsZoneId, Context context); + String workloadNetworkName, String dnsZoneId, Context context); /** * Get a WorkloadNetworkDnsZone. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -639,13 +682,15 @@ Response getDnsZoneWithResponse(String resourceGrou * @return a WorkloadNetworkDnsZone. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId); + WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsZoneId); /** * Create a WorkloadNetworkDnsZone. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -655,7 +700,7 @@ Response getDnsZoneWithResponse(String resourceGrou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( - String resourceGroupName, String privateCloudName, String dnsZoneId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); /** @@ -663,6 +708,7 @@ SyncPoller, WorkloadNetworkDnsZoneInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. * @param context The context to associate with this operation. @@ -673,7 +719,7 @@ SyncPoller, WorkloadNetworkDnsZoneInner> */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( - String resourceGroupName, String privateCloudName, String dnsZoneId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context); /** @@ -681,6 +727,7 @@ SyncPoller, WorkloadNetworkDnsZoneInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -689,14 +736,15 @@ SyncPoller, WorkloadNetworkDnsZoneInner> * @return nSX DNS Zone. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId, - WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); + WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); /** * Create a WorkloadNetworkDnsZone. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. * @param context The context to associate with this operation. @@ -706,14 +754,16 @@ WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, String priva * @return nSX DNS Zone. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId, - WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context); + WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context); /** * Update a WorkloadNetworkDnsZone. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -723,7 +773,7 @@ WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, String priva */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone( - String resourceGroupName, String privateCloudName, String dnsZoneId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); /** @@ -731,6 +781,7 @@ SyncPoller, WorkloadNetworkDnsZoneInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. * @param context The context to associate with this operation. @@ -741,7 +792,7 @@ SyncPoller, WorkloadNetworkDnsZoneInner> */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone( - String resourceGroupName, String privateCloudName, String dnsZoneId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context); /** @@ -749,6 +800,7 @@ SyncPoller, WorkloadNetworkDnsZoneInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -757,14 +809,15 @@ SyncPoller, WorkloadNetworkDnsZoneInner> * @return nSX DNS Zone. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId, - WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); + WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); /** * Update a WorkloadNetworkDnsZone. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. * @param context The context to associate with this operation. @@ -774,8 +827,9 @@ WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, String priva * @return nSX DNS Zone. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId, - WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context); + WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context); /** * Delete a WorkloadNetworkDnsZone. @@ -840,19 +894,22 @@ SyncPoller, Void> beginDeleteDnsZone(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listGateways(String resourceGroupName, String privateCloudName); + PagedIterable listGateways(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkGateway resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -861,13 +918,14 @@ SyncPoller, Void> beginDeleteDnsZone(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listGateways(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkGateway. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param gatewayId The ID of the NSX Gateway. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -877,13 +935,14 @@ PagedIterable listGateways(String resourceGroupName */ @ServiceMethod(returns = ReturnType.SINGLE) Response getGatewayWithResponse(String resourceGroupName, String privateCloudName, - String gatewayId, Context context); + String workloadNetworkName, String gatewayId, Context context); /** * Get a WorkloadNetworkGateway. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param gatewayId The ID of the NSX Gateway. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -891,13 +950,15 @@ Response getGatewayWithResponse(String resourceGrou * @return a WorkloadNetworkGateway. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String privateCloudName, String gatewayId); + WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String gatewayId); /** * List WorkloadNetworkPortMirroring resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -906,13 +967,14 @@ Response getGatewayWithResponse(String resourceGrou */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listPortMirroring(String resourceGroupName, - String privateCloudName); + String privateCloudName, String workloadNetworkName); /** * List WorkloadNetworkPortMirroring resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -922,13 +984,14 @@ PagedIterable listPortMirroring(String resour */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listPortMirroring(String resourceGroupName, - String privateCloudName, Context context); + String privateCloudName, String workloadNetworkName, Context context); /** * Get a WorkloadNetworkPortMirroring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -938,13 +1001,14 @@ PagedIterable listPortMirroring(String resour */ @ServiceMethod(returns = ReturnType.SINGLE) Response getPortMirroringWithResponse(String resourceGroupName, - String privateCloudName, String portMirroringId, Context context); + String privateCloudName, String workloadNetworkName, String portMirroringId, Context context); /** * Get a WorkloadNetworkPortMirroring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -953,13 +1017,14 @@ Response getPortMirroringWithResponse(String */ @ServiceMethod(returns = ReturnType.SINGLE) WorkloadNetworkPortMirroringInner getPortMirroring(String resourceGroupName, String privateCloudName, - String portMirroringId); + String workloadNetworkName, String portMirroringId); /** * Create a WorkloadNetworkPortMirroring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -969,14 +1034,15 @@ WorkloadNetworkPortMirroringInner getPortMirroring(String resourceGroupName, Str */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkPortMirroringInner> - beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId, - WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); + beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); /** * Create a WorkloadNetworkPortMirroring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. * @param context The context to associate with this operation. @@ -987,14 +1053,15 @@ WorkloadNetworkPortMirroringInner getPortMirroring(String resourceGroupName, Str */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkPortMirroringInner> - beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId, - WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context); + beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context); /** * Create a WorkloadNetworkPortMirroring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1004,13 +1071,15 @@ WorkloadNetworkPortMirroringInner getPortMirroring(String resourceGroupName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, String privateCloudName, - String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); + String workloadNetworkName, String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); /** * Create a WorkloadNetworkPortMirroring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. * @param context The context to associate with this operation. @@ -1021,13 +1090,15 @@ WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, String privateCloudName, - String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context); + String workloadNetworkName, String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context); /** * Update a WorkloadNetworkPortMirroring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1037,14 +1108,15 @@ WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkPortMirroringInner> - beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId, - WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); + beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); /** * Update a WorkloadNetworkPortMirroring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. * @param context The context to associate with this operation. @@ -1055,14 +1127,15 @@ WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkPortMirroringInner> - beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId, - WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context); + beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context); /** * Update a WorkloadNetworkPortMirroring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1072,13 +1145,15 @@ WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGroupName, String privateCloudName, - String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); + String workloadNetworkName, String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); /** * Update a WorkloadNetworkPortMirroring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. * @param context The context to associate with this operation. @@ -1089,7 +1164,8 @@ WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGroupName, String privateCloudName, - String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context); + String workloadNetworkName, String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context); /** * Delete a WorkloadNetworkPortMirroring. @@ -1155,6 +1231,7 @@ void deletePortMirroring(String resourceGroupName, String portMirroringId, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1162,13 +1239,15 @@ void deletePortMirroring(String resourceGroupName, String portMirroringId, Strin * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName); + PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkPublicIP resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1178,14 +1257,15 @@ void deletePortMirroring(String resourceGroupName, String portMirroringId, Strin */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1193,47 +1273,51 @@ PagedIterable listPublicIPs(String resourceGroupNa * @return a WorkloadNetworkPublicIP along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getPublicIpWithResponse(String resourceGroupName, String privateCloudName, - String publicIpId, Context context); + Response getPublicIPWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId, Context context); /** * Get a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 WorkloadNetworkPublicIP. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkPublicIpInner getPublicIp(String resourceGroupName, String privateCloudName, String publicIpId); + WorkloadNetworkPublicIpInner getPublicIP(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId); /** * Create a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of nSX Public IP Block. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIp( - String resourceGroupName, String privateCloudName, String publicIpId, - WorkloadNetworkPublicIpInner workloadNetworkPublicIp); + SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIP( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String publicIPId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIP); /** * Create a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1241,33 +1325,35 @@ SyncPoller, WorkloadNetworkPublicIpInne * @return the {@link SyncPoller} for polling of nSX Public IP Block. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIp( - String resourceGroupName, String privateCloudName, String publicIpId, - WorkloadNetworkPublicIpInner workloadNetworkPublicIp, Context context); + SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIP( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String publicIPId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIP, Context context); /** * Create a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return nSX Public IP Block. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkPublicIpInner createPublicIp(String resourceGroupName, String privateCloudName, String publicIpId, - WorkloadNetworkPublicIpInner workloadNetworkPublicIp); + WorkloadNetworkPublicIpInner createPublicIP(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId, WorkloadNetworkPublicIpInner workloadNetworkPublicIP); /** * Create a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1275,14 +1361,15 @@ WorkloadNetworkPublicIpInner createPublicIp(String resourceGroupName, String pri * @return nSX Public IP Block. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkPublicIpInner createPublicIp(String resourceGroupName, String privateCloudName, String publicIpId, - WorkloadNetworkPublicIpInner workloadNetworkPublicIp, Context context); + WorkloadNetworkPublicIpInner createPublicIP(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId, WorkloadNetworkPublicIpInner workloadNetworkPublicIP, + Context context); /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1290,14 +1377,14 @@ WorkloadNetworkPublicIpInner createPublicIp(String resourceGroupName, String pri * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeletePublicIp(String resourceGroupName, String publicIpId, + SyncPoller, Void> beginDeletePublicIP(String resourceGroupName, String publicIPId, String privateCloudName); /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1306,27 +1393,27 @@ SyncPoller, Void> beginDeletePublicIp(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeletePublicIp(String resourceGroupName, String publicIpId, + SyncPoller, Void> beginDeletePublicIP(String resourceGroupName, String publicIPId, String privateCloudName, Context context); /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName); + void deletePublicIP(String resourceGroupName, String publicIPId, String privateCloudName); /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1334,26 +1421,29 @@ SyncPoller, Void> beginDeletePublicIp(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName, Context context); + void deletePublicIP(String resourceGroupName, String publicIPId, String privateCloudName, Context context); /** * List WorkloadNetworkSegment resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkSegment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSegments(String resourceGroupName, String privateCloudName); + PagedIterable listSegments(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkSegment resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1362,13 +1452,14 @@ SyncPoller, Void> beginDeletePublicIp(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listSegments(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1378,13 +1469,14 @@ PagedIterable listSegments(String resourceGroupName */ @ServiceMethod(returns = ReturnType.SINGLE) Response getSegmentWithResponse(String resourceGroupName, String privateCloudName, - String segmentId, Context context); + String workloadNetworkName, String segmentId, Context context); /** * Get a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1392,13 +1484,15 @@ Response getSegmentWithResponse(String resourceGrou * @return a WorkloadNetworkSegment. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String privateCloudName, String segmentId); + WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId); /** * Create a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1407,8 +1501,8 @@ Response getSegmentWithResponse(String resourceGrou * @return the {@link SyncPoller} for polling of nSX Segment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments( - String resourceGroupName, String privateCloudName, String segmentId, + SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegment( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment); /** @@ -1416,6 +1510,7 @@ SyncPoller, WorkloadNetworkSegmentInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. * @param context The context to associate with this operation. @@ -1425,8 +1520,8 @@ SyncPoller, WorkloadNetworkSegmentInner> * @return the {@link SyncPoller} for polling of nSX Segment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments( - String resourceGroupName, String privateCloudName, String segmentId, + SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegment( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context); /** @@ -1434,6 +1529,7 @@ SyncPoller, WorkloadNetworkSegmentInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1442,14 +1538,15 @@ SyncPoller, WorkloadNetworkSegmentInner> * @return nSX Segment. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkSegmentInner createSegments(String resourceGroupName, String privateCloudName, String segmentId, - WorkloadNetworkSegmentInner workloadNetworkSegment); + WorkloadNetworkSegmentInner createSegment(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment); /** * Create a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. * @param context The context to associate with this operation. @@ -1459,14 +1556,16 @@ WorkloadNetworkSegmentInner createSegments(String resourceGroupName, String priv * @return nSX Segment. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkSegmentInner createSegments(String resourceGroupName, String privateCloudName, String segmentId, - WorkloadNetworkSegmentInner workloadNetworkSegment, Context context); + WorkloadNetworkSegmentInner createSegment(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context); /** * Update a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1475,8 +1574,8 @@ WorkloadNetworkSegmentInner createSegments(String resourceGroupName, String priv * @return the {@link SyncPoller} for polling of nSX Segment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments( - String resourceGroupName, String privateCloudName, String segmentId, + SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegment( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment); /** @@ -1484,6 +1583,7 @@ SyncPoller, WorkloadNetworkSegmentInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. * @param context The context to associate with this operation. @@ -1493,8 +1593,8 @@ SyncPoller, WorkloadNetworkSegmentInner> * @return the {@link SyncPoller} for polling of nSX Segment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments( - String resourceGroupName, String privateCloudName, String segmentId, + SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegment( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context); /** @@ -1502,6 +1602,7 @@ SyncPoller, WorkloadNetworkSegmentInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1510,14 +1611,15 @@ SyncPoller, WorkloadNetworkSegmentInner> * @return nSX Segment. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, String privateCloudName, String segmentId, - WorkloadNetworkSegmentInner workloadNetworkSegment); + WorkloadNetworkSegmentInner updateSegment(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment); /** * Update a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. * @param context The context to associate with this operation. @@ -1527,14 +1629,16 @@ WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, String priv * @return nSX Segment. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, String privateCloudName, String segmentId, - WorkloadNetworkSegmentInner workloadNetworkSegment, Context context); + WorkloadNetworkSegmentInner updateSegment(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context); /** * Delete a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1543,13 +1647,14 @@ WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, String priv */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDeleteSegment(String resourceGroupName, String privateCloudName, - String segmentId); + String workloadNetworkName, String segmentId); /** * Delete a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1559,26 +1664,28 @@ SyncPoller, Void> beginDeleteSegment(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDeleteSegment(String resourceGroupName, String privateCloudName, - String segmentId, Context context); + String workloadNetworkName, String segmentId, Context context); /** * Delete a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 deleteSegment(String resourceGroupName, String privateCloudName, String segmentId); + void deleteSegment(String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId); /** * Delete a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1586,13 +1693,15 @@ SyncPoller, Void> beginDeleteSegment(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context); + void deleteSegment(String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId, + Context context); /** * List WorkloadNetworkVirtualMachine resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1601,13 +1710,14 @@ SyncPoller, Void> beginDeleteSegment(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listVirtualMachines(String resourceGroupName, - String privateCloudName); + String privateCloudName, String workloadNetworkName); /** * List WorkloadNetworkVirtualMachine resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1617,13 +1727,14 @@ PagedIterable listVirtualMachines(String res */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listVirtualMachines(String resourceGroupName, - String privateCloudName, Context context); + String privateCloudName, String workloadNetworkName, Context context); /** * Get a WorkloadNetworkVirtualMachine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param virtualMachineId ID of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1633,13 +1744,14 @@ PagedIterable listVirtualMachines(String res */ @ServiceMethod(returns = ReturnType.SINGLE) Response getVirtualMachineWithResponse(String resourceGroupName, - String privateCloudName, String virtualMachineId, Context context); + String privateCloudName, String workloadNetworkName, String virtualMachineId, Context context); /** * Get a WorkloadNetworkVirtualMachine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param virtualMachineId ID of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1648,26 +1760,29 @@ Response getVirtualMachineWithResponse(Strin */ @ServiceMethod(returns = ReturnType.SINGLE) WorkloadNetworkVirtualMachineInner getVirtualMachine(String resourceGroupName, String privateCloudName, - String virtualMachineId); + String workloadNetworkName, String virtualMachineId); /** * List WorkloadNetworkVMGroup resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkVMGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listVMGroups(String resourceGroupName, String privateCloudName); + PagedIterable listVMGroups(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkVMGroup resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1676,13 +1791,14 @@ WorkloadNetworkVirtualMachineInner getVirtualMachine(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listVMGroups(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkVMGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1692,13 +1808,14 @@ PagedIterable listVMGroups(String resourceGroupName */ @ServiceMethod(returns = ReturnType.SINGLE) Response getVMGroupWithResponse(String resourceGroupName, String privateCloudName, - String vmGroupId, Context context); + String workloadNetworkName, String vmGroupId, Context context); /** * Get a WorkloadNetworkVMGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1706,13 +1823,15 @@ Response getVMGroupWithResponse(String resourceGrou * @return a WorkloadNetworkVMGroup. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId); + WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String vmGroupId); /** * Create a WorkloadNetworkVMGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1722,7 +1841,7 @@ Response getVMGroupWithResponse(String resourceGrou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup( - String resourceGroupName, String privateCloudName, String vmGroupId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup); /** @@ -1730,6 +1849,7 @@ SyncPoller, WorkloadNetworkVMGroupInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. * @param context The context to associate with this operation. @@ -1740,7 +1860,7 @@ SyncPoller, WorkloadNetworkVMGroupInner> */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup( - String resourceGroupName, String privateCloudName, String vmGroupId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context); /** @@ -1748,6 +1868,7 @@ SyncPoller, WorkloadNetworkVMGroupInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1756,14 +1877,15 @@ SyncPoller, WorkloadNetworkVMGroupInner> * @return nSX VM Group. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId, - WorkloadNetworkVMGroupInner workloadNetworkVMGroup); + WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup); /** * Create a WorkloadNetworkVMGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. * @param context The context to associate with this operation. @@ -1773,14 +1895,16 @@ WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, String priva * @return nSX VM Group. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId, - WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context); + WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context); /** * Update a WorkloadNetworkVMGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1790,7 +1914,7 @@ WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, String priva */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup( - String resourceGroupName, String privateCloudName, String vmGroupId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup); /** @@ -1798,6 +1922,7 @@ SyncPoller, WorkloadNetworkVMGroupInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. * @param context The context to associate with this operation. @@ -1808,7 +1933,7 @@ SyncPoller, WorkloadNetworkVMGroupInner> */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup( - String resourceGroupName, String privateCloudName, String vmGroupId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context); /** @@ -1816,6 +1941,7 @@ SyncPoller, WorkloadNetworkVMGroupInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1824,14 +1950,15 @@ SyncPoller, WorkloadNetworkVMGroupInner> * @return nSX VM Group. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId, - WorkloadNetworkVMGroupInner workloadNetworkVMGroup); + WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup); /** * Update a WorkloadNetworkVMGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. * @param context The context to associate with this operation. @@ -1841,8 +1968,9 @@ WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, String priva * @return nSX VM Group. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId, - WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context); + WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context); /** * Delete a WorkloadNetworkVMGroup. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java index 48c4b97cff91..b10182fc28ac 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AdminCredentialsInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AdminCredentialsInner.java index b0347fa58e48..900df918e115 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AdminCredentialsInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AdminCredentialsInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -39,7 +39,7 @@ public final class AdminCredentialsInner implements JsonSerializable hosts() { - return this.innerProperties() == null ? null : this.innerProperties().hosts(); - } - - /** - * Set the hosts property: The hosts. - * - * @param hosts the hosts value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withHosts(List hosts) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterProperties(); - } - this.innerProperties().withHosts(hosts); - return this; - } - - /** - * Get the vsanDatastoreName property: Name of the vsan datastore associated with the cluster. - * - * @return the vsanDatastoreName value. - */ - public String vsanDatastoreName() { - return this.innerProperties() == null ? null : this.innerProperties().vsanDatastoreName(); - } - - /** - * Set the vsanDatastoreName property: Name of the vsan datastore associated with the cluster. - * - * @param vsanDatastoreName the vsanDatastoreName value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withVsanDatastoreName(String vsanDatastoreName) { - if (this.innerProperties() == null) { - this.innerProperties = new ClusterProperties(); - } - this.innerProperties().withVsanDatastoreName(vsanDatastoreName); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } if (sku() == null) { throw LOGGER.atError() @@ -238,7 +161,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -267,7 +190,7 @@ public static ClusterInner fromJson(JsonReader jsonReader) throws IOException { } else if ("sku".equals(fieldName)) { deserializedClusterInner.sku = Sku.fromJson(reader); } else if ("properties".equals(fieldName)) { - deserializedClusterInner.innerProperties = ClusterProperties.fromJson(reader); + deserializedClusterInner.properties = ClusterProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedClusterInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterUpdateProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterUpdateProperties.java index e8c1f5139cd8..00e55c4b7689 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterUpdateProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterZoneListInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterZoneListInner.java index c6afd0f35195..0177b66e5d7e 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterZoneListInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterZoneListInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * List of all zones and associated hosts for a cluster. */ -@Fluent +@Immutable public final class ClusterZoneListInner implements JsonSerializable { /* * Zone and associated hosts info @@ -26,7 +26,7 @@ public final class ClusterZoneListInner implements JsonSerializable zones() { return this.zones; } - /** - * Set the zones property: Zone and associated hosts info. - * - * @param zones the zones value to set. - * @return the ClusterZoneListInner object itself. - */ - public ClusterZoneListInner withZones(List zones) { - this.zones = zones; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java index 432d3df66946..05b95963c380 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,11 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.DatastoreProvisioningState; -import com.azure.resourcemanager.avs.models.DatastoreStatus; -import com.azure.resourcemanager.avs.models.DiskPoolVolume; -import com.azure.resourcemanager.avs.models.ElasticSanVolume; -import com.azure.resourcemanager.avs.models.NetAppVolume; +import com.azure.resourcemanager.avs.models.DatastoreProperties; import java.io.IOException; /** @@ -25,7 +21,7 @@ public final class DatastoreInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private DatastoreProperties innerProperties; + private DatastoreProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -54,12 +50,23 @@ public DatastoreInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private DatastoreProperties innerProperties() { - return this.innerProperties; + public DatastoreProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the DatastoreInner object itself. + */ + public DatastoreInner withProperties(DatastoreProperties properties) { + this.properties = properties; + return this; } /** @@ -101,101 +108,14 @@ public String id() { return this.id; } - /** - * Get the provisioningState property: The state of the datastore provisioning. - * - * @return the provisioningState value. - */ - public DatastoreProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the netAppVolume property: An Azure NetApp Files volume. - * - * @return the netAppVolume value. - */ - public NetAppVolume netAppVolume() { - return this.innerProperties() == null ? null : this.innerProperties().netAppVolume(); - } - - /** - * Set the netAppVolume property: An Azure NetApp Files volume. - * - * @param netAppVolume the netAppVolume value to set. - * @return the DatastoreInner object itself. - */ - public DatastoreInner withNetAppVolume(NetAppVolume netAppVolume) { - if (this.innerProperties() == null) { - this.innerProperties = new DatastoreProperties(); - } - this.innerProperties().withNetAppVolume(netAppVolume); - return this; - } - - /** - * Get the diskPoolVolume property: An iSCSI volume. - * - * @return the diskPoolVolume value. - */ - public DiskPoolVolume diskPoolVolume() { - return this.innerProperties() == null ? null : this.innerProperties().diskPoolVolume(); - } - - /** - * Set the diskPoolVolume property: An iSCSI volume. - * - * @param diskPoolVolume the diskPoolVolume value to set. - * @return the DatastoreInner object itself. - */ - public DatastoreInner withDiskPoolVolume(DiskPoolVolume diskPoolVolume) { - if (this.innerProperties() == null) { - this.innerProperties = new DatastoreProperties(); - } - this.innerProperties().withDiskPoolVolume(diskPoolVolume); - return this; - } - - /** - * Get the elasticSanVolume property: An Elastic SAN volume. - * - * @return the elasticSanVolume value. - */ - public ElasticSanVolume elasticSanVolume() { - return this.innerProperties() == null ? null : this.innerProperties().elasticSanVolume(); - } - - /** - * Set the elasticSanVolume property: An Elastic SAN volume. - * - * @param elasticSanVolume the elasticSanVolume value to set. - * @return the DatastoreInner object itself. - */ - public DatastoreInner withElasticSanVolume(ElasticSanVolume elasticSanVolume) { - if (this.innerProperties() == null) { - this.innerProperties = new DatastoreProperties(); - } - this.innerProperties().withElasticSanVolume(elasticSanVolume); - return this; - } - - /** - * Get the status property: The operational status of the datastore. - * - * @return the status value. - */ - public DatastoreStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -205,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -232,7 +152,7 @@ public static DatastoreInner fromJson(JsonReader jsonReader) throws IOException } else if ("type".equals(fieldName)) { deserializedDatastoreInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedDatastoreInner.innerProperties = DatastoreProperties.fromJson(reader); + deserializedDatastoreInner.properties = DatastoreProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedDatastoreInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationInner.java index 357ba6df2338..69750f4ecd8a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,7 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.ExpressRouteAuthorizationProvisioningState; +import com.azure.resourcemanager.avs.models.ExpressRouteAuthorizationProperties; import java.io.IOException; /** @@ -21,7 +21,7 @@ public final class ExpressRouteAuthorizationInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private ExpressRouteAuthorizationProperties innerProperties; + private ExpressRouteAuthorizationProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -50,12 +50,23 @@ public ExpressRouteAuthorizationInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private ExpressRouteAuthorizationProperties innerProperties() { - return this.innerProperties; + public ExpressRouteAuthorizationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ExpressRouteAuthorizationInner object itself. + */ + public ExpressRouteAuthorizationInner withProperties(ExpressRouteAuthorizationProperties properties) { + this.properties = properties; + return this; } /** @@ -97,64 +108,14 @@ public String id() { return this.id; } - /** - * Get the provisioningState property: The state of the ExpressRoute Circuit Authorization provisioning. - * - * @return the provisioningState value. - */ - public ExpressRouteAuthorizationProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the expressRouteAuthorizationId property: The ID of the ExpressRoute Circuit Authorization. - * - * @return the expressRouteAuthorizationId value. - */ - public String expressRouteAuthorizationId() { - return this.innerProperties() == null ? null : this.innerProperties().expressRouteAuthorizationId(); - } - - /** - * Get the expressRouteAuthorizationKey property: The key of the ExpressRoute Circuit Authorization. - * - * @return the expressRouteAuthorizationKey value. - */ - public String expressRouteAuthorizationKey() { - return this.innerProperties() == null ? null : this.innerProperties().expressRouteAuthorizationKey(); - } - - /** - * Get the expressRouteId property: The ID of the ExpressRoute Circuit. - * - * @return the expressRouteId value. - */ - public String expressRouteId() { - return this.innerProperties() == null ? null : this.innerProperties().expressRouteId(); - } - - /** - * Set the expressRouteId property: The ID of the ExpressRoute Circuit. - * - * @param expressRouteId the expressRouteId value to set. - * @return the ExpressRouteAuthorizationInner object itself. - */ - public ExpressRouteAuthorizationInner withExpressRouteId(String expressRouteId) { - if (this.innerProperties() == null) { - this.innerProperties = new ExpressRouteAuthorizationProperties(); - } - this.innerProperties().withExpressRouteId(expressRouteId); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -164,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -192,7 +153,7 @@ public static ExpressRouteAuthorizationInner fromJson(JsonReader jsonReader) thr } else if ("type".equals(fieldName)) { deserializedExpressRouteAuthorizationInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedExpressRouteAuthorizationInner.innerProperties + deserializedExpressRouteAuthorizationInner.properties = ExpressRouteAuthorizationProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedExpressRouteAuthorizationInner.systemData = SystemData.fromJson(reader); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java index fa5f0c7fafde..f2d566d3f31d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,8 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.GlobalReachConnectionProvisioningState; -import com.azure.resourcemanager.avs.models.GlobalReachConnectionStatus; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionProperties; import java.io.IOException; /** @@ -22,7 +21,7 @@ public final class GlobalReachConnectionInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private GlobalReachConnectionProperties innerProperties; + private GlobalReachConnectionProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -51,12 +50,23 @@ public GlobalReachConnectionInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private GlobalReachConnectionProperties innerProperties() { - return this.innerProperties; + public GlobalReachConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the GlobalReachConnectionInner object itself. + */ + public GlobalReachConnectionInner withProperties(GlobalReachConnectionProperties properties) { + this.properties = properties; + return this; } /** @@ -98,117 +108,14 @@ public String id() { return this.id; } - /** - * Get the provisioningState property: The state of the ExpressRoute Circuit Authorization provisioning. - * - * @return the provisioningState value. - */ - public GlobalReachConnectionProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the addressPrefix property: The network used for global reach carved out from the original network block - * provided for the private cloud. - * - * @return the addressPrefix value. - */ - public String addressPrefix() { - return this.innerProperties() == null ? null : this.innerProperties().addressPrefix(); - } - - /** - * Get the authorizationKey property: Authorization key from the peer express route used for the global reach - * connection. - * - * @return the authorizationKey value. - */ - public String authorizationKey() { - return this.innerProperties() == null ? null : this.innerProperties().authorizationKey(); - } - - /** - * Set the authorizationKey property: Authorization key from the peer express route used for the global reach - * connection. - * - * @param authorizationKey the authorizationKey value to set. - * @return the GlobalReachConnectionInner object itself. - */ - public GlobalReachConnectionInner withAuthorizationKey(String authorizationKey) { - if (this.innerProperties() == null) { - this.innerProperties = new GlobalReachConnectionProperties(); - } - this.innerProperties().withAuthorizationKey(authorizationKey); - return this; - } - - /** - * Get the circuitConnectionStatus property: The connection status of the global reach connection. - * - * @return the circuitConnectionStatus value. - */ - public GlobalReachConnectionStatus circuitConnectionStatus() { - return this.innerProperties() == null ? null : this.innerProperties().circuitConnectionStatus(); - } - - /** - * Get the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in the global reach - * connection. - * - * @return the peerExpressRouteCircuit value. - */ - public String peerExpressRouteCircuit() { - return this.innerProperties() == null ? null : this.innerProperties().peerExpressRouteCircuit(); - } - - /** - * Set the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in the global reach - * connection. - * - * @param peerExpressRouteCircuit the peerExpressRouteCircuit value to set. - * @return the GlobalReachConnectionInner object itself. - */ - public GlobalReachConnectionInner withPeerExpressRouteCircuit(String peerExpressRouteCircuit) { - if (this.innerProperties() == null) { - this.innerProperties = new GlobalReachConnectionProperties(); - } - this.innerProperties().withPeerExpressRouteCircuit(peerExpressRouteCircuit); - return this; - } - - /** - * Get the expressRouteId property: The ID of the Private Cloud's ExpressRoute Circuit that is participating in the - * global reach connection. - * - * @return the expressRouteId value. - */ - public String expressRouteId() { - return this.innerProperties() == null ? null : this.innerProperties().expressRouteId(); - } - - /** - * Set the expressRouteId property: The ID of the Private Cloud's ExpressRoute Circuit that is participating in the - * global reach connection. - * - * @param expressRouteId the expressRouteId value to set. - * @return the GlobalReachConnectionInner object itself. - */ - public GlobalReachConnectionInner withExpressRouteId(String expressRouteId) { - if (this.innerProperties() == null) { - this.innerProperties = new GlobalReachConnectionProperties(); - } - this.innerProperties().withExpressRouteId(expressRouteId); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -218,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -245,7 +152,7 @@ public static GlobalReachConnectionInner fromJson(JsonReader jsonReader) throws } else if ("type".equals(fieldName)) { deserializedGlobalReachConnectionInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedGlobalReachConnectionInner.innerProperties + deserializedGlobalReachConnectionInner.properties = GlobalReachConnectionProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedGlobalReachConnectionInner.systemData = SystemData.fromJson(reader); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteInner.java index 62fda41d2ad5..4a7d4dd0b00e 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteInner.java @@ -1,28 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.HcxEnterpriseSiteProvisioningState; -import com.azure.resourcemanager.avs.models.HcxEnterpriseSiteStatus; +import com.azure.resourcemanager.avs.models.HcxEnterpriseSiteProperties; import java.io.IOException; /** * An HCX Enterprise Site resource. */ -@Immutable +@Fluent public final class HcxEnterpriseSiteInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private HcxEnterpriseSiteProperties innerProperties; + private HcxEnterpriseSiteProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -51,12 +50,23 @@ public HcxEnterpriseSiteInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private HcxEnterpriseSiteProperties innerProperties() { - return this.innerProperties; + public HcxEnterpriseSiteProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the HcxEnterpriseSiteInner object itself. + */ + public HcxEnterpriseSiteInner withProperties(HcxEnterpriseSiteProperties properties) { + this.properties = properties; + return this; } /** @@ -98,41 +108,14 @@ public String id() { return this.id; } - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public HcxEnterpriseSiteProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the activationKey property: The activation key. - * - * @return the activationKey value. - */ - public String activationKey() { - return this.innerProperties() == null ? null : this.innerProperties().activationKey(); - } - - /** - * Get the status property: The status of the HCX Enterprise Site. - * - * @return the status value. - */ - public HcxEnterpriseSiteStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -142,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -169,7 +152,7 @@ public static HcxEnterpriseSiteInner fromJson(JsonReader jsonReader) throws IOEx } else if ("type".equals(fieldName)) { deserializedHcxEnterpriseSiteInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedHcxEnterpriseSiteInner.innerProperties = HcxEnterpriseSiteProperties.fromJson(reader); + deserializedHcxEnterpriseSiteInner.properties = HcxEnterpriseSiteProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedHcxEnterpriseSiteInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HostModelInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HostModelInner.java new file mode 100644 index 000000000000..7e96f5239b12 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HostModelInner.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.avs.models.HostProperties; +import com.azure.resourcemanager.avs.models.Sku; +import java.io.IOException; +import java.util.List; + +/** + * A host resource. + */ +@Immutable +public final class HostModelInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private HostProperties properties; + + /* + * The availability zones. + */ + private List zones; + + /* + * The SKU (Stock Keeping Unit) assigned to this resource. + */ + private Sku sku; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HostModelInner class. + */ + private HostModelInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public HostProperties properties() { + return this.properties; + } + + /** + * Get the zones property: The availability zones. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Get the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * 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: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostModelInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostModelInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HostModelInner. + */ + public static HostModelInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostModelInner deserializedHostModelInner = new HostModelInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHostModelInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHostModelInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHostModelInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHostModelInner.properties = HostProperties.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedHostModelInner.zones = zones; + } else if ("sku".equals(fieldName)) { + deserializedHostModelInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHostModelInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHostModelInner; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathInner.java index a2aa8dbd083d..9fe3ad2824fe 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,7 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.IscsiPathProvisioningState; +import com.azure.resourcemanager.avs.models.IscsiPathProperties; import java.io.IOException; /** @@ -21,7 +21,7 @@ public final class IscsiPathInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private IscsiPathProperties innerProperties; + private IscsiPathProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -50,12 +50,23 @@ public IscsiPathInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private IscsiPathProperties innerProperties() { - return this.innerProperties; + public IscsiPathProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the IscsiPathInner object itself. + */ + public IscsiPathInner withProperties(IscsiPathProperties properties) { + this.properties = properties; + return this; } /** @@ -97,46 +108,14 @@ public String id() { return this.id; } - /** - * Get the provisioningState property: The state of the iSCSI path provisioning. - * - * @return the provisioningState value. - */ - public IscsiPathProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the networkBlock property: CIDR Block for iSCSI path. - * - * @return the networkBlock value. - */ - public String networkBlock() { - return this.innerProperties() == null ? null : this.innerProperties().networkBlock(); - } - - /** - * Set the networkBlock property: CIDR Block for iSCSI path. - * - * @param networkBlock the networkBlock value to set. - * @return the IscsiPathInner object itself. - */ - public IscsiPathInner withNetworkBlock(String networkBlock) { - if (this.innerProperties() == null) { - this.innerProperties = new IscsiPathProperties(); - } - this.innerProperties().withNetworkBlock(networkBlock); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -146,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -173,7 +152,7 @@ public static IscsiPathInner fromJson(JsonReader jsonReader) throws IOException } else if ("type".equals(fieldName)) { deserializedIscsiPathInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedIscsiPathInner.innerProperties = IscsiPathProperties.fromJson(reader); + deserializedIscsiPathInner.properties = IscsiPathProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedIscsiPathInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/OperationInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/OperationInner.java index 5cf8f1364040..73d77a663a34 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/OperationInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/OperationInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -19,7 +19,7 @@ * * Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -28,8 +28,8 @@ public final class OperationInner implements JsonSerializable { private String name; /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. */ private Boolean isDataAction; @@ -45,14 +45,14 @@ public final class OperationInner implements JsonSerializable { private Origin origin; /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ private ActionType actionType; /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** @@ -67,7 +67,7 @@ public String 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. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -84,17 +84,6 @@ 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". @@ -106,8 +95,8 @@ public Origin origin() { } /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyInner.java index d1a2e360a2f6..39f303d8b7a5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyUpdateProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyUpdateProperties.java index 3438b388b03d..9e5937d64077 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyUpdateProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java index cc6606a1c003..dab5336eff2b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -11,17 +11,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.AvailabilityProperties; -import com.azure.resourcemanager.avs.models.Circuit; -import com.azure.resourcemanager.avs.models.DnsZoneType; -import com.azure.resourcemanager.avs.models.Encryption; -import com.azure.resourcemanager.avs.models.Endpoints; -import com.azure.resourcemanager.avs.models.IdentitySource; -import com.azure.resourcemanager.avs.models.InternetEnum; -import com.azure.resourcemanager.avs.models.ManagementCluster; -import com.azure.resourcemanager.avs.models.NsxPublicIpQuotaRaisedEnum; import com.azure.resourcemanager.avs.models.PrivateCloudIdentity; -import com.azure.resourcemanager.avs.models.PrivateCloudProvisioningState; +import com.azure.resourcemanager.avs.models.PrivateCloudProperties; import com.azure.resourcemanager.avs.models.Sku; import java.io.IOException; import java.util.List; @@ -35,7 +26,7 @@ public final class PrivateCloudInner extends Resource { /* * The resource-specific properties for this resource. */ - private PrivateCloudProperties innerProperties; + private PrivateCloudProperties properties; /* * The SKU (Stock Keeping Unit) assigned to this resource. @@ -47,6 +38,11 @@ public final class PrivateCloudInner extends Resource { */ private PrivateCloudIdentity identity; + /* + * The availability zones. + */ + private List zones; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -74,12 +70,23 @@ public PrivateCloudInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private PrivateCloudProperties innerProperties() { - return this.innerProperties; + public PrivateCloudProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withProperties(PrivateCloudProperties properties) { + this.properties = properties; + return this; } /** @@ -122,6 +129,26 @@ public PrivateCloudInner withIdentity(PrivateCloudIdentity identity) { return this; } + /** + * Get the zones property: The availability zones. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The availability zones. + * + * @param zones the zones value to set. + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withZones(List zones) { + this.zones = zones; + return this; + } + /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -179,410 +206,14 @@ public PrivateCloudInner withTags(Map tags) { return this; } - /** - * Get the managementCluster property: The default cluster used for management. - * - * @return the managementCluster value. - */ - public ManagementCluster managementCluster() { - return this.innerProperties() == null ? null : this.innerProperties().managementCluster(); - } - - /** - * Set the managementCluster property: The default cluster used for management. - * - * @param managementCluster the managementCluster value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withManagementCluster(ManagementCluster managementCluster) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withManagementCluster(managementCluster); - return this; - } - - /** - * Get the internet property: Connectivity to internet is enabled or disabled. - * - * @return the internet value. - */ - public InternetEnum internet() { - return this.innerProperties() == null ? null : this.innerProperties().internet(); - } - - /** - * Set the internet property: Connectivity to internet is enabled or disabled. - * - * @param internet the internet value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withInternet(InternetEnum internet) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withInternet(internet); - return this; - } - - /** - * Get the identitySources property: vCenter Single Sign On Identity Sources. - * - * @return the identitySources value. - */ - public List identitySources() { - return this.innerProperties() == null ? null : this.innerProperties().identitySources(); - } - - /** - * Set the identitySources property: vCenter Single Sign On Identity Sources. - * - * @param identitySources the identitySources value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withIdentitySources(List identitySources) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withIdentitySources(identitySources); - return this; - } - - /** - * Get the availability property: Properties describing how the cloud is distributed across availability zones. - * - * @return the availability value. - */ - public AvailabilityProperties availability() { - return this.innerProperties() == null ? null : this.innerProperties().availability(); - } - - /** - * Set the availability property: Properties describing how the cloud is distributed across availability zones. - * - * @param availability the availability value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withAvailability(AvailabilityProperties availability) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withAvailability(availability); - return this; - } - - /** - * Get the encryption property: Customer managed key encryption, can be enabled or disabled. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.innerProperties() == null ? null : this.innerProperties().encryption(); - } - - /** - * Set the encryption property: Customer managed key encryption, can be enabled or disabled. - * - * @param encryption the encryption value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withEncryption(Encryption encryption) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withEncryption(encryption); - return this; - } - - /** - * Get the extendedNetworkBlocks property: Array of additional networks noncontiguous with networkBlock. Networks - * must be - * unique and non-overlapping across VNet in your subscription, on-premise, and - * this privateCloud networkBlock attribute. Make sure the CIDR format conforms to - * (A.B.C.D/X). - * - * @return the extendedNetworkBlocks value. - */ - public List extendedNetworkBlocks() { - return this.innerProperties() == null ? null : this.innerProperties().extendedNetworkBlocks(); - } - - /** - * Set the extendedNetworkBlocks property: Array of additional networks noncontiguous with networkBlock. Networks - * must be - * unique and non-overlapping across VNet in your subscription, on-premise, and - * this privateCloud networkBlock attribute. Make sure the CIDR format conforms to - * (A.B.C.D/X). - * - * @param extendedNetworkBlocks the extendedNetworkBlocks value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withExtendedNetworkBlocks(List extendedNetworkBlocks) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withExtendedNetworkBlocks(extendedNetworkBlocks); - return this; - } - - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - public PrivateCloudProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the circuit property: An ExpressRoute Circuit. - * - * @return the circuit value. - */ - public Circuit circuit() { - return this.innerProperties() == null ? null : this.innerProperties().circuit(); - } - - /** - * Set the circuit property: An ExpressRoute Circuit. - * - * @param circuit the circuit value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withCircuit(Circuit circuit) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withCircuit(circuit); - return this; - } - - /** - * Get the endpoints property: The endpoints. - * - * @return the endpoints value. - */ - public Endpoints endpoints() { - return this.innerProperties() == null ? null : this.innerProperties().endpoints(); - } - - /** - * Get the networkBlock property: The block of addresses should be unique across VNet in your subscription as - * well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where - * A,B,C,D are between 0 and 255, and X is between 0 and 22. - * - * @return the networkBlock value. - */ - public String networkBlock() { - return this.innerProperties() == null ? null : this.innerProperties().networkBlock(); - } - - /** - * Set the networkBlock property: The block of addresses should be unique across VNet in your subscription as - * well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where - * A,B,C,D are between 0 and 255, and X is between 0 and 22. - * - * @param networkBlock the networkBlock value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withNetworkBlock(String networkBlock) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withNetworkBlock(networkBlock); - return this; - } - - /** - * Get the managementNetwork property: Network used to access vCenter Server and NSX-T Manager. - * - * @return the managementNetwork value. - */ - public String managementNetwork() { - return this.innerProperties() == null ? null : this.innerProperties().managementNetwork(); - } - - /** - * Get the provisioningNetwork property: Used for virtual machine cold migration, cloning, and snapshot migration. - * - * @return the provisioningNetwork value. - */ - public String provisioningNetwork() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningNetwork(); - } - - /** - * Get the vmotionNetwork property: Used for live migration of virtual machines. - * - * @return the vmotionNetwork value. - */ - public String vmotionNetwork() { - return this.innerProperties() == null ? null : this.innerProperties().vmotionNetwork(); - } - - /** - * Get the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud is created. - * - * @return the vcenterPassword value. - */ - public String vcenterPassword() { - return this.innerProperties() == null ? null : this.innerProperties().vcenterPassword(); - } - - /** - * Set the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud is created. - * - * @param vcenterPassword the vcenterPassword value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withVcenterPassword(String vcenterPassword) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withVcenterPassword(vcenterPassword); - return this; - } - - /** - * Get the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is created. - * - * @return the nsxtPassword value. - */ - public String nsxtPassword() { - return this.innerProperties() == null ? null : this.innerProperties().nsxtPassword(); - } - - /** - * Set the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is created. - * - * @param nsxtPassword the nsxtPassword value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withNsxtPassword(String nsxtPassword) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withNsxtPassword(nsxtPassword); - return this; - } - - /** - * Get the vcenterCertificateThumbprint property: Thumbprint of the vCenter Server SSL certificate. - * - * @return the vcenterCertificateThumbprint value. - */ - public String vcenterCertificateThumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().vcenterCertificateThumbprint(); - } - - /** - * Get the nsxtCertificateThumbprint property: Thumbprint of the NSX-T Manager SSL certificate. - * - * @return the nsxtCertificateThumbprint value. - */ - public String nsxtCertificateThumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().nsxtCertificateThumbprint(); - } - - /** - * Get the externalCloudLinks property: Array of cloud link IDs from other clouds that connect to this one. - * - * @return the externalCloudLinks value. - */ - public List externalCloudLinks() { - return this.innerProperties() == null ? null : this.innerProperties().externalCloudLinks(); - } - - /** - * Get the secondaryCircuit property: A secondary expressRoute circuit from a separate AZ. Only present in a - * stretched private cloud. - * - * @return the secondaryCircuit value. - */ - public Circuit secondaryCircuit() { - return this.innerProperties() == null ? null : this.innerProperties().secondaryCircuit(); - } - - /** - * Set the secondaryCircuit property: A secondary expressRoute circuit from a separate AZ. Only present in a - * stretched private cloud. - * - * @param secondaryCircuit the secondaryCircuit value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withSecondaryCircuit(Circuit secondaryCircuit) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withSecondaryCircuit(secondaryCircuit); - return this; - } - - /** - * Get the nsxPublicIpQuotaRaised property: Flag to indicate whether the private cloud has the quota for provisioned - * NSX - * Public IP count raised from 64 to 1024. - * - * @return the nsxPublicIpQuotaRaised value. - */ - public NsxPublicIpQuotaRaisedEnum nsxPublicIpQuotaRaised() { - return this.innerProperties() == null ? null : this.innerProperties().nsxPublicIpQuotaRaised(); - } - - /** - * Get the virtualNetworkId property: Azure resource ID of the virtual network. - * - * @return the virtualNetworkId value. - */ - public String virtualNetworkId() { - return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkId(); - } - - /** - * Set the virtualNetworkId property: Azure resource ID of the virtual network. - * - * @param virtualNetworkId the virtualNetworkId value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withVirtualNetworkId(String virtualNetworkId) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withVirtualNetworkId(virtualNetworkId); - return this; - } - - /** - * Get the dnsZoneType property: The type of DNS zone to use. - * - * @return the dnsZoneType value. - */ - public DnsZoneType dnsZoneType() { - return this.innerProperties() == null ? null : this.innerProperties().dnsZoneType(); - } - - /** - * Set the dnsZoneType property: The type of DNS zone to use. - * - * @param dnsZoneType the dnsZoneType value to set. - * @return the PrivateCloudInner object itself. - */ - public PrivateCloudInner withDnsZoneType(DnsZoneType dnsZoneType) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); - } - this.innerProperties().withDnsZoneType(dnsZoneType); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } if (sku() == null) { throw LOGGER.atError() @@ -593,10 +224,6 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (location() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property location in model PrivateCloudInner")); - } } private static final ClientLogger LOGGER = new ClientLogger(PrivateCloudInner.class); @@ -610,8 +237,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -645,9 +273,12 @@ public static PrivateCloudInner fromJson(JsonReader jsonReader) throws IOExcepti } else if ("sku".equals(fieldName)) { deserializedPrivateCloudInner.sku = Sku.fromJson(reader); } else if ("properties".equals(fieldName)) { - deserializedPrivateCloudInner.innerProperties = PrivateCloudProperties.fromJson(reader); + deserializedPrivateCloudInner.properties = PrivateCloudProperties.fromJson(reader); } else if ("identity".equals(fieldName)) { deserializedPrivateCloudInner.identity = PrivateCloudIdentity.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateCloudInner.zones = zones; } else if ("systemData".equals(fieldName)) { deserializedPrivateCloudInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudUpdateProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudUpdateProperties.java index 3128314b749c..da1d4d2bbdbe 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudUpdateProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ProvisionedNetworkInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ProvisionedNetworkInner.java new file mode 100644 index 000000000000..1877d7e8d82d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ProvisionedNetworkInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.avs.models.ProvisionedNetworkProperties; +import java.io.IOException; + +/** + * A provisioned network resource. + */ +@Immutable +public final class ProvisionedNetworkInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ProvisionedNetworkProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ProvisionedNetworkInner class. + */ + private ProvisionedNetworkInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ProvisionedNetworkProperties properties() { + return this.properties; + } + + /** + * 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: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisionedNetworkInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisionedNetworkInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProvisionedNetworkInner. + */ + public static ProvisionedNetworkInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisionedNetworkInner deserializedProvisionedNetworkInner = new ProvisionedNetworkInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProvisionedNetworkInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProvisionedNetworkInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProvisionedNetworkInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProvisionedNetworkInner.properties = ProvisionedNetworkProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedProvisionedNetworkInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProvisionedNetworkInner; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/QuotaInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/QuotaInner.java index 60b0b840ade1..3cb22332a58a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/QuotaInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/QuotaInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -31,7 +31,7 @@ public final class QuotaInner implements JsonSerializable { /** * Creates an instance of QuotaInner class. */ - public QuotaInner() { + private QuotaInner() { } /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ResourceSkuInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ResourceSkuInner.java new file mode 100644 index 000000000000..78f24a16321e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ResourceSkuInner.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.avs.models.ResourceSkuCapabilities; +import com.azure.resourcemanager.avs.models.ResourceSkuLocationInfo; +import com.azure.resourcemanager.avs.models.ResourceSkuResourceType; +import com.azure.resourcemanager.avs.models.ResourceSkuRestrictions; +import java.io.IOException; +import java.util.List; + +/** + * A SKU for a resource. + */ +@Immutable +public final class ResourceSkuInner implements JsonSerializable { + /* + * The type of resource the SKU applies to. + */ + private ResourceSkuResourceType resourceType; + + /* + * The name of the SKU. + */ + private String name; + + /* + * The tier of virtual machines in a scale set + */ + private String tier; + + /* + * The size of the SKU. + */ + private String size; + + /* + * The family of the SKU. + */ + private String family; + + /* + * The set of locations that the SKU is available. + */ + private List locations; + + /* + * A list of locations and availability zones in those locations where the SKU is available + */ + private List locationInfo; + + /* + * Name value pairs to describe the capability. + */ + private List capabilities; + + /* + * The restrictions of the SKU. + */ + private List restrictions; + + /** + * Creates an instance of ResourceSkuInner class. + */ + private ResourceSkuInner() { + } + + /** + * Get the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + public ResourceSkuResourceType resourceType() { + return this.resourceType; + } + + /** + * Get the name property: The name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the tier property: The tier of virtual machines in a scale set. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Get the size property: The size of the SKU. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Get the family property: The family of the SKU. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Get the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the locationInfo property: A list of locations and availability zones in those locations where the SKU is + * available. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the capabilities property: Name value pairs to describe the capability. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions property: The restrictions of the SKU. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property resourceType in model ResourceSkuInner")); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model ResourceSkuInner")); + } + if (locations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property locations in model ResourceSkuInner")); + } + if (locationInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property locationInfo in model ResourceSkuInner")); + } else { + locationInfo().forEach(e -> e.validate()); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (restrictions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property restrictions in model ResourceSkuInner")); + } else { + restrictions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceSkuInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceType", this.resourceType == null ? null : this.resourceType.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("locations", this.locations, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("locationInfo", this.locationInfo, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("restrictions", this.restrictions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("tier", this.tier); + jsonWriter.writeStringField("size", this.size); + jsonWriter.writeStringField("family", this.family); + jsonWriter.writeArrayField("capabilities", this.capabilities, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSkuInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSkuInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceSkuInner. + */ + public static ResourceSkuInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSkuInner deserializedResourceSkuInner = new ResourceSkuInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceType".equals(fieldName)) { + deserializedResourceSkuInner.resourceType = ResourceSkuResourceType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedResourceSkuInner.name = reader.getString(); + } else if ("locations".equals(fieldName)) { + List locations = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceSkuInner.locations = locations; + } else if ("locationInfo".equals(fieldName)) { + List locationInfo + = reader.readArray(reader1 -> ResourceSkuLocationInfo.fromJson(reader1)); + deserializedResourceSkuInner.locationInfo = locationInfo; + } else if ("restrictions".equals(fieldName)) { + List restrictions + = reader.readArray(reader1 -> ResourceSkuRestrictions.fromJson(reader1)); + deserializedResourceSkuInner.restrictions = restrictions; + } else if ("tier".equals(fieldName)) { + deserializedResourceSkuInner.tier = reader.getString(); + } else if ("size".equals(fieldName)) { + deserializedResourceSkuInner.size = reader.getString(); + } else if ("family".equals(fieldName)) { + deserializedResourceSkuInner.family = reader.getString(); + } else if ("capabilities".equals(fieldName)) { + List capabilities + = reader.readArray(reader1 -> ResourceSkuCapabilities.fromJson(reader1)); + deserializedResourceSkuInner.capabilities = capabilities; + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSkuInner; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletInner.java index eaf65199d9aa..968e259249bd 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,11 +10,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.ScriptCmdletAudience; -import com.azure.resourcemanager.avs.models.ScriptCmdletProvisioningState; -import com.azure.resourcemanager.avs.models.ScriptParameter; +import com.azure.resourcemanager.avs.models.ScriptCmdletProperties; import java.io.IOException; -import java.util.List; /** * A cmdlet available for script execution. @@ -24,7 +21,7 @@ public final class ScriptCmdletInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private ScriptCmdletProperties innerProperties; + private ScriptCmdletProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -49,16 +46,16 @@ public final class ScriptCmdletInner extends ProxyResource { /** * Creates an instance of ScriptCmdletInner class. */ - public ScriptCmdletInner() { + private ScriptCmdletInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private ScriptCmdletProperties innerProperties() { - return this.innerProperties; + public ScriptCmdletProperties properties() { + return this.properties; } /** @@ -100,60 +97,14 @@ public String id() { return this.id; } - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ScriptCmdletProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the description property: Description of the scripts functionality. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the timeout property: Recommended time limit for execution. - * - * @return the timeout value. - */ - public String timeout() { - return this.innerProperties() == null ? null : this.innerProperties().timeout(); - } - - /** - * Get the audience property: Specifies whether a script cmdlet is intended to be invoked only through automation or - * visible to customers. - * - * @return the audience value. - */ - public ScriptCmdletAudience audience() { - return this.innerProperties() == null ? null : this.innerProperties().audience(); - } - - /** - * Get the parameters property: Parameters the script will accept. - * - * @return the parameters value. - */ - public List parameters() { - return this.innerProperties() == null ? null : this.innerProperties().parameters(); - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -163,7 +114,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -190,7 +141,7 @@ public static ScriptCmdletInner fromJson(JsonReader jsonReader) throws IOExcepti } else if ("type".equals(fieldName)) { deserializedScriptCmdletInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedScriptCmdletInner.innerProperties = ScriptCmdletProperties.fromJson(reader); + deserializedScriptCmdletInner.properties = ScriptCmdletProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedScriptCmdletInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionInner.java index 95f2a7f4ad14..af2409965a95 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,12 +10,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.ScriptExecutionParameter; -import com.azure.resourcemanager.avs.models.ScriptExecutionProvisioningState; +import com.azure.resourcemanager.avs.models.ScriptExecutionProperties; import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; /** * An instance of a script executed by a user - custom or AVS. @@ -25,7 +21,7 @@ public final class ScriptExecutionInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private ScriptExecutionProperties innerProperties; + private ScriptExecutionProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -54,12 +50,23 @@ public ScriptExecutionInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private ScriptExecutionProperties innerProperties() { - return this.innerProperties; + public ScriptExecutionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ScriptExecutionInner object itself. + */ + public ScriptExecutionInner withProperties(ScriptExecutionProperties properties) { + this.properties = properties; + return this; } /** @@ -101,265 +108,14 @@ public String id() { return this.id; } - /** - * Get the scriptCmdletId property: A reference to the script cmdlet resource if user is running a AVS script. - * - * @return the scriptCmdletId value. - */ - public String scriptCmdletId() { - return this.innerProperties() == null ? null : this.innerProperties().scriptCmdletId(); - } - - /** - * Set the scriptCmdletId property: A reference to the script cmdlet resource if user is running a AVS script. - * - * @param scriptCmdletId the scriptCmdletId value to set. - * @return the ScriptExecutionInner object itself. - */ - public ScriptExecutionInner withScriptCmdletId(String scriptCmdletId) { - if (this.innerProperties() == null) { - this.innerProperties = new ScriptExecutionProperties(); - } - this.innerProperties().withScriptCmdletId(scriptCmdletId); - return this; - } - - /** - * Get the parameters property: Parameters the script will accept. - * - * @return the parameters value. - */ - public List parameters() { - return this.innerProperties() == null ? null : this.innerProperties().parameters(); - } - - /** - * Set the parameters property: Parameters the script will accept. - * - * @param parameters the parameters value to set. - * @return the ScriptExecutionInner object itself. - */ - public ScriptExecutionInner withParameters(List parameters) { - if (this.innerProperties() == null) { - this.innerProperties = new ScriptExecutionProperties(); - } - this.innerProperties().withParameters(parameters); - return this; - } - - /** - * Get the hiddenParameters property: Parameters that will be hidden/not visible to ARM, such as passwords and - * credentials. - * - * @return the hiddenParameters value. - */ - public List hiddenParameters() { - return this.innerProperties() == null ? null : this.innerProperties().hiddenParameters(); - } - - /** - * Set the hiddenParameters property: Parameters that will be hidden/not visible to ARM, such as passwords and - * credentials. - * - * @param hiddenParameters the hiddenParameters value to set. - * @return the ScriptExecutionInner object itself. - */ - public ScriptExecutionInner withHiddenParameters(List hiddenParameters) { - if (this.innerProperties() == null) { - this.innerProperties = new ScriptExecutionProperties(); - } - this.innerProperties().withHiddenParameters(hiddenParameters); - return this; - } - - /** - * Get the failureReason property: Error message if the script was able to run, but if the script itself had - * errors or powershell threw an exception. - * - * @return the failureReason value. - */ - public String failureReason() { - return this.innerProperties() == null ? null : this.innerProperties().failureReason(); - } - - /** - * Set the failureReason property: Error message if the script was able to run, but if the script itself had - * errors or powershell threw an exception. - * - * @param failureReason the failureReason value to set. - * @return the ScriptExecutionInner object itself. - */ - public ScriptExecutionInner withFailureReason(String failureReason) { - if (this.innerProperties() == null) { - this.innerProperties = new ScriptExecutionProperties(); - } - this.innerProperties().withFailureReason(failureReason); - return this; - } - - /** - * Get the timeout property: Time limit for execution. - * - * @return the timeout value. - */ - public String timeout() { - return this.innerProperties() == null ? null : this.innerProperties().timeout(); - } - - /** - * Set the timeout property: Time limit for execution. - * - * @param timeout the timeout value to set. - * @return the ScriptExecutionInner object itself. - */ - public ScriptExecutionInner withTimeout(String timeout) { - if (this.innerProperties() == null) { - this.innerProperties = new ScriptExecutionProperties(); - } - this.innerProperties().withTimeout(timeout); - return this; - } - - /** - * Get the retention property: Time to live for the resource. If not provided, will be available for 60 days. - * - * @return the retention value. - */ - public String retention() { - return this.innerProperties() == null ? null : this.innerProperties().retention(); - } - - /** - * Set the retention property: Time to live for the resource. If not provided, will be available for 60 days. - * - * @param retention the retention value to set. - * @return the ScriptExecutionInner object itself. - */ - public ScriptExecutionInner withRetention(String retention) { - if (this.innerProperties() == null) { - this.innerProperties = new ScriptExecutionProperties(); - } - this.innerProperties().withRetention(retention); - return this; - } - - /** - * Get the submittedAt property: Time the script execution was submitted. - * - * @return the submittedAt value. - */ - public OffsetDateTime submittedAt() { - return this.innerProperties() == null ? null : this.innerProperties().submittedAt(); - } - - /** - * Get the startedAt property: Time the script execution was started. - * - * @return the startedAt value. - */ - public OffsetDateTime startedAt() { - return this.innerProperties() == null ? null : this.innerProperties().startedAt(); - } - - /** - * Get the finishedAt property: Time the script execution was finished. - * - * @return the finishedAt value. - */ - public OffsetDateTime finishedAt() { - return this.innerProperties() == null ? null : this.innerProperties().finishedAt(); - } - - /** - * Get the provisioningState property: The state of the script execution resource. - * - * @return the provisioningState value. - */ - public ScriptExecutionProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the output property: Standard output stream from the powershell execution. - * - * @return the output value. - */ - public List output() { - return this.innerProperties() == null ? null : this.innerProperties().output(); - } - - /** - * Set the output property: Standard output stream from the powershell execution. - * - * @param output the output value to set. - * @return the ScriptExecutionInner object itself. - */ - public ScriptExecutionInner withOutput(List output) { - if (this.innerProperties() == null) { - this.innerProperties = new ScriptExecutionProperties(); - } - this.innerProperties().withOutput(output); - return this; - } - - /** - * Get the namedOutputs property: User-defined dictionary. - * - * @return the namedOutputs value. - */ - public Map namedOutputs() { - return this.innerProperties() == null ? null : this.innerProperties().namedOutputs(); - } - - /** - * Set the namedOutputs property: User-defined dictionary. - * - * @param namedOutputs the namedOutputs value to set. - * @return the ScriptExecutionInner object itself. - */ - public ScriptExecutionInner withNamedOutputs(Map namedOutputs) { - if (this.innerProperties() == null) { - this.innerProperties = new ScriptExecutionProperties(); - } - this.innerProperties().withNamedOutputs(namedOutputs); - return this; - } - - /** - * Get the information property: Standard information out stream from the powershell execution. - * - * @return the information value. - */ - public List information() { - return this.innerProperties() == null ? null : this.innerProperties().information(); - } - - /** - * Get the warnings property: Standard warning out stream from the powershell execution. - * - * @return the warnings value. - */ - public List warnings() { - return this.innerProperties() == null ? null : this.innerProperties().warnings(); - } - - /** - * Get the errors property: Standard error output stream from the powershell execution. - * - * @return the errors value. - */ - public List errors() { - return this.innerProperties() == null ? null : this.innerProperties().errors(); - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -369,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -396,7 +152,7 @@ public static ScriptExecutionInner fromJson(JsonReader jsonReader) throws IOExce } else if ("type".equals(fieldName)) { deserializedScriptExecutionInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedScriptExecutionInner.innerProperties = ScriptExecutionProperties.fromJson(reader); + deserializedScriptExecutionInner.properties = ScriptExecutionProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedScriptExecutionInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageInner.java index 2028b87bd5b6..6f7a54bdcfae 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,7 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.ScriptPackageProvisioningState; +import com.azure.resourcemanager.avs.models.ScriptPackageProperties; import java.io.IOException; /** @@ -21,7 +21,7 @@ public final class ScriptPackageInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private ScriptPackageProperties innerProperties; + private ScriptPackageProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -46,16 +46,16 @@ public final class ScriptPackageInner extends ProxyResource { /** * Creates an instance of ScriptPackageInner class. */ - public ScriptPackageInner() { + private ScriptPackageInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private ScriptPackageProperties innerProperties() { - return this.innerProperties; + public ScriptPackageProperties properties() { + return this.properties; } /** @@ -97,59 +97,14 @@ public String id() { return this.id; } - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ScriptPackageProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the description property: User friendly description of the package. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the version property: Module version. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Get the company property: Company that created and supports the package. - * - * @return the company value. - */ - public String company() { - return this.innerProperties() == null ? null : this.innerProperties().company(); - } - - /** - * Get the uri property: Link to support by the package vendor. - * - * @return the uri value. - */ - public String uri() { - return this.innerProperties() == null ? null : this.innerProperties().uri(); - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -159,7 +114,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -186,7 +141,7 @@ public static ScriptPackageInner fromJson(JsonReader jsonReader) throws IOExcept } else if ("type".equals(fieldName)) { deserializedScriptPackageInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedScriptPackageInner.innerProperties = ScriptPackageProperties.fromJson(reader); + deserializedScriptPackageInner.properties = ScriptPackageProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedScriptPackageInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/TrialInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/TrialInner.java index 752ee2eab88b..82c6e9f8cd52 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/TrialInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/TrialInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -30,7 +30,7 @@ public final class TrialInner implements JsonSerializable { /** * Creates an instance of TrialInner class. */ - public TrialInner() { + private TrialInner() { } /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineInner.java index dfff5a9f29c4..6fcfc18a7b05 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,8 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.VirtualMachineProvisioningState; -import com.azure.resourcemanager.avs.models.VirtualMachineRestrictMovementState; +import com.azure.resourcemanager.avs.models.VirtualMachineProperties; import java.io.IOException; /** @@ -22,7 +21,7 @@ public final class VirtualMachineInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private VirtualMachineProperties innerProperties; + private VirtualMachineProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -47,16 +46,16 @@ public final class VirtualMachineInner extends ProxyResource { /** * Creates an instance of VirtualMachineInner class. */ - public VirtualMachineInner() { + private VirtualMachineInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private VirtualMachineProperties innerProperties() { - return this.innerProperties; + public VirtualMachineProperties properties() { + return this.properties; } /** @@ -98,59 +97,14 @@ public String id() { return this.id; } - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public VirtualMachineProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the displayName property: Display name of the VM. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the moRefId property: Virtual machine managed object reference id. - * - * @return the moRefId value. - */ - public String moRefId() { - return this.innerProperties() == null ? null : this.innerProperties().moRefId(); - } - - /** - * Get the folderPath property: Path to virtual machine's folder starting from datacenter virtual machine folder. - * - * @return the folderPath value. - */ - public String folderPath() { - return this.innerProperties() == null ? null : this.innerProperties().folderPath(); - } - - /** - * Get the restrictMovement property: Whether VM DRS-driven movement is restricted (enabled) or not (disabled). - * - * @return the restrictMovement value. - */ - public VirtualMachineRestrictMovementState restrictMovement() { - return this.innerProperties() == null ? null : this.innerProperties().restrictMovement(); - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -160,7 +114,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -187,7 +141,7 @@ public static VirtualMachineInner fromJson(JsonReader jsonReader) throws IOExcep } else if ("type".equals(fieldName)) { deserializedVirtualMachineInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedVirtualMachineInner.innerProperties = VirtualMachineProperties.fromJson(reader); + deserializedVirtualMachineInner.properties = VirtualMachineProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedVirtualMachineInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java index 3906a82a1614..8c43aace77e2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java index 408262505052..0aebc0e5344f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,11 +10,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; -import com.azure.resourcemanager.avs.models.DnsServiceStatusEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProperties; import java.io.IOException; -import java.util.List; /** * NSX DNS Service. @@ -24,7 +21,7 @@ public final class WorkloadNetworkDnsServiceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private WorkloadNetworkDnsServiceProperties innerProperties; + private WorkloadNetworkDnsServiceProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -53,12 +50,23 @@ public WorkloadNetworkDnsServiceInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private WorkloadNetworkDnsServiceProperties innerProperties() { - return this.innerProperties; + public WorkloadNetworkDnsServiceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withProperties(WorkloadNetworkDnsServiceProperties properties) { + this.properties = properties; + return this; } /** @@ -100,170 +108,14 @@ public String id() { return this.id; } - /** - * Get the displayName property: Display name of the DNS Service. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the DNS Service. - * - * @param displayName the displayName value to set. - * @return the WorkloadNetworkDnsServiceInner object itself. - */ - public WorkloadNetworkDnsServiceInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkDnsServiceProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the dnsServiceIp property: DNS service IP of the DNS Service. - * - * @return the dnsServiceIp value. - */ - public String dnsServiceIp() { - return this.innerProperties() == null ? null : this.innerProperties().dnsServiceIp(); - } - - /** - * Set the dnsServiceIp property: DNS service IP of the DNS Service. - * - * @param dnsServiceIp the dnsServiceIp value to set. - * @return the WorkloadNetworkDnsServiceInner object itself. - */ - public WorkloadNetworkDnsServiceInner withDnsServiceIp(String dnsServiceIp) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkDnsServiceProperties(); - } - this.innerProperties().withDnsServiceIp(dnsServiceIp); - return this; - } - - /** - * Get the defaultDnsZone property: Default DNS zone of the DNS Service. - * - * @return the defaultDnsZone value. - */ - public String defaultDnsZone() { - return this.innerProperties() == null ? null : this.innerProperties().defaultDnsZone(); - } - - /** - * Set the defaultDnsZone property: Default DNS zone of the DNS Service. - * - * @param defaultDnsZone the defaultDnsZone value to set. - * @return the WorkloadNetworkDnsServiceInner object itself. - */ - public WorkloadNetworkDnsServiceInner withDefaultDnsZone(String defaultDnsZone) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkDnsServiceProperties(); - } - this.innerProperties().withDefaultDnsZone(defaultDnsZone); - return this; - } - - /** - * Get the fqdnZones property: FQDN zones of the DNS Service. - * - * @return the fqdnZones value. - */ - public List fqdnZones() { - return this.innerProperties() == null ? null : this.innerProperties().fqdnZones(); - } - - /** - * Set the fqdnZones property: FQDN zones of the DNS Service. - * - * @param fqdnZones the fqdnZones value to set. - * @return the WorkloadNetworkDnsServiceInner object itself. - */ - public WorkloadNetworkDnsServiceInner withFqdnZones(List fqdnZones) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkDnsServiceProperties(); - } - this.innerProperties().withFqdnZones(fqdnZones); - return this; - } - - /** - * Get the logLevel property: DNS Service log level. - * - * @return the logLevel value. - */ - public DnsServiceLogLevelEnum logLevel() { - return this.innerProperties() == null ? null : this.innerProperties().logLevel(); - } - - /** - * Set the logLevel property: DNS Service log level. - * - * @param logLevel the logLevel value to set. - * @return the WorkloadNetworkDnsServiceInner object itself. - */ - public WorkloadNetworkDnsServiceInner withLogLevel(DnsServiceLogLevelEnum logLevel) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkDnsServiceProperties(); - } - this.innerProperties().withLogLevel(logLevel); - return this; - } - - /** - * Get the status property: DNS Service status. - * - * @return the status value. - */ - public DnsServiceStatusEnum status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - public WorkloadNetworkDnsServiceProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the revision property: NSX revision number. - * - * @return the revision value. - */ - public Long revision() { - return this.innerProperties() == null ? null : this.innerProperties().revision(); - } - - /** - * Set the revision property: NSX revision number. - * - * @param revision the revision value to set. - * @return the WorkloadNetworkDnsServiceInner object itself. - */ - public WorkloadNetworkDnsServiceInner withRevision(Long revision) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkDnsServiceProperties(); - } - this.innerProperties().withRevision(revision); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -273,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -301,7 +153,7 @@ public static WorkloadNetworkDnsServiceInner fromJson(JsonReader jsonReader) thr } else if ("type".equals(fieldName)) { deserializedWorkloadNetworkDnsServiceInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedWorkloadNetworkDnsServiceInner.innerProperties + deserializedWorkloadNetworkDnsServiceInner.properties = WorkloadNetworkDnsServiceProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedWorkloadNetworkDnsServiceInner.systemData = SystemData.fromJson(reader); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java index a98096f2ba4e..2889cc241e2e 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,9 +10,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProperties; import java.io.IOException; -import java.util.List; /** * NSX DNS Zone. @@ -22,7 +21,7 @@ public final class WorkloadNetworkDnsZoneInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private WorkloadNetworkDnsZoneProperties innerProperties; + private WorkloadNetworkDnsZoneProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -51,12 +50,23 @@ public WorkloadNetworkDnsZoneInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private WorkloadNetworkDnsZoneProperties innerProperties() { - return this.innerProperties; + public WorkloadNetworkDnsZoneProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withProperties(WorkloadNetworkDnsZoneProperties properties) { + this.properties = properties; + return this; } /** @@ -98,161 +108,14 @@ public String id() { return this.id; } - /** - * Get the displayName property: Display name of the DNS Zone. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the DNS Zone. - * - * @param displayName the displayName value to set. - * @return the WorkloadNetworkDnsZoneInner object itself. - */ - public WorkloadNetworkDnsZoneInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkDnsZoneProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the domain property: Domain names of the DNS Zone. - * - * @return the domain value. - */ - public List domain() { - return this.innerProperties() == null ? null : this.innerProperties().domain(); - } - - /** - * Set the domain property: Domain names of the DNS Zone. - * - * @param domain the domain value to set. - * @return the WorkloadNetworkDnsZoneInner object itself. - */ - public WorkloadNetworkDnsZoneInner withDomain(List domain) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkDnsZoneProperties(); - } - this.innerProperties().withDomain(domain); - return this; - } - - /** - * Get the dnsServerIps property: DNS Server IP array of the DNS Zone. - * - * @return the dnsServerIps value. - */ - public List dnsServerIps() { - return this.innerProperties() == null ? null : this.innerProperties().dnsServerIps(); - } - - /** - * Set the dnsServerIps property: DNS Server IP array of the DNS Zone. - * - * @param dnsServerIps the dnsServerIps value to set. - * @return the WorkloadNetworkDnsZoneInner object itself. - */ - public WorkloadNetworkDnsZoneInner withDnsServerIps(List dnsServerIps) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkDnsZoneProperties(); - } - this.innerProperties().withDnsServerIps(dnsServerIps); - return this; - } - - /** - * Get the sourceIp property: Source IP of the DNS Zone. - * - * @return the sourceIp value. - */ - public String sourceIp() { - return this.innerProperties() == null ? null : this.innerProperties().sourceIp(); - } - - /** - * Set the sourceIp property: Source IP of the DNS Zone. - * - * @param sourceIp the sourceIp value to set. - * @return the WorkloadNetworkDnsZoneInner object itself. - */ - public WorkloadNetworkDnsZoneInner withSourceIp(String sourceIp) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkDnsZoneProperties(); - } - this.innerProperties().withSourceIp(sourceIp); - return this; - } - - /** - * Get the dnsServices property: Number of DNS Services using the DNS zone. - * - * @return the dnsServices value. - */ - public Long dnsServices() { - return this.innerProperties() == null ? null : this.innerProperties().dnsServices(); - } - - /** - * Set the dnsServices property: Number of DNS Services using the DNS zone. - * - * @param dnsServices the dnsServices value to set. - * @return the WorkloadNetworkDnsZoneInner object itself. - */ - public WorkloadNetworkDnsZoneInner withDnsServices(Long dnsServices) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkDnsZoneProperties(); - } - this.innerProperties().withDnsServices(dnsServices); - return this; - } - - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - public WorkloadNetworkDnsZoneProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the revision property: NSX revision number. - * - * @return the revision value. - */ - public Long revision() { - return this.innerProperties() == null ? null : this.innerProperties().revision(); - } - - /** - * Set the revision property: NSX revision number. - * - * @param revision the revision value to set. - * @return the WorkloadNetworkDnsZoneInner object itself. - */ - public WorkloadNetworkDnsZoneInner withRevision(Long revision) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkDnsZoneProperties(); - } - this.innerProperties().withRevision(revision); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -262,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -289,7 +152,7 @@ public static WorkloadNetworkDnsZoneInner fromJson(JsonReader jsonReader) throws } else if ("type".equals(fieldName)) { deserializedWorkloadNetworkDnsZoneInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedWorkloadNetworkDnsZoneInner.innerProperties + deserializedWorkloadNetworkDnsZoneInner.properties = WorkloadNetworkDnsZoneProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedWorkloadNetworkDnsZoneInner.systemData = SystemData.fromJson(reader); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java index f85ab8751b9d..4daac1addb7d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java @@ -1,27 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.WorkloadNetworkProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkGatewayProperties; import java.io.IOException; /** * NSX Gateway. */ -@Fluent +@Immutable public final class WorkloadNetworkGatewayInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private WorkloadNetworkGatewayProperties innerProperties; + private WorkloadNetworkGatewayProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -46,16 +46,16 @@ public final class WorkloadNetworkGatewayInner extends ProxyResource { /** * Creates an instance of WorkloadNetworkGatewayInner class. */ - public WorkloadNetworkGatewayInner() { + private WorkloadNetworkGatewayInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private WorkloadNetworkGatewayProperties innerProperties() { - return this.innerProperties; + public WorkloadNetworkGatewayProperties properties() { + return this.properties; } /** @@ -97,55 +97,14 @@ public String id() { return this.id; } - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public WorkloadNetworkProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the displayName property: Display name of the DHCP entity. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the DHCP entity. - * - * @param displayName the displayName value to set. - * @return the WorkloadNetworkGatewayInner object itself. - */ - public WorkloadNetworkGatewayInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkGatewayProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the path property: NSX Gateway Path. - * - * @return the path value. - */ - public String path() { - return this.innerProperties() == null ? null : this.innerProperties().path(); - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -155,7 +114,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -182,7 +141,7 @@ public static WorkloadNetworkGatewayInner fromJson(JsonReader jsonReader) throws } else if ("type".equals(fieldName)) { deserializedWorkloadNetworkGatewayInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedWorkloadNetworkGatewayInner.innerProperties + deserializedWorkloadNetworkGatewayInner.properties = WorkloadNetworkGatewayProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedWorkloadNetworkGatewayInner.systemData = SystemData.fromJson(reader); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkInner.java index cb79295855e6..4e65d4ec8b0b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,7 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.WorkloadNetworkProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkProperties; import java.io.IOException; /** @@ -21,7 +21,7 @@ public final class WorkloadNetworkInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private WorkloadNetworkProperties innerProperties; + private WorkloadNetworkProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -46,16 +46,16 @@ public final class WorkloadNetworkInner extends ProxyResource { /** * Creates an instance of WorkloadNetworkInner class. */ - public WorkloadNetworkInner() { + private WorkloadNetworkInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private WorkloadNetworkProperties innerProperties() { - return this.innerProperties; + public WorkloadNetworkProperties properties() { + return this.properties; } /** @@ -97,23 +97,14 @@ public String id() { return this.id; } - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public WorkloadNetworkProvisioningState 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(); + if (properties() != null) { + properties().validate(); } } @@ -123,7 +114,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -150,7 +141,7 @@ public static WorkloadNetworkInner fromJson(JsonReader jsonReader) throws IOExce } else if ("type".equals(fieldName)) { deserializedWorkloadNetworkInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedWorkloadNetworkInner.innerProperties = WorkloadNetworkProperties.fromJson(reader); + deserializedWorkloadNetworkInner.properties = WorkloadNetworkProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedWorkloadNetworkInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java index 2ca03e1c361a..5da1a2d0373d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,9 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; -import com.azure.resourcemanager.avs.models.PortMirroringStatusEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProperties; import java.io.IOException; /** @@ -23,7 +21,7 @@ public final class WorkloadNetworkPortMirroringInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private WorkloadNetworkPortMirroringProperties innerProperties; + private WorkloadNetworkPortMirroringProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -52,12 +50,23 @@ public WorkloadNetworkPortMirroringInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private WorkloadNetworkPortMirroringProperties innerProperties() { - return this.innerProperties; + public WorkloadNetworkPortMirroringProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WorkloadNetworkPortMirroringInner object itself. + */ + public WorkloadNetworkPortMirroringInner withProperties(WorkloadNetworkPortMirroringProperties properties) { + this.properties = properties; + return this; } /** @@ -99,147 +108,14 @@ public String id() { return this.id; } - /** - * Get the displayName property: Display name of the port mirroring profile. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the port mirroring profile. - * - * @param displayName the displayName value to set. - * @return the WorkloadNetworkPortMirroringInner object itself. - */ - public WorkloadNetworkPortMirroringInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkPortMirroringProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the direction property: Direction of port mirroring profile. - * - * @return the direction value. - */ - public PortMirroringDirectionEnum direction() { - return this.innerProperties() == null ? null : this.innerProperties().direction(); - } - - /** - * Set the direction property: Direction of port mirroring profile. - * - * @param direction the direction value to set. - * @return the WorkloadNetworkPortMirroringInner object itself. - */ - public WorkloadNetworkPortMirroringInner withDirection(PortMirroringDirectionEnum direction) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkPortMirroringProperties(); - } - this.innerProperties().withDirection(direction); - return this; - } - - /** - * Get the source property: Source VM Group. - * - * @return the source value. - */ - public String source() { - return this.innerProperties() == null ? null : this.innerProperties().source(); - } - - /** - * Set the source property: Source VM Group. - * - * @param source the source value to set. - * @return the WorkloadNetworkPortMirroringInner object itself. - */ - public WorkloadNetworkPortMirroringInner withSource(String source) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkPortMirroringProperties(); - } - this.innerProperties().withSource(source); - return this; - } - - /** - * Get the destination property: Destination VM Group. - * - * @return the destination value. - */ - public String destination() { - return this.innerProperties() == null ? null : this.innerProperties().destination(); - } - - /** - * Set the destination property: Destination VM Group. - * - * @param destination the destination value to set. - * @return the WorkloadNetworkPortMirroringInner object itself. - */ - public WorkloadNetworkPortMirroringInner withDestination(String destination) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkPortMirroringProperties(); - } - this.innerProperties().withDestination(destination); - return this; - } - - /** - * Get the status property: Port Mirroring Status. - * - * @return the status value. - */ - public PortMirroringStatusEnum status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - public WorkloadNetworkPortMirroringProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the revision property: NSX revision number. - * - * @return the revision value. - */ - public Long revision() { - return this.innerProperties() == null ? null : this.innerProperties().revision(); - } - - /** - * Set the revision property: NSX revision number. - * - * @param revision the revision value to set. - * @return the WorkloadNetworkPortMirroringInner object itself. - */ - public WorkloadNetworkPortMirroringInner withRevision(Long revision) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkPortMirroringProperties(); - } - this.innerProperties().withRevision(revision); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -249,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -277,7 +153,7 @@ public static WorkloadNetworkPortMirroringInner fromJson(JsonReader jsonReader) } else if ("type".equals(fieldName)) { deserializedWorkloadNetworkPortMirroringInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedWorkloadNetworkPortMirroringInner.innerProperties + deserializedWorkloadNetworkPortMirroringInner.properties = WorkloadNetworkPortMirroringProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedWorkloadNetworkPortMirroringInner.systemData = SystemData.fromJson(reader); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpInner.java index 4d657c9493b9..20994f5e77c0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,7 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIpProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIpProperties; import java.io.IOException; /** @@ -21,7 +21,7 @@ public final class WorkloadNetworkPublicIpInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private WorkloadNetworkPublicIpProperties innerProperties; + private WorkloadNetworkPublicIpProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -50,12 +50,23 @@ public WorkloadNetworkPublicIpInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private WorkloadNetworkPublicIpProperties innerProperties() { - return this.innerProperties; + public WorkloadNetworkPublicIpProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WorkloadNetworkPublicIpInner object itself. + */ + public WorkloadNetworkPublicIpInner withProperties(WorkloadNetworkPublicIpProperties properties) { + this.properties = properties; + return this; } /** @@ -97,78 +108,14 @@ public String id() { return this.id; } - /** - * Get the displayName property: Display name of the Public IP Block. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the Public IP Block. - * - * @param displayName the displayName value to set. - * @return the WorkloadNetworkPublicIpInner object itself. - */ - public WorkloadNetworkPublicIpInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkPublicIpProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the numberOfPublicIPs property: Number of Public IPs requested. - * - * @return the numberOfPublicIPs value. - */ - public Long numberOfPublicIPs() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfPublicIPs(); - } - - /** - * Set the numberOfPublicIPs property: Number of Public IPs requested. - * - * @param numberOfPublicIPs the numberOfPublicIPs value to set. - * @return the WorkloadNetworkPublicIpInner object itself. - */ - public WorkloadNetworkPublicIpInner withNumberOfPublicIPs(Long numberOfPublicIPs) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkPublicIpProperties(); - } - this.innerProperties().withNumberOfPublicIPs(numberOfPublicIPs); - return this; - } - - /** - * Get the publicIpBlock property: CIDR Block of the Public IP Block. - * - * @return the publicIpBlock value. - */ - public String publicIpBlock() { - return this.innerProperties() == null ? null : this.innerProperties().publicIpBlock(); - } - - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - public WorkloadNetworkPublicIpProvisioningState 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(); + if (properties() != null) { + properties().validate(); } } @@ -178,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -205,7 +152,7 @@ public static WorkloadNetworkPublicIpInner fromJson(JsonReader jsonReader) throw } else if ("type".equals(fieldName)) { deserializedWorkloadNetworkPublicIpInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedWorkloadNetworkPublicIpInner.innerProperties + deserializedWorkloadNetworkPublicIpInner.properties = WorkloadNetworkPublicIpProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedWorkloadNetworkPublicIpInner.systemData = SystemData.fromJson(reader); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java index 8bf0a43eaa6b..97d8a21abf5c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,12 +10,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.SegmentStatusEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentPortVif; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProvisioningState; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProperties; import java.io.IOException; -import java.util.List; /** * NSX Segment. @@ -25,7 +21,7 @@ public final class WorkloadNetworkSegmentInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private WorkloadNetworkSegmentProperties innerProperties; + private WorkloadNetworkSegmentProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -54,12 +50,23 @@ public WorkloadNetworkSegmentInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private WorkloadNetworkSegmentProperties innerProperties() { - return this.innerProperties; + public WorkloadNetworkSegmentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WorkloadNetworkSegmentInner object itself. + */ + public WorkloadNetworkSegmentInner withProperties(WorkloadNetworkSegmentProperties properties) { + this.properties = properties; + return this; } /** @@ -101,133 +108,14 @@ public String id() { return this.id; } - /** - * Get the displayName property: Display name of the segment. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the segment. - * - * @param displayName the displayName value to set. - * @return the WorkloadNetworkSegmentInner object itself. - */ - public WorkloadNetworkSegmentInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkSegmentProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the connectedGateway property: Gateway which to connect segment to. - * - * @return the connectedGateway value. - */ - public String connectedGateway() { - return this.innerProperties() == null ? null : this.innerProperties().connectedGateway(); - } - - /** - * Set the connectedGateway property: Gateway which to connect segment to. - * - * @param connectedGateway the connectedGateway value to set. - * @return the WorkloadNetworkSegmentInner object itself. - */ - public WorkloadNetworkSegmentInner withConnectedGateway(String connectedGateway) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkSegmentProperties(); - } - this.innerProperties().withConnectedGateway(connectedGateway); - return this; - } - - /** - * Get the subnet property: Subnet which to connect segment to. - * - * @return the subnet value. - */ - public WorkloadNetworkSegmentSubnet subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); - } - - /** - * Set the subnet property: Subnet which to connect segment to. - * - * @param subnet the subnet value to set. - * @return the WorkloadNetworkSegmentInner object itself. - */ - public WorkloadNetworkSegmentInner withSubnet(WorkloadNetworkSegmentSubnet subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkSegmentProperties(); - } - this.innerProperties().withSubnet(subnet); - return this; - } - - /** - * Get the portVif property: Port Vif which segment is associated with. - * - * @return the portVif value. - */ - public List portVif() { - return this.innerProperties() == null ? null : this.innerProperties().portVif(); - } - - /** - * Get the status property: Segment status. - * - * @return the status value. - */ - public SegmentStatusEnum status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - public WorkloadNetworkSegmentProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the revision property: NSX revision number. - * - * @return the revision value. - */ - public Long revision() { - return this.innerProperties() == null ? null : this.innerProperties().revision(); - } - - /** - * Set the revision property: NSX revision number. - * - * @param revision the revision value to set. - * @return the WorkloadNetworkSegmentInner object itself. - */ - public WorkloadNetworkSegmentInner withRevision(Long revision) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkSegmentProperties(); - } - this.innerProperties().withRevision(revision); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -237,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -264,7 +152,7 @@ public static WorkloadNetworkSegmentInner fromJson(JsonReader jsonReader) throws } else if ("type".equals(fieldName)) { deserializedWorkloadNetworkSegmentInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedWorkloadNetworkSegmentInner.innerProperties + deserializedWorkloadNetworkSegmentInner.properties = WorkloadNetworkSegmentProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedWorkloadNetworkSegmentInner.systemData = SystemData.fromJson(reader); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java index d490a50b19aa..8459e778f406 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; @@ -10,10 +10,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.VMGroupStatusEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProperties; import java.io.IOException; -import java.util.List; /** * NSX VM Group. @@ -23,7 +21,7 @@ public final class WorkloadNetworkVMGroupInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private WorkloadNetworkVMGroupProperties innerProperties; + private WorkloadNetworkVMGroupProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -52,12 +50,23 @@ public WorkloadNetworkVMGroupInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private WorkloadNetworkVMGroupProperties innerProperties() { - return this.innerProperties; + public WorkloadNetworkVMGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WorkloadNetworkVMGroupInner object itself. + */ + public WorkloadNetworkVMGroupInner withProperties(WorkloadNetworkVMGroupProperties properties) { + this.properties = properties; + return this; } /** @@ -99,101 +108,14 @@ public String id() { return this.id; } - /** - * Get the displayName property: Display name of the VM group. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the VM group. - * - * @param displayName the displayName value to set. - * @return the WorkloadNetworkVMGroupInner object itself. - */ - public WorkloadNetworkVMGroupInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkVMGroupProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the members property: Virtual machine members of this group. - * - * @return the members value. - */ - public List members() { - return this.innerProperties() == null ? null : this.innerProperties().members(); - } - - /** - * Set the members property: Virtual machine members of this group. - * - * @param members the members value to set. - * @return the WorkloadNetworkVMGroupInner object itself. - */ - public WorkloadNetworkVMGroupInner withMembers(List members) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkVMGroupProperties(); - } - this.innerProperties().withMembers(members); - return this; - } - - /** - * Get the status property: VM Group status. - * - * @return the status value. - */ - public VMGroupStatusEnum status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - public WorkloadNetworkVMGroupProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the revision property: NSX revision number. - * - * @return the revision value. - */ - public Long revision() { - return this.innerProperties() == null ? null : this.innerProperties().revision(); - } - - /** - * Set the revision property: NSX revision number. - * - * @param revision the revision value to set. - * @return the WorkloadNetworkVMGroupInner object itself. - */ - public WorkloadNetworkVMGroupInner withRevision(Long revision) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkVMGroupProperties(); - } - this.innerProperties().withRevision(revision); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -203,7 +125,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -230,7 +152,7 @@ public static WorkloadNetworkVMGroupInner fromJson(JsonReader jsonReader) throws } else if ("type".equals(fieldName)) { deserializedWorkloadNetworkVMGroupInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedWorkloadNetworkVMGroupInner.innerProperties + deserializedWorkloadNetworkVMGroupInner.properties = WorkloadNetworkVMGroupProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedWorkloadNetworkVMGroupInner.systemData = SystemData.fromJson(reader); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java index e3dd0a6dfdc7..80ff8bcee542 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java @@ -1,28 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.VMTypeEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachineProperties; import java.io.IOException; /** * NSX Virtual Machine. */ -@Fluent +@Immutable public final class WorkloadNetworkVirtualMachineInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private WorkloadNetworkVirtualMachineProperties innerProperties; + private WorkloadNetworkVirtualMachineProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -47,16 +46,16 @@ public final class WorkloadNetworkVirtualMachineInner extends ProxyResource { /** * Creates an instance of WorkloadNetworkVirtualMachineInner class. */ - public WorkloadNetworkVirtualMachineInner() { + private WorkloadNetworkVirtualMachineInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private WorkloadNetworkVirtualMachineProperties innerProperties() { - return this.innerProperties; + public WorkloadNetworkVirtualMachineProperties properties() { + return this.properties; } /** @@ -98,55 +97,14 @@ public String id() { return this.id; } - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public WorkloadNetworkProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the displayName property: Display name of the VM. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the VM. - * - * @param displayName the displayName value to set. - * @return the WorkloadNetworkVirtualMachineInner object itself. - */ - public WorkloadNetworkVirtualMachineInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkloadNetworkVirtualMachineProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the vmType property: Virtual machine type. - * - * @return the vmType value. - */ - public VMTypeEnum vmType() { - return this.innerProperties() == null ? null : this.innerProperties().vmType(); - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -156,7 +114,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -184,7 +142,7 @@ public static WorkloadNetworkVirtualMachineInner fromJson(JsonReader jsonReader) } else if ("type".equals(fieldName)) { deserializedWorkloadNetworkVirtualMachineInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedWorkloadNetworkVirtualMachineInner.innerProperties + deserializedWorkloadNetworkVirtualMachineInner.properties = WorkloadNetworkVirtualMachineProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedWorkloadNetworkVirtualMachineInner.systemData = SystemData.fromJson(reader); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/package-info.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/package-info.java index e4db28356c76..b69621f5a187 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/package-info.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for AvsClient. + * Package containing the inner data models for Avs. * Azure VMware Solution API. */ package com.azure.resourcemanager.avs.fluent.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/package-info.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/package-info.java index 8b4c79e23926..76ed4c3f53b0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/package-info.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for AvsClient. + * Package containing the service clients for Avs. * Azure VMware Solution API. */ package com.azure.resourcemanager.avs.fluent; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonImpl.java index 25e3dc35424c..ce51c86b1356 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java index ad4adc964f47..4a27262b600b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -27,13 +27,15 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.AddonsClient; import com.azure.resourcemanager.avs.fluent.models.AddonInner; -import com.azure.resourcemanager.avs.models.AddonList; +import com.azure.resourcemanager.avs.implementation.models.AddonList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -66,14 +68,24 @@ public final class AddonsClientImpl implements AddonsClient { * The interface defining all the services for AvsClientAddons to be used by the proxy service to perform REST * calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientAddons") public interface AddonsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, @@ -83,27 +95,57 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("addonName") String addonName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("addonName") String addonName, + @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("addonName") String addonName, - @BodyParam("application/json") AddonInner addon, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AddonInner addon, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("addonName") String addonName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AddonInner addon, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("addonName") String addonName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("addonName") String addonName, @@ -114,7 +156,14 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -160,39 +209,15 @@ private Mono> listSinglePageAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Addon list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Addon list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -203,12 +228,33 @@ private Mono> listSinglePageAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Addon list operation as paginated response with {@link PagedFlux}. + * @return the response of a Addon list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -220,12 +266,34 @@ private PagedFlux listAsync(String resourceGroupName, String private * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Addon list operation as paginated response with {@link PagedFlux}. + * @return the response of a Addon list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -240,7 +308,8 @@ private PagedFlux listAsync(String resourceGroupName, String private */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -256,7 +325,8 @@ public PagedIterable list(String resourceGroupName, String privateCl */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -299,46 +369,6 @@ private Mono> getWithResponseAsync(String resourceGroupName .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a Addon. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param addonName Name of the addon. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Addon along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, - String addonName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (addonName == null) { - return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, addonName, accept, context); - } - /** * Get a Addon. * @@ -371,7 +401,31 @@ private Mono getAsync(String resourceGroupName, String privateCloudN @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String addonName, Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, addonName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, addonName, accept, context); } /** @@ -429,11 +483,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { addon.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, addonName, addon, accept, - context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, addonName, contentType, accept, + addon, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -444,43 +499,46 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param addonName Name of the addon. * @param addon Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an addon resource along with {@link Response} on successful completion of {@link Mono}. + * @return an addon resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateCloudName, String addonName, AddonInner addon, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String addonName, AddonInner addon) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (addonName == null) { - return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); } if (addon == null) { - return Mono.error(new IllegalArgumentException("Parameter addon is required and cannot be null.")); + throw LOGGER.atError().log(new IllegalArgumentException("Parameter addon is required and cannot be null.")); } else { addon.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, addonName, addon, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, addonName, contentType, accept, addon, + Context.NONE); } /** @@ -490,18 +548,47 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param addonName Name of the addon. * @param addon Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an addon resource. + * @return an addon resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AddonInner> beginCreateOrUpdateAsync(String resourceGroupName, - String privateCloudName, String addonName, AddonInner addon) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, addonName, addon); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), AddonInner.class, - AddonInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String addonName, AddonInner addon, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + if (addon == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter addon is required and cannot be null.")); + } else { + addon.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, addonName, contentType, accept, addon, + context); } /** @@ -511,7 +598,6 @@ private PollerFlux, AddonInner> beginCreateOrUpdateAsync( * @param privateCloudName Name of the private cloud. * @param addonName Name of the addon. * @param addon Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -519,12 +605,11 @@ private PollerFlux, AddonInner> beginCreateOrUpdateAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AddonInner> beginCreateOrUpdateAsync(String resourceGroupName, - String privateCloudName, String addonName, AddonInner addon, Context context) { - context = this.client.mergeContext(context); + String privateCloudName, String addonName, AddonInner addon) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, addonName, addon, context); + = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, addonName, addon); return this.client.getLroResult(mono, this.client.getHttpPipeline(), AddonInner.class, - AddonInner.class, context); + AddonInner.class, this.client.getContext()); } /** @@ -542,7 +627,10 @@ private PollerFlux, AddonInner> beginCreateOrUpdateAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AddonInner> beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, addonName, addon); + return this.client.getLroResult(response, AddonInner.class, AddonInner.class, + Context.NONE); } /** @@ -561,8 +649,9 @@ public SyncPoller, AddonInner> beginCreateOrUpdate(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AddonInner> beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, addonName, addon, context); + return this.client.getLroResult(response, AddonInner.class, AddonInner.class, context); } /** @@ -584,26 +673,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, String pr .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a Addon. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param addonName Name of the addon. - * @param addon Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an addon resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String privateCloudName, String addonName, - AddonInner addon, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Create a Addon. * @@ -619,7 +688,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String pr @ServiceMethod(returns = ReturnType.SINGLE) public AddonInner createOrUpdate(String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, addonName, addon).getFinalResult(); } /** @@ -638,7 +707,7 @@ public AddonInner createOrUpdate(String resourceGroupName, String privateCloudNa @ServiceMethod(returns = ReturnType.SINGLE) public AddonInner createOrUpdate(String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon, context).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, addonName, addon, context).getFinalResult(); } /** @@ -687,38 +756,39 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param addonName Name of the addon. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, - String addonName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String addonName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (addonName == null) { - return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, addonName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, addonName, accept, Context.NONE); } /** @@ -727,17 +797,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param addonName Name of the addon. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String addonName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateCloudName, addonName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String addonName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, addonName, accept, context); } /** @@ -746,7 +839,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param addonName Name of the addon. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -754,12 +846,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String addonName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, addonName, context); + String addonName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateCloudName, addonName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -776,7 +866,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String addonName) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, addonName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, privateCloudName, addonName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -794,7 +885,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String addonName, Context context) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, addonName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, privateCloudName, addonName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -814,25 +906,6 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a Addon. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param addonName Name of the addon. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 privateCloudName, String addonName, - Context context) { - return beginDeleteAsync(resourceGroupName, privateCloudName, addonName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a Addon. * @@ -845,7 +918,7 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String addonName) { - deleteAsync(resourceGroupName, privateCloudName, addonName).block(); + beginDelete(resourceGroupName, privateCloudName, addonName).getFinalResult(); } /** @@ -861,7 +934,7 @@ public void delete(String resourceGroupName, String privateCloudName, String add */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String addonName, Context context) { - deleteAsync(resourceGroupName, privateCloudName, addonName, context).block(); + beginDelete(resourceGroupName, privateCloudName, addonName, context).getFinalResult(); } /** @@ -890,6 +963,32 @@ private Mono> listNextSinglePageAsync(String nextLink) .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Addon list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -898,22 +997,24 @@ private Mono> listNextSinglePageAsync(String nextLink) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Addon list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Addon list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(AddonsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsImpl.java index cb695b25b924..9f24e290c0cd 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AdminCredentialsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AdminCredentialsImpl.java index 72430f2f6c48..eb17c72e74b4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AdminCredentialsImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AdminCredentialsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsClientImpl.java index 7d2610cb9246..6bc2186ffe2a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -27,13 +27,15 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.AuthorizationsClient; import com.azure.resourcemanager.avs.fluent.models.ExpressRouteAuthorizationInner; -import com.azure.resourcemanager.avs.models.ExpressRouteAuthorizationList; +import com.azure.resourcemanager.avs.implementation.models.ExpressRouteAuthorizationList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,14 +69,24 @@ public final class AuthorizationsClientImpl implements AuthorizationsClient { * The interface defining all the services for AvsClientAuthorizations to be used by the proxy service to perform * REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientAuthorizati") public interface AuthorizationsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, @@ -84,7 +96,7 @@ Mono> list(@HostParam("$host") String en @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @@ -92,22 +104,54 @@ Mono> get(@HostParam("$host") String en Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("authorizationName") String authorizationName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, - @PathParam("authorizationName") String authorizationName, - @BodyParam("application/json") ExpressRouteAuthorizationInner authorization, - @HeaderParam("Accept") String accept, Context context); + @PathParam("authorizationName") String authorizationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExpressRouteAuthorizationInner authorization, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("authorizationName") String authorizationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExpressRouteAuthorizationInner authorization, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("authorizationName") String authorizationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @@ -119,7 +163,15 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -167,39 +219,15 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ExpressRouteAuthorization list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a ExpressRouteAuthorization list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -210,12 +238,35 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ExpressRouteAuthorization list operation as paginated response with {@link PagedFlux}. + * @return the response of a ExpressRouteAuthorization list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -227,13 +278,35 @@ private PagedFlux listAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ExpressRouteAuthorization list operation as paginated response with {@link PagedFlux}. + * @return the response of a ExpressRouteAuthorization list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -249,7 +322,8 @@ private PagedFlux listAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -267,7 +341,8 @@ public PagedIterable list(String resourceGroupNa @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -310,47 +385,6 @@ private Mono> getWithResponseAsync(Stri .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a ExpressRouteAuthorization. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param authorizationName Name of the ExpressRoute Circuit Authorization. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 ExpressRouteAuthorization along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String privateCloudName, String authorizationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (authorizationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, authorizationName, accept, context); - } - /** * Get a ExpressRouteAuthorization. * @@ -384,7 +418,31 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String authorizationName, Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, authorizationName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, authorizationName, accept, context); } /** @@ -444,11 +502,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { authorization.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, authorization, - accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, contentType, + accept, authorization, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -459,46 +518,47 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param authorizationName Name of the ExpressRoute Circuit Authorization. * @param authorization Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Circuit Authorization along with {@link Response} on successful completion of {@link Mono}. + * @return expressRoute Circuit Authorization along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateCloudName, String authorizationName, ExpressRouteAuthorizationInner authorization, - Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String authorizationName, ExpressRouteAuthorizationInner authorization) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (authorizationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); } if (authorization == null) { - return Mono.error(new IllegalArgumentException("Parameter authorization is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorization is required and cannot be null.")); } else { authorization.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, authorization, - accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, contentType, + accept, authorization, Context.NONE); } /** @@ -508,20 +568,48 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param authorizationName Name of the ExpressRoute Circuit Authorization. * @param authorization Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of expressRoute Circuit Authorization. + * @return expressRoute Circuit Authorization along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ExpressRouteAuthorizationInner> - beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String authorizationName, - ExpressRouteAuthorizationInner authorization) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, authorizationName, authorization); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ExpressRouteAuthorizationInner.class, ExpressRouteAuthorizationInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String authorizationName, ExpressRouteAuthorizationInner authorization, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + if (authorization == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorization is required and cannot be null.")); + } else { + authorization.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, contentType, + accept, authorization, context); } /** @@ -531,7 +619,6 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param authorizationName Name of the ExpressRoute Circuit Authorization. * @param authorization Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -540,13 +627,12 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ExpressRouteAuthorizationInner> beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String authorizationName, - ExpressRouteAuthorizationInner authorization, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, - authorizationName, authorization, context); + ExpressRouteAuthorizationInner authorization) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, authorizationName, authorization); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ExpressRouteAuthorizationInner.class, ExpressRouteAuthorizationInner.class, - context); + this.client.getContext()); } /** @@ -565,8 +651,10 @@ private Mono>> createOrUpdateWithResponseAsync(String public SyncPoller, ExpressRouteAuthorizationInner> beginCreateOrUpdate( String resourceGroupName, String privateCloudName, String authorizationName, ExpressRouteAuthorizationInner authorization) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, authorizationName, authorization); + return this.client.getLroResult(response, + ExpressRouteAuthorizationInner.class, ExpressRouteAuthorizationInner.class, Context.NONE); } /** @@ -586,9 +674,10 @@ public SyncPoller, ExpressRouteAuthor public SyncPoller, ExpressRouteAuthorizationInner> beginCreateOrUpdate( String resourceGroupName, String privateCloudName, String authorizationName, ExpressRouteAuthorizationInner authorization, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization, context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, privateCloudName, + authorizationName, authorization, context); + return this.client.getLroResult(response, + ExpressRouteAuthorizationInner.class, ExpressRouteAuthorizationInner.class, context); } /** @@ -610,27 +699,6 @@ private Mono createOrUpdateAsync(String resource .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a ExpressRouteAuthorization. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param authorizationName Name of the ExpressRoute Circuit Authorization. - * @param authorization Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return expressRoute Circuit Authorization on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String privateCloudName, - String authorizationName, ExpressRouteAuthorizationInner authorization, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Create a ExpressRouteAuthorization. * @@ -646,7 +714,8 @@ private Mono createOrUpdateAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) public ExpressRouteAuthorizationInner createOrUpdate(String resourceGroupName, String privateCloudName, String authorizationName, ExpressRouteAuthorizationInner authorization) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, authorizationName, authorization) + .getFinalResult(); } /** @@ -665,8 +734,8 @@ public ExpressRouteAuthorizationInner createOrUpdate(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public ExpressRouteAuthorizationInner createOrUpdate(String resourceGroupName, String privateCloudName, String authorizationName, ExpressRouteAuthorizationInner authorization, Context context) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization, context) - .block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, authorizationName, authorization, context) + .getFinalResult(); } /** @@ -715,39 +784,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param authorizationName Name of the ExpressRoute Circuit Authorization. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, - String authorizationName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String authorizationName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (authorizationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, authorizationName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, accept, + Context.NONE); } /** @@ -756,18 +826,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param authorizationName Name of the ExpressRoute Circuit Authorization. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String authorizationName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, authorizationName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String authorizationName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, accept, context); } /** @@ -776,7 +868,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param authorizationName Name of the ExpressRoute Circuit Authorization. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -784,12 +875,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String authorizationName, Context context) { - context = this.client.mergeContext(context); + String authorizationName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, authorizationName, context); + = deleteWithResponseAsync(resourceGroupName, privateCloudName, authorizationName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -806,7 +896,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String authorizationName) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, authorizationName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, privateCloudName, authorizationName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -824,7 +915,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String authorizationName, Context context) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, authorizationName, context).getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, privateCloudName, authorizationName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -844,25 +937,6 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a ExpressRouteAuthorization. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param authorizationName Name of the ExpressRoute Circuit Authorization. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 privateCloudName, String authorizationName, - Context context) { - return beginDeleteAsync(resourceGroupName, privateCloudName, authorizationName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a ExpressRouteAuthorization. * @@ -875,7 +949,7 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String authorizationName) { - deleteAsync(resourceGroupName, privateCloudName, authorizationName).block(); + beginDelete(resourceGroupName, privateCloudName, authorizationName).getFinalResult(); } /** @@ -891,7 +965,7 @@ public void delete(String resourceGroupName, String privateCloudName, String aut */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String authorizationName, Context context) { - deleteAsync(resourceGroupName, privateCloudName, authorizationName, context).block(); + beginDelete(resourceGroupName, privateCloudName, authorizationName, context).getFinalResult(); } /** @@ -920,6 +994,33 @@ private Mono> listNextSinglePageAs .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExpressRouteAuthorization list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -928,23 +1029,25 @@ private Mono> listNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ExpressRouteAuthorization list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a ExpressRouteAuthorization list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(AuthorizationsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsImpl.java index 8c94f4de85a1..20d393d5a570 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientBuilder.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientBuilder.java index 73199a2e75a0..707ba6083c95 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientBuilder.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { AvsClientImpl.class }) public final class AvsClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the AvsClientBuilder. */ - public AvsClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public AvsClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the AvsClientBuilder. */ - public AvsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public AvsClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public AvsClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); AvsClientImpl client = new AvsClientImpl(localPipeline, localSerializerAdapter, localDefaultPollInterval, - localEnvironment, this.subscriptionId, localEndpoint); + localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java index 57bbc45c1895..6cbe4a34c208 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -13,14 +13,17 @@ 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.PollerFactory; import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; 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.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.avs.fluent.AddonsClient; @@ -31,14 +34,17 @@ import com.azure.resourcemanager.avs.fluent.DatastoresClient; import com.azure.resourcemanager.avs.fluent.GlobalReachConnectionsClient; import com.azure.resourcemanager.avs.fluent.HcxEnterpriseSitesClient; +import com.azure.resourcemanager.avs.fluent.HostsClient; import com.azure.resourcemanager.avs.fluent.IscsiPathsClient; import com.azure.resourcemanager.avs.fluent.LocationsClient; import com.azure.resourcemanager.avs.fluent.OperationsClient; import com.azure.resourcemanager.avs.fluent.PlacementPoliciesClient; import com.azure.resourcemanager.avs.fluent.PrivateCloudsClient; +import com.azure.resourcemanager.avs.fluent.ProvisionedNetworksClient; import com.azure.resourcemanager.avs.fluent.ScriptCmdletsClient; import com.azure.resourcemanager.avs.fluent.ScriptExecutionsClient; import com.azure.resourcemanager.avs.fluent.ScriptPackagesClient; +import com.azure.resourcemanager.avs.fluent.SkusClient; import com.azure.resourcemanager.avs.fluent.VirtualMachinesClient; import com.azure.resourcemanager.avs.fluent.WorkloadNetworksClient; import java.io.IOException; @@ -56,26 +62,12 @@ @ServiceClient(builder = AvsClientBuilder.class) public final class AvsClientImpl implements AvsClient { /** - * The ID of the target subscription. The value must be an UUID. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -84,12 +76,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -97,6 +89,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -139,6 +145,20 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** + * The WorkloadNetworksClient object to access its operations. + */ + private final WorkloadNetworksClient workloadNetworks; + + /** + * Gets the WorkloadNetworksClient object to access its operations. + * + * @return the WorkloadNetworksClient object. + */ + public WorkloadNetworksClient getWorkloadNetworks() { + return this.workloadNetworks; + } + /** * The OperationsClient object to access its operations. */ @@ -182,17 +202,45 @@ public PrivateCloudsClient getPrivateClouds() { } /** - * The AddonsClient object to access its operations. + * The ClustersClient object to access its operations. */ - private final AddonsClient addons; + private final ClustersClient clusters; /** - * Gets the AddonsClient object to access its operations. + * Gets the ClustersClient object to access its operations. * - * @return the AddonsClient object. + * @return the ClustersClient object. */ - public AddonsClient getAddons() { - return this.addons; + public ClustersClient getClusters() { + return this.clusters; + } + + /** + * The DatastoresClient object to access its operations. + */ + private final DatastoresClient datastores; + + /** + * Gets the DatastoresClient object to access its operations. + * + * @return the DatastoresClient object. + */ + public DatastoresClient getDatastores() { + return this.datastores; + } + + /** + * The HcxEnterpriseSitesClient object to access its operations. + */ + private final HcxEnterpriseSitesClient hcxEnterpriseSites; + + /** + * Gets the HcxEnterpriseSitesClient object to access its operations. + * + * @return the HcxEnterpriseSitesClient object. + */ + public HcxEnterpriseSitesClient getHcxEnterpriseSites() { + return this.hcxEnterpriseSites; } /** @@ -209,6 +257,20 @@ public AuthorizationsClient getAuthorizations() { return this.authorizations; } + /** + * The GlobalReachConnectionsClient object to access its operations. + */ + private final GlobalReachConnectionsClient globalReachConnections; + + /** + * Gets the GlobalReachConnectionsClient object to access its operations. + * + * @return the GlobalReachConnectionsClient object. + */ + public GlobalReachConnectionsClient getGlobalReachConnections() { + return this.globalReachConnections; + } + /** * The CloudLinksClient object to access its operations. */ @@ -224,31 +286,31 @@ public CloudLinksClient getCloudLinks() { } /** - * The ClustersClient object to access its operations. + * The AddonsClient object to access its operations. */ - private final ClustersClient clusters; + private final AddonsClient addons; /** - * Gets the ClustersClient object to access its operations. + * Gets the AddonsClient object to access its operations. * - * @return the ClustersClient object. + * @return the AddonsClient object. */ - public ClustersClient getClusters() { - return this.clusters; + public AddonsClient getAddons() { + return this.addons; } /** - * The DatastoresClient object to access its operations. + * The VirtualMachinesClient object to access its operations. */ - private final DatastoresClient datastores; + private final VirtualMachinesClient virtualMachines; /** - * Gets the DatastoresClient object to access its operations. + * Gets the VirtualMachinesClient object to access its operations. * - * @return the DatastoresClient object. + * @return the VirtualMachinesClient object. */ - public DatastoresClient getDatastores() { - return this.datastores; + public VirtualMachinesClient getVirtualMachines() { + return this.virtualMachines; } /** @@ -266,45 +328,45 @@ public PlacementPoliciesClient getPlacementPolicies() { } /** - * The VirtualMachinesClient object to access its operations. + * The ScriptPackagesClient object to access its operations. */ - private final VirtualMachinesClient virtualMachines; + private final ScriptPackagesClient scriptPackages; /** - * Gets the VirtualMachinesClient object to access its operations. + * Gets the ScriptPackagesClient object to access its operations. * - * @return the VirtualMachinesClient object. + * @return the ScriptPackagesClient object. */ - public VirtualMachinesClient getVirtualMachines() { - return this.virtualMachines; + public ScriptPackagesClient getScriptPackages() { + return this.scriptPackages; } /** - * The GlobalReachConnectionsClient object to access its operations. + * The ScriptCmdletsClient object to access its operations. */ - private final GlobalReachConnectionsClient globalReachConnections; + private final ScriptCmdletsClient scriptCmdlets; /** - * Gets the GlobalReachConnectionsClient object to access its operations. + * Gets the ScriptCmdletsClient object to access its operations. * - * @return the GlobalReachConnectionsClient object. + * @return the ScriptCmdletsClient object. */ - public GlobalReachConnectionsClient getGlobalReachConnections() { - return this.globalReachConnections; + public ScriptCmdletsClient getScriptCmdlets() { + return this.scriptCmdlets; } /** - * The HcxEnterpriseSitesClient object to access its operations. + * The ScriptExecutionsClient object to access its operations. */ - private final HcxEnterpriseSitesClient hcxEnterpriseSites; + private final ScriptExecutionsClient scriptExecutions; /** - * Gets the HcxEnterpriseSitesClient object to access its operations. + * Gets the ScriptExecutionsClient object to access its operations. * - * @return the HcxEnterpriseSitesClient object. + * @return the ScriptExecutionsClient object. */ - public HcxEnterpriseSitesClient getHcxEnterpriseSites() { - return this.hcxEnterpriseSites; + public ScriptExecutionsClient getScriptExecutions() { + return this.scriptExecutions; } /** @@ -322,59 +384,45 @@ public IscsiPathsClient getIscsiPaths() { } /** - * The ScriptExecutionsClient object to access its operations. + * The HostsClient object to access its operations. */ - private final ScriptExecutionsClient scriptExecutions; + private final HostsClient hosts; /** - * Gets the ScriptExecutionsClient object to access its operations. + * Gets the HostsClient object to access its operations. * - * @return the ScriptExecutionsClient object. + * @return the HostsClient object. */ - public ScriptExecutionsClient getScriptExecutions() { - return this.scriptExecutions; + public HostsClient getHosts() { + return this.hosts; } /** - * The ScriptPackagesClient object to access its operations. + * The ProvisionedNetworksClient object to access its operations. */ - private final ScriptPackagesClient scriptPackages; + private final ProvisionedNetworksClient provisionedNetworks; /** - * Gets the ScriptPackagesClient object to access its operations. + * Gets the ProvisionedNetworksClient object to access its operations. * - * @return the ScriptPackagesClient object. - */ - public ScriptPackagesClient getScriptPackages() { - return this.scriptPackages; - } - - /** - * The ScriptCmdletsClient object to access its operations. - */ - private final ScriptCmdletsClient scriptCmdlets; - - /** - * Gets the ScriptCmdletsClient object to access its operations. - * - * @return the ScriptCmdletsClient object. + * @return the ProvisionedNetworksClient object. */ - public ScriptCmdletsClient getScriptCmdlets() { - return this.scriptCmdlets; + public ProvisionedNetworksClient getProvisionedNetworks() { + return this.provisionedNetworks; } /** - * The WorkloadNetworksClient object to access its operations. + * The SkusClient object to access its operations. */ - private final WorkloadNetworksClient workloadNetworks; + private final SkusClient skus; /** - * Gets the WorkloadNetworksClient object to access its operations. + * Gets the SkusClient object to access its operations. * - * @return the WorkloadNetworksClient object. + * @return the SkusClient object. */ - public WorkloadNetworksClient getWorkloadNetworks() { - return this.workloadNetworks; + public SkusClient getSkus() { + return this.skus; } /** @@ -384,34 +432,37 @@ public WorkloadNetworksClient getWorkloadNetworks() { * @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 endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param endpoint server parameter. */ AvsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String subscriptionId, String endpoint) { + AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-09-01"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2024-09-01"; + this.workloadNetworks = new WorkloadNetworksClientImpl(this); this.operations = new OperationsClientImpl(this); this.locations = new LocationsClientImpl(this); this.privateClouds = new PrivateCloudsClientImpl(this); - this.addons = new AddonsClientImpl(this); - this.authorizations = new AuthorizationsClientImpl(this); - this.cloudLinks = new CloudLinksClientImpl(this); this.clusters = new ClustersClientImpl(this); this.datastores = new DatastoresClientImpl(this); - this.placementPolicies = new PlacementPoliciesClientImpl(this); - this.virtualMachines = new VirtualMachinesClientImpl(this); - this.globalReachConnections = new GlobalReachConnectionsClientImpl(this); this.hcxEnterpriseSites = new HcxEnterpriseSitesClientImpl(this); - this.iscsiPaths = new IscsiPathsClientImpl(this); - this.scriptExecutions = new ScriptExecutionsClientImpl(this); + this.authorizations = new AuthorizationsClientImpl(this); + this.globalReachConnections = new GlobalReachConnectionsClientImpl(this); + this.cloudLinks = new CloudLinksClientImpl(this); + this.addons = new AddonsClientImpl(this); + this.virtualMachines = new VirtualMachinesClientImpl(this); + this.placementPolicies = new PlacementPoliciesClientImpl(this); this.scriptPackages = new ScriptPackagesClientImpl(this); this.scriptCmdlets = new ScriptCmdletsClientImpl(this); - this.workloadNetworks = new WorkloadNetworksClientImpl(this); + this.scriptExecutions = new ScriptExecutionsClientImpl(this); + this.iscsiPaths = new IscsiPathsClientImpl(this); + this.hosts = new HostsClientImpl(this); + this.provisionedNetworks = new ProvisionedNetworksClientImpl(this); + this.skus = new SkusClientImpl(this); } /** @@ -451,6 +502,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinkImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinkImpl.java index b67fe90ef706..2c1ba35e7c5b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinkImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinkImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -8,8 +8,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.CloudLinkInner; import com.azure.resourcemanager.avs.models.CloudLink; -import com.azure.resourcemanager.avs.models.CloudLinkProvisioningState; -import com.azure.resourcemanager.avs.models.CloudLinkStatus; +import com.azure.resourcemanager.avs.models.CloudLinkProperties; public final class CloudLinkImpl implements CloudLink, CloudLink.Definition, CloudLink.Update { private CloudLinkInner innerObject; @@ -28,20 +27,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public CloudLinkProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public CloudLinkProperties properties() { + return this.innerModel().properties(); } - public CloudLinkStatus status() { - return this.innerModel().status(); - } - - public String linkedCloud() { - return this.innerModel().linkedCloud(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -130,8 +121,8 @@ public CloudLink refresh(Context context) { return this; } - public CloudLinkImpl withLinkedCloud(String linkedCloud) { - this.innerModel().withLinkedCloud(linkedCloud); + public CloudLinkImpl withProperties(CloudLinkProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksClientImpl.java index 46858d1e2888..afc2ca9376e9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -27,13 +27,15 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.CloudLinksClient; import com.azure.resourcemanager.avs.fluent.models.CloudLinkInner; -import com.azure.resourcemanager.avs.models.CloudLinkList; +import com.azure.resourcemanager.avs.implementation.models.CloudLinkList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,14 +69,24 @@ public final class CloudLinksClientImpl implements CloudLinksClient { * The interface defining all the services for AvsClientCloudLinks to be used by the proxy service to perform REST * calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientCloudLinks") public interface CloudLinksService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, @@ -84,28 +96,57 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("cloudLinkName") String cloudLinkName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("cloudLinkName") String cloudLinkName, + @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("cloudLinkName") String cloudLinkName, - @BodyParam("application/json") CloudLinkInner cloudLink, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CloudLinkInner cloudLink, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("cloudLinkName") String cloudLinkName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CloudLinkInner cloudLink, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("cloudLinkName") String cloudLinkName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("cloudLinkName") String cloudLinkName, @@ -116,7 +157,14 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -162,39 +210,15 @@ private Mono> listSinglePageAsync(String resourceG * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a CloudLink list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a CloudLink list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -205,12 +229,33 @@ private Mono> listSinglePageAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a CloudLink list operation as paginated response with {@link PagedFlux}. + * @return the response of a CloudLink list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -222,12 +267,34 @@ private PagedFlux listAsync(String resourceGroupName, String pri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a CloudLink list operation as paginated response with {@link PagedFlux}. + * @return the response of a CloudLink list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -242,7 +309,8 @@ private PagedFlux listAsync(String resourceGroupName, String pri */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -258,7 +326,8 @@ public PagedIterable list(String resourceGroupName, String priva */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -301,46 +370,6 @@ private Mono> getWithResponseAsync(String resourceGroup .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a CloudLink. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param cloudLinkName Name of the cloud link. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 CloudLink along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, - String cloudLinkName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (cloudLinkName == null) { - return Mono.error(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, cloudLinkName, accept, context); - } - /** * Get a CloudLink. * @@ -373,7 +402,31 @@ private Mono getAsync(String resourceGroupName, String privateCl @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String cloudLinkName, Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, cloudLinkName, accept, context); } /** @@ -431,11 +484,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { cloudLink.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, cloudLinkName, cloudLink, accept, - context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, cloudLinkName, contentType, + accept, cloudLink, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -446,44 +500,47 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param cloudLinkName Name of the cloud link. * @param cloudLink Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 cloud link resource along with {@link Response} on successful completion of {@link Mono}. + * @return a cloud link resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String cloudLinkName, CloudLinkInner cloudLink) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (cloudLinkName == null) { - return Mono.error(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); } if (cloudLink == null) { - return Mono.error(new IllegalArgumentException("Parameter cloudLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLink is required and cannot be null.")); } else { cloudLink.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, cloudLinkName, cloudLink, accept, - context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, cloudLinkName, contentType, accept, + cloudLink, Context.NONE); } /** @@ -493,18 +550,48 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param cloudLinkName Name of the cloud link. * @param cloudLink Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a cloud link resource. + * @return a cloud link resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CloudLinkInner> beginCreateOrUpdateAsync(String resourceGroupName, - String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CloudLinkInner.class, CloudLinkInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String cloudLinkName, CloudLinkInner cloudLink, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } + if (cloudLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLink is required and cannot be null.")); + } else { + cloudLink.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, cloudLinkName, contentType, accept, + cloudLink, context); } /** @@ -514,7 +601,6 @@ private PollerFlux, CloudLinkInner> beginCreateOrUpda * @param privateCloudName Name of the private cloud. * @param cloudLinkName Name of the cloud link. * @param cloudLink Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -522,12 +608,11 @@ private PollerFlux, CloudLinkInner> beginCreateOrUpda */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CloudLinkInner> beginCreateOrUpdateAsync(String resourceGroupName, - String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink, Context context) { - context = this.client.mergeContext(context); + String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink, context); + = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CloudLinkInner.class, CloudLinkInner.class, context); + CloudLinkInner.class, CloudLinkInner.class, this.client.getContext()); } /** @@ -545,8 +630,10 @@ private PollerFlux, CloudLinkInner> beginCreateOrUpda @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CloudLinkInner> beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, cloudLinkName, cloudLink); + return this.client.getLroResult(response, CloudLinkInner.class, + CloudLinkInner.class, Context.NONE); } /** @@ -565,8 +652,10 @@ public SyncPoller, CloudLinkInner> beginCreateOrUpdat @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CloudLinkInner> beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, cloudLinkName, cloudLink, context); + return this.client.getLroResult(response, CloudLinkInner.class, + CloudLinkInner.class, context); } /** @@ -588,26 +677,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a CloudLink. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param cloudLinkName Name of the cloud link. - * @param cloudLink Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 cloud link resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String privateCloudName, - String cloudLinkName, CloudLinkInner cloudLink, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Create a CloudLink. * @@ -623,7 +692,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) public CloudLinkInner createOrUpdate(String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, cloudLinkName, cloudLink).getFinalResult(); } /** @@ -642,7 +711,8 @@ public CloudLinkInner createOrUpdate(String resourceGroupName, String privateClo @ServiceMethod(returns = ReturnType.SINGLE) public CloudLinkInner createOrUpdate(String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink, Context context) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink, context).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, cloudLinkName, cloudLink, context) + .getFinalResult(); } /** @@ -691,38 +761,39 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param cloudLinkName Name of the cloud link. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, - String cloudLinkName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String cloudLinkName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (cloudLinkName == null) { - return Mono.error(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, cloudLinkName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, cloudLinkName, accept, Context.NONE); } /** @@ -731,18 +802,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param cloudLinkName Name of the cloud link. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String cloudLinkName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String cloudLinkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, cloudLinkName, accept, context); } /** @@ -751,7 +844,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param cloudLinkName Name of the cloud link. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -759,12 +851,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String cloudLinkName, Context context) { - context = this.client.mergeContext(context); + String cloudLinkName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName, context); + = deleteWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -781,7 +872,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String cloudLinkName) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, cloudLinkName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, privateCloudName, cloudLinkName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -799,7 +891,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String cloudLinkName, Context context) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, cloudLinkName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, privateCloudName, cloudLinkName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -819,25 +912,6 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a CloudLink. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param cloudLinkName Name of the cloud link. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 privateCloudName, String cloudLinkName, - Context context) { - return beginDeleteAsync(resourceGroupName, privateCloudName, cloudLinkName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a CloudLink. * @@ -850,7 +924,7 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String cloudLinkName) { - deleteAsync(resourceGroupName, privateCloudName, cloudLinkName).block(); + beginDelete(resourceGroupName, privateCloudName, cloudLinkName).getFinalResult(); } /** @@ -866,7 +940,7 @@ public void delete(String resourceGroupName, String privateCloudName, String clo */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String cloudLinkName, Context context) { - deleteAsync(resourceGroupName, privateCloudName, cloudLinkName, context).block(); + beginDelete(resourceGroupName, privateCloudName, cloudLinkName, context).getFinalResult(); } /** @@ -895,6 +969,32 @@ private Mono> listNextSinglePageAsync(String nextL .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudLink list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -903,22 +1003,24 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a CloudLink list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a CloudLink list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(CloudLinksClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksImpl.java index 19d66b038bed..16f1190aa18e 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClusterImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClusterImpl.java index da07764b672d..d0473d94369b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClusterImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClusterImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -9,11 +9,10 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.ClusterInner; import com.azure.resourcemanager.avs.models.Cluster; -import com.azure.resourcemanager.avs.models.ClusterProvisioningState; +import com.azure.resourcemanager.avs.models.ClusterProperties; import com.azure.resourcemanager.avs.models.ClusterUpdate; import com.azure.resourcemanager.avs.models.ClusterZoneList; import com.azure.resourcemanager.avs.models.Sku; -import java.util.Collections; import java.util.List; public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { @@ -33,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public ClusterProperties properties() { + return this.innerModel().properties(); + } + public Sku sku() { return this.innerModel().sku(); } @@ -41,31 +44,6 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public Integer clusterSize() { - return this.innerModel().clusterSize(); - } - - public ClusterProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public Integer clusterId() { - return this.innerModel().clusterId(); - } - - public List hosts() { - List inner = this.innerModel().hosts(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String vsanDatastoreName() { - return this.innerModel().vsanDatastoreName(); - } - public String resourceGroupName() { return resourceGroupName; } @@ -174,28 +152,18 @@ public ClusterImpl withSku(Sku sku) { } } - public ClusterImpl withClusterSize(Integer clusterSize) { - if (isInCreateMode()) { - this.innerModel().withClusterSize(clusterSize); - return this; - } else { - this.updateClusterUpdate.withClusterSize(clusterSize); - return this; - } + public ClusterImpl withProperties(ClusterProperties properties) { + this.innerModel().withProperties(properties); + return this; } - public ClusterImpl withHosts(List hosts) { - if (isInCreateMode()) { - this.innerModel().withHosts(hosts); - return this; - } else { - this.updateClusterUpdate.withHosts(hosts); - return this; - } + public ClusterImpl withClusterSize(Integer clusterSize) { + this.updateClusterUpdate.withClusterSize(clusterSize); + return this; } - public ClusterImpl withVsanDatastoreName(String vsanDatastoreName) { - this.innerModel().withVsanDatastoreName(vsanDatastoreName); + public ClusterImpl withHosts(List hosts) { + this.updateClusterUpdate.withHosts(hosts); return this; } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClusterZoneListImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClusterZoneListImpl.java index 7c77d52c280f..ce644b168f91 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClusterZoneListImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClusterZoneListImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersClientImpl.java index 20a4cd159159..f91a9556790d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -29,14 +29,16 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.ClustersClient; import com.azure.resourcemanager.avs.fluent.models.ClusterInner; import com.azure.resourcemanager.avs.fluent.models.ClusterZoneListInner; -import com.azure.resourcemanager.avs.models.ClusterList; +import com.azure.resourcemanager.avs.implementation.models.ClusterList; import com.azure.resourcemanager.avs.models.ClusterUpdate; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -70,14 +72,24 @@ public final class ClustersClientImpl implements ClustersClient { * The interface defining all the services for AvsClientClusters to be used by the proxy service to perform REST * calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientClusters") public interface ClustersService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, @@ -87,38 +99,77 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, - @BodyParam("application/json") ClusterInner cluster, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterInner cluster, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterInner cluster, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, - @BodyParam("application/json") ClusterUpdate clusterUpdate, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterUpdate clusterUpdate, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterUpdate clusterUpdate, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @@ -128,7 +179,17 @@ Mono>> delete(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/listZones") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listZones(@HostParam("$host") String endpoint, + Mono> listZones(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/listZones") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listZonesSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @@ -139,7 +200,14 @@ Mono> listZones(@HostParam("$host") String endpoi @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -185,39 +253,15 @@ private Mono> listSinglePageAsync(String resourceGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Cluster list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Cluster list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -228,12 +272,33 @@ private Mono> listSinglePageAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Cluster list operation as paginated response with {@link PagedFlux}. + * @return the response of a Cluster list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -245,12 +310,34 @@ private PagedFlux listAsync(String resourceGroupName, String priva * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Cluster list operation as paginated response with {@link PagedFlux}. + * @return the response of a Cluster list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -265,7 +352,8 @@ private PagedFlux listAsync(String resourceGroupName, String priva */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -281,7 +369,8 @@ public PagedIterable list(String resourceGroupName, String private */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -324,46 +413,6 @@ private Mono> getWithResponseAsync(String resourceGroupNa .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Cluster along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, clusterName, accept, context); - } - /** * Get a Cluster. * @@ -396,7 +445,31 @@ private Mono getAsync(String resourceGroupName, String privateClou @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String clusterName, Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, clusterName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, clusterName, accept, context); } /** @@ -454,11 +527,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { cluster.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, cluster, accept, - context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, contentType, accept, + cluster, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -469,44 +543,47 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param cluster Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 cluster resource along with {@link Response} on successful completion of {@link Mono}. + * @return a cluster resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateCloudName, String clusterName, ClusterInner cluster, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, ClusterInner cluster) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (cluster == null) { - return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); } else { cluster.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, cluster, accept, - context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, contentType, accept, + cluster, Context.NONE); } /** @@ -516,18 +593,48 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param cluster Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a cluster resource. + * @return a cluster resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, - String privateCloudName, String clusterName, ClusterInner cluster) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, ClusterInner cluster, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (cluster == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + } else { + cluster.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, contentType, accept, + cluster, context); } /** @@ -537,7 +644,6 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param cluster Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -545,12 +651,11 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, - String privateCloudName, String clusterName, ClusterInner cluster, Context context) { - context = this.client.mergeContext(context); + String privateCloudName, String clusterName, ClusterInner cluster) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster, context); + = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, context); + ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -568,7 +673,10 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, cluster).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, clusterName, cluster); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + Context.NONE); } /** @@ -587,8 +695,10 @@ public SyncPoller, ClusterInner> beginCreateOrUpdate(St @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, cluster, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, clusterName, cluster, context); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + context); } /** @@ -610,26 +720,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, String .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param cluster Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 cluster resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String privateCloudName, - String clusterName, ClusterInner cluster, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, cluster, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Create a Cluster. * @@ -645,7 +735,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner createOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, cluster).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, clusterName, cluster).getFinalResult(); } /** @@ -664,7 +754,7 @@ public ClusterInner createOrUpdate(String resourceGroupName, String privateCloud @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner createOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, Context context) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, cluster, context).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, clusterName, cluster, context).getFinalResult(); } /** @@ -673,7 +763,7 @@ public ClusterInner createOrUpdate(String resourceGroupName, String privateCloud * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. + * @param clusterUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -706,11 +796,12 @@ private Mono>> updateWithResponseAsync(String resource } else { clusterUpdate.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, clusterUpdate, - accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, contentType, accept, + clusterUpdate, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -720,44 +811,48 @@ private Mono>> updateWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. - * @param context The context to associate with this operation. + * @param clusterUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 cluster resource along with {@link Response} on successful completion of {@link Mono}. + * @return a cluster resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String privateCloudName, - String clusterName, ClusterUpdate clusterUpdate, Context context) { + private Response updateWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, ClusterUpdate clusterUpdate) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (clusterUpdate == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterUpdate is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterUpdate is required and cannot be null.")); } else { clusterUpdate.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, clusterName, clusterUpdate, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, contentType, accept, + clusterUpdate, Context.NONE); } /** @@ -766,19 +861,49 @@ private Mono>> updateWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. + * @param clusterUpdate The resource properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a cluster resource. + * @return a cluster resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterInner> beginUpdateAsync(String resourceGroupName, - String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, ClusterUpdate clusterUpdate, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterUpdate == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterUpdate is required and cannot be null.")); + } else { + clusterUpdate.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, contentType, accept, + clusterUpdate, context); } /** @@ -787,8 +912,7 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. - * @param context The context to associate with this operation. + * @param clusterUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -796,12 +920,11 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginUpdateAsync(String resourceGroupName, - String privateCloudName, String clusterName, ClusterUpdate clusterUpdate, Context context) { - context = this.client.mergeContext(context); + String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { Mono>> mono - = updateWithResponseAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate, context); + = updateWithResponseAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, context); + ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -810,7 +933,7 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. + * @param clusterUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -819,7 +942,10 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { - return this.beginUpdateAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate).getSyncPoller(); + Response response + = updateWithResponse(resourceGroupName, privateCloudName, clusterName, clusterUpdate); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + Context.NONE); } /** @@ -828,7 +954,7 @@ public SyncPoller, ClusterInner> beginUpdate(String res * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. + * @param clusterUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -838,8 +964,10 @@ public SyncPoller, ClusterInner> beginUpdate(String res @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate, Context context) { - return this.beginUpdateAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate, context) - .getSyncPoller(); + Response response + = updateWithResponse(resourceGroupName, privateCloudName, clusterName, clusterUpdate, context); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + context); } /** @@ -848,7 +976,7 @@ public SyncPoller, ClusterInner> beginUpdate(String res * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. + * @param clusterUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -867,27 +995,7 @@ private Mono updateAsync(String resourceGroupName, String privateC * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 cluster resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String privateCloudName, String clusterName, - ClusterUpdate clusterUpdate, Context context) { - return beginUpdateAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. + * @param clusterUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -896,7 +1004,7 @@ private Mono updateAsync(String resourceGroupName, String privateC @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner update(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { - return updateAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate).block(); + return beginUpdate(resourceGroupName, privateCloudName, clusterName, clusterUpdate).getFinalResult(); } /** @@ -905,7 +1013,7 @@ public ClusterInner update(String resourceGroupName, String privateCloudName, St * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param clusterUpdate The cluster properties to be updated. + * @param clusterUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -915,7 +1023,7 @@ public ClusterInner update(String resourceGroupName, String privateCloudName, St @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner update(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate, Context context) { - return updateAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate, context).block(); + return beginUpdate(resourceGroupName, privateCloudName, clusterName, clusterUpdate, context).getFinalResult(); } /** @@ -964,38 +1072,39 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, - String clusterName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String clusterName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, clusterName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, Context.NONE); } /** @@ -1004,18 +1113,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String clusterName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); } /** @@ -1024,7 +1155,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1032,12 +1162,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String clusterName, Context context) { - context = this.client.mergeContext(context); + String clusterName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName, context); + = deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1054,7 +1183,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String clusterName) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, clusterName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, privateCloudName, clusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1072,7 +1202,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String clusterName, Context context) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, privateCloudName, clusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1092,25 +1223,6 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 privateCloudName, String clusterName, - Context context) { - return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a Cluster. * @@ -1123,7 +1235,7 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String clusterName) { - deleteAsync(resourceGroupName, privateCloudName, clusterName).block(); + beginDelete(resourceGroupName, privateCloudName, clusterName).getFinalResult(); } /** @@ -1139,7 +1251,7 @@ public void delete(String resourceGroupName, String privateCloudName, String clu */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String clusterName, Context context) { - deleteAsync(resourceGroupName, privateCloudName, clusterName, context).block(); + beginDelete(resourceGroupName, privateCloudName, clusterName, context).getFinalResult(); } /** @@ -1183,47 +1295,6 @@ private Mono> listZonesWithResponseAsync(String r .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * List hosts by zone in a cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all zones and associated hosts for a cluster along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listZonesWithResponseAsync(String resourceGroupName, - String privateCloudName, String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listZones(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); - } - /** * List hosts by zone in a cluster. * @@ -1257,7 +1328,31 @@ private Mono listZonesAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response listZonesWithResponse(String resourceGroupName, String privateCloudName, String clusterName, Context context) { - return listZonesWithResponseAsync(resourceGroupName, privateCloudName, clusterName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listZonesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); } /** @@ -1302,6 +1397,32 @@ private Mono> listNextSinglePageAsync(String nextLin .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Cluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1310,22 +1431,24 @@ private Mono> listNextSinglePageAsync(String nextLin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Cluster list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Cluster list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ClustersClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersImpl.java index 6f100e07c5e4..af3b7886f3e8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -13,8 +13,8 @@ import com.azure.resourcemanager.avs.fluent.models.ClusterInner; import com.azure.resourcemanager.avs.fluent.models.ClusterZoneListInner; import com.azure.resourcemanager.avs.models.Cluster; -import com.azure.resourcemanager.avs.models.Clusters; import com.azure.resourcemanager.avs.models.ClusterZoneList; +import com.azure.resourcemanager.avs.models.Clusters; public final class ClustersImpl implements Clusters { private static final ClientLogger LOGGER = new ClientLogger(ClustersImpl.class); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoreImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoreImpl.java index 22da4af4da4d..9cda9846a8b8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoreImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoreImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -8,11 +8,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; import com.azure.resourcemanager.avs.models.Datastore; -import com.azure.resourcemanager.avs.models.DatastoreProvisioningState; -import com.azure.resourcemanager.avs.models.DatastoreStatus; -import com.azure.resourcemanager.avs.models.DiskPoolVolume; -import com.azure.resourcemanager.avs.models.ElasticSanVolume; -import com.azure.resourcemanager.avs.models.NetAppVolume; +import com.azure.resourcemanager.avs.models.DatastoreProperties; public final class DatastoreImpl implements Datastore, Datastore.Definition, Datastore.Update { private DatastoreInner innerObject; @@ -31,28 +27,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public DatastoreProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public NetAppVolume netAppVolume() { - return this.innerModel().netAppVolume(); - } - - public DiskPoolVolume diskPoolVolume() { - return this.innerModel().diskPoolVolume(); - } - - public ElasticSanVolume elasticSanVolume() { - return this.innerModel().elasticSanVolume(); + public DatastoreProperties properties() { + return this.innerModel().properties(); } - public DatastoreStatus status() { - return this.innerModel().status(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -149,18 +129,8 @@ public Datastore refresh(Context context) { return this; } - public DatastoreImpl withNetAppVolume(NetAppVolume netAppVolume) { - this.innerModel().withNetAppVolume(netAppVolume); - return this; - } - - public DatastoreImpl withDiskPoolVolume(DiskPoolVolume diskPoolVolume) { - this.innerModel().withDiskPoolVolume(diskPoolVolume); - return this; - } - - public DatastoreImpl withElasticSanVolume(ElasticSanVolume elasticSanVolume) { - this.innerModel().withElasticSanVolume(elasticSanVolume); + public DatastoreImpl withProperties(DatastoreProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java index dde4fb55d9b5..025eb92c1c74 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -27,13 +27,15 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.DatastoresClient; import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; -import com.azure.resourcemanager.avs.models.DatastoreList; +import com.azure.resourcemanager.avs.implementation.models.DatastoreList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,14 +69,24 @@ public final class DatastoresClientImpl implements DatastoresClient { * The interface defining all the services for AvsClientDatastores to be used by the proxy service to perform REST * calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientDatastores") public interface DatastoresService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @@ -84,28 +96,59 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @PathParam("datastoreName") String datastoreName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @PathParam("datastoreName") String datastoreName, @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, - @PathParam("datastoreName") String datastoreName, @BodyParam("application/json") DatastoreInner datastore, - @HeaderParam("Accept") String accept, Context context); + @PathParam("datastoreName") String datastoreName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DatastoreInner datastore, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @PathParam("datastoreName") String datastoreName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DatastoreInner datastore, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @PathParam("datastoreName") String datastoreName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @@ -116,7 +159,14 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -168,42 +218,15 @@ private Mono> listSinglePageAsync(String resourceG * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Datastore list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Datastore list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, clusterName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -215,12 +238,38 @@ private Mono> listSinglePageAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Datastore list operation as paginated response with {@link PagedFlux}. + * @return the response of a Datastore list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, String clusterName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, + String clusterName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -233,13 +282,38 @@ private PagedFlux listAsync(String resourceGroupName, String pri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Datastore list operation as paginated response with {@link PagedFlux}. + * @return the response of a Datastore list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, String clusterName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, + String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -255,7 +329,8 @@ private PagedFlux listAsync(String resourceGroupName, String pri */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, clusterName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, clusterName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -273,7 +348,8 @@ public PagedIterable list(String resourceGroupName, String priva @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, clusterName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, clusterName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -321,50 +397,6 @@ private Mono> getWithResponseAsync(String resourceGroup .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a Datastore. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param datastoreName Name of the datastore. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Datastore along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, - String clusterName, String datastoreName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (datastoreName == null) { - return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, clusterName, datastoreName, accept, context); - } - /** * Get a Datastore. * @@ -400,7 +432,35 @@ private Mono getAsync(String resourceGroupName, String privateCl @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, clusterName, datastoreName, accept, context); } /** @@ -465,11 +525,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { datastore.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, datastoreName, - datastore, accept, context)) + contentType, accept, datastore, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -481,47 +542,51 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param clusterName Name of the cluster. * @param datastoreName Name of the datastore. * @param datastore Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 datastore resource along with {@link Response} on successful completion of {@link Mono}. + * @return a datastore resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateCloudName, String clusterName, String datastoreName, DatastoreInner datastore, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String datastoreName, DatastoreInner datastore) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (datastoreName == null) { - return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); } if (datastore == null) { - return Mono.error(new IllegalArgumentException("Parameter datastore is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastore is required and cannot be null.")); } else { datastore.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, - accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, datastoreName, + contentType, accept, datastore, Context.NONE); } /** @@ -532,18 +597,52 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param clusterName Name of the cluster. * @param datastoreName Name of the datastore. * @param datastore Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a datastore resource. + * @return a datastore resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DatastoreInner> beginCreateOrUpdateAsync(String resourceGroupName, - String privateCloudName, String clusterName, String datastoreName, DatastoreInner datastore) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, - clusterName, datastoreName, datastore); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DatastoreInner.class, DatastoreInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String datastoreName, DatastoreInner datastore, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + if (datastore == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastore is required and cannot be null.")); + } else { + datastore.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, datastoreName, + contentType, accept, datastore, context); } /** @@ -554,7 +653,6 @@ private PollerFlux, DatastoreInner> beginCreateOrUpda * @param clusterName Name of the cluster. * @param datastoreName Name of the datastore. * @param datastore Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -562,12 +660,11 @@ private PollerFlux, DatastoreInner> beginCreateOrUpda */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DatastoreInner> beginCreateOrUpdateAsync(String resourceGroupName, - String privateCloudName, String clusterName, String datastoreName, DatastoreInner datastore, Context context) { - context = this.client.mergeContext(context); + String privateCloudName, String clusterName, String datastoreName, DatastoreInner datastore) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, - clusterName, datastoreName, datastore, context); + clusterName, datastoreName, datastore); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DatastoreInner.class, DatastoreInner.class, context); + DatastoreInner.class, DatastoreInner.class, this.client.getContext()); } /** @@ -586,8 +683,10 @@ private PollerFlux, DatastoreInner> beginCreateOrUpda @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DatastoreInner> beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, DatastoreInner datastore) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore); + return this.client.getLroResult(response, DatastoreInner.class, + DatastoreInner.class, Context.NONE); } /** @@ -607,10 +706,10 @@ public SyncPoller, DatastoreInner> beginCreateOrUpdat @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DatastoreInner> beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, DatastoreInner datastore, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, - context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, privateCloudName, clusterName, + datastoreName, datastore, context); + return this.client.getLroResult(response, DatastoreInner.class, + DatastoreInner.class, context); } /** @@ -634,27 +733,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a Datastore. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param datastoreName Name of the datastore. - * @param datastore Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 datastore resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String privateCloudName, - String clusterName, String datastoreName, DatastoreInner datastore, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - /** * Create a Datastore. * @@ -671,7 +749,8 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) public DatastoreInner createOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, DatastoreInner datastore) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore) + .getFinalResult(); } /** @@ -691,8 +770,8 @@ public DatastoreInner createOrUpdate(String resourceGroupName, String privateClo @ServiceMethod(returns = ReturnType.SINGLE) public DatastoreInner createOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, DatastoreInner datastore, Context context) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, context) - .block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, context) + .getFinalResult(); } /** @@ -747,41 +826,44 @@ private Mono>> deleteWithResponseAsync(String resource * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param datastoreName Name of the datastore. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, - String clusterName, String datastoreName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String datastoreName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (datastoreName == null) { - return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, clusterName, datastoreName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, datastoreName, accept, + Context.NONE); } /** @@ -791,18 +873,45 @@ private Mono>> deleteWithResponseAsync(String resource * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param datastoreName Name of the datastore. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String clusterName, String datastoreName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String datastoreName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, datastoreName, accept, + context); } /** @@ -812,7 +921,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param datastoreName Name of the datastore. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -820,12 +928,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String clusterName, String datastoreName, Context context) { - context = this.client.mergeContext(context); + String clusterName, String datastoreName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context); + = deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -843,7 +950,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName).getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -862,8 +971,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context) - .getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -885,26 +995,6 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a Datastore. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param datastoreName Name of the datastore. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 privateCloudName, String clusterName, - String datastoreName, Context context) { - return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a Datastore. * @@ -918,7 +1008,7 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { - deleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName).block(); + beginDelete(resourceGroupName, privateCloudName, clusterName, datastoreName).getFinalResult(); } /** @@ -936,7 +1026,7 @@ public void delete(String resourceGroupName, String privateCloudName, String clu @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { - deleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context).block(); + beginDelete(resourceGroupName, privateCloudName, clusterName, datastoreName, context).getFinalResult(); } /** @@ -965,6 +1055,32 @@ private Mono> listNextSinglePageAsync(String nextL .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Datastore list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -973,22 +1089,24 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Datastore list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a Datastore list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(DatastoresClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresImpl.java index 98056b46339f..8e80d9b6f8be 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ExpressRouteAuthorizationImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ExpressRouteAuthorizationImpl.java index 0f999a829817..d2a619a255db 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ExpressRouteAuthorizationImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ExpressRouteAuthorizationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -8,7 +8,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.ExpressRouteAuthorizationInner; import com.azure.resourcemanager.avs.models.ExpressRouteAuthorization; -import com.azure.resourcemanager.avs.models.ExpressRouteAuthorizationProvisioningState; +import com.azure.resourcemanager.avs.models.ExpressRouteAuthorizationProperties; public final class ExpressRouteAuthorizationImpl implements ExpressRouteAuthorization, ExpressRouteAuthorization.Definition, ExpressRouteAuthorization.Update { @@ -28,24 +28,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ExpressRouteAuthorizationProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String expressRouteAuthorizationId() { - return this.innerModel().expressRouteAuthorizationId(); - } - - public String expressRouteAuthorizationKey() { - return this.innerModel().expressRouteAuthorizationKey(); + public ExpressRouteAuthorizationProperties properties() { + return this.innerModel().properties(); } - public String expressRouteId() { - return this.innerModel().expressRouteId(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -135,8 +123,8 @@ public ExpressRouteAuthorization refresh(Context context) { return this; } - public ExpressRouteAuthorizationImpl withExpressRouteId(String expressRouteId) { - this.innerModel().withExpressRouteId(expressRouteId); + public ExpressRouteAuthorizationImpl withProperties(ExpressRouteAuthorizationProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionImpl.java index 1d04e814aa58..6e1b246f3293 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -8,8 +8,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; import com.azure.resourcemanager.avs.models.GlobalReachConnection; -import com.azure.resourcemanager.avs.models.GlobalReachConnectionProvisioningState; -import com.azure.resourcemanager.avs.models.GlobalReachConnectionStatus; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionProperties; public final class GlobalReachConnectionImpl implements GlobalReachConnection, GlobalReachConnection.Definition, GlobalReachConnection.Update { @@ -29,32 +28,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GlobalReachConnectionProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String addressPrefix() { - return this.innerModel().addressPrefix(); - } - - public String authorizationKey() { - return this.innerModel().authorizationKey(); - } - - public GlobalReachConnectionStatus circuitConnectionStatus() { - return this.innerModel().circuitConnectionStatus(); + public GlobalReachConnectionProperties properties() { + return this.innerModel().properties(); } - public String peerExpressRouteCircuit() { - return this.innerModel().peerExpressRouteCircuit(); - } - - public String expressRouteId() { - return this.innerModel().expressRouteId(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -147,18 +126,8 @@ public GlobalReachConnection refresh(Context context) { return this; } - public GlobalReachConnectionImpl withAuthorizationKey(String authorizationKey) { - this.innerModel().withAuthorizationKey(authorizationKey); - return this; - } - - public GlobalReachConnectionImpl withPeerExpressRouteCircuit(String peerExpressRouteCircuit) { - this.innerModel().withPeerExpressRouteCircuit(peerExpressRouteCircuit); - return this; - } - - public GlobalReachConnectionImpl withExpressRouteId(String expressRouteId) { - this.innerModel().withExpressRouteId(expressRouteId); + public GlobalReachConnectionImpl withProperties(GlobalReachConnectionProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java index 542114ae0d9d..3d6493da0f2f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -27,13 +27,15 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.GlobalReachConnectionsClient; import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; -import com.azure.resourcemanager.avs.models.GlobalReachConnectionList; +import com.azure.resourcemanager.avs.implementation.models.GlobalReachConnectionList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,14 +69,24 @@ public final class GlobalReachConnectionsClientImpl implements GlobalReachConnec * The interface defining all the services for AvsClientGlobalReachConnections to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientGlobalReach") public interface GlobalReachConnectionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, @@ -84,7 +96,7 @@ Mono> list(@HostParam("$host") String endpoi @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @@ -92,22 +104,54 @@ Mono> get(@HostParam("$host") String endpoi @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("globalReachConnectionName") String globalReachConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("globalReachConnectionName") String globalReachConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GlobalReachConnectionInner globalReachConnection, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("globalReachConnectionName") String globalReachConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GlobalReachConnectionInner globalReachConnection, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("globalReachConnectionName") String globalReachConnectionName, - @BodyParam("application/json") GlobalReachConnectionInner globalReachConnection, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @@ -119,8 +163,15 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -167,39 +218,15 @@ private Mono> listSinglePageAsync(Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a GlobalReachConnection list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a GlobalReachConnection list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -210,12 +237,35 @@ private Mono> listSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a GlobalReachConnection list operation as paginated response with {@link PagedFlux}. + * @return the response of a GlobalReachConnection list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -227,13 +277,35 @@ private PagedFlux listAsync(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a GlobalReachConnection list operation as paginated response with {@link PagedFlux}. + * @return the response of a GlobalReachConnection list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -248,7 +320,8 @@ private PagedFlux listAsync(String resourceGroupName */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -265,7 +338,8 @@ public PagedIterable list(String resourceGroupName, @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -310,47 +384,6 @@ private Mono> getWithResponseAsync(String r .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a GlobalReachConnection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param globalReachConnectionName Name of the global reach connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 GlobalReachConnection along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String privateCloudName, String globalReachConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (globalReachConnectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter globalReachConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, globalReachConnectionName, accept, context); - } - /** * Get a GlobalReachConnection. * @@ -384,7 +417,32 @@ private Mono getAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, globalReachConnectionName, accept, context); } /** @@ -445,11 +503,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { globalReachConnection.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, - globalReachConnection, accept, context)) + contentType, accept, globalReachConnection, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -460,47 +519,48 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param globalReachConnectionName Name of the global reach connection. * @param globalReachConnection Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 global reach connection resource along with {@link Response} on successful completion of {@link Mono}. + * @return a global reach connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection, - Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (globalReachConnectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter globalReachConnectionName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); } if (globalReachConnection == null) { - return Mono - .error(new IllegalArgumentException("Parameter globalReachConnection is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter globalReachConnection is required and cannot be null.")); } else { globalReachConnection.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, - globalReachConnection, accept, context); + contentType, accept, globalReachConnection, Context.NONE); } /** @@ -510,20 +570,49 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param globalReachConnectionName Name of the global reach connection. * @param globalReachConnection Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a global reach connection resource. + * @return a global reach connection resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GlobalReachConnectionInner> beginCreateOrUpdateAsync( - String resourceGroupName, String privateCloudName, String globalReachConnectionName, - GlobalReachConnectionInner globalReachConnection) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, - globalReachConnectionName, globalReachConnection); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GlobalReachConnectionInner.class, GlobalReachConnectionInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + if (globalReachConnection == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter globalReachConnection is required and cannot be null.")); + } else { + globalReachConnection.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, + contentType, accept, globalReachConnection, context); } /** @@ -533,7 +622,6 @@ private PollerFlux, GlobalReachConnection * @param privateCloudName Name of the private cloud. * @param globalReachConnectionName Name of the global reach connection. * @param globalReachConnection Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -542,12 +630,12 @@ private PollerFlux, GlobalReachConnection @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, GlobalReachConnectionInner> beginCreateOrUpdateAsync( String resourceGroupName, String privateCloudName, String globalReachConnectionName, - GlobalReachConnectionInner globalReachConnection, Context context) { - context = this.client.mergeContext(context); + GlobalReachConnectionInner globalReachConnection) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, - globalReachConnectionName, globalReachConnection, context); + globalReachConnectionName, globalReachConnection); return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GlobalReachConnectionInner.class, GlobalReachConnectionInner.class, context); + this.client.getHttpPipeline(), GlobalReachConnectionInner.class, GlobalReachConnectionInner.class, + this.client.getContext()); } /** @@ -566,10 +654,10 @@ private PollerFlux, GlobalReachConnection public SyncPoller, GlobalReachConnectionInner> beginCreateOrUpdate( String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, globalReachConnectionName, - globalReachConnection) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, privateCloudName, + globalReachConnectionName, globalReachConnection); + return this.client.getLroResult(response, + GlobalReachConnectionInner.class, GlobalReachConnectionInner.class, Context.NONE); } /** @@ -589,10 +677,10 @@ public SyncPoller, GlobalReachConnectionI public SyncPoller, GlobalReachConnectionInner> beginCreateOrUpdate( String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, globalReachConnectionName, - globalReachConnection, context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, privateCloudName, + globalReachConnectionName, globalReachConnection, context); + return this.client.getLroResult(response, + GlobalReachConnectionInner.class, GlobalReachConnectionInner.class, context); } /** @@ -614,26 +702,6 @@ private Mono createOrUpdateAsync(String resourceGrou globalReachConnection).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a GlobalReachConnection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param globalReachConnectionName Name of the global reach connection. - * @param globalReachConnection Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 global reach connection resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String privateCloudName, - String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, globalReachConnectionName, - globalReachConnection, context).last().flatMap(this.client::getLroFinalResultOrError); - } - /** * Create a GlobalReachConnection. * @@ -649,8 +717,8 @@ private Mono createOrUpdateAsync(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) public GlobalReachConnectionInner createOrUpdate(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, globalReachConnectionName, - globalReachConnection).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, globalReachConnectionName, + globalReachConnection).getFinalResult(); } /** @@ -669,8 +737,8 @@ public GlobalReachConnectionInner createOrUpdate(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) public GlobalReachConnectionInner createOrUpdate(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection, Context context) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, globalReachConnectionName, - globalReachConnection, context).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, globalReachConnectionName, + globalReachConnection, context).getFinalResult(); } /** @@ -721,39 +789,41 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param globalReachConnectionName Name of the global reach connection. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, - String globalReachConnectionName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String globalReachConnectionName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (globalReachConnectionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter globalReachConnectionName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, globalReachConnectionName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, accept, + Context.NONE); } /** @@ -762,18 +832,42 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param globalReachConnectionName Name of the global reach connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String globalReachConnectionName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String globalReachConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, accept, + context); } /** @@ -782,7 +876,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param globalReachConnectionName Name of the global reach connection. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -790,12 +883,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String globalReachConnectionName, Context context) { - context = this.client.mergeContext(context); + String globalReachConnectionName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context); + = deleteWithResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -812,7 +904,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName).getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, privateCloudName, globalReachConnectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -830,8 +924,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context) - .getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, privateCloudName, globalReachConnectionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -852,25 +947,6 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a GlobalReachConnection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param globalReachConnectionName Name of the global reach connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 privateCloudName, String globalReachConnectionName, - Context context) { - return beginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a GlobalReachConnection. * @@ -883,7 +959,7 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { - deleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName).block(); + beginDelete(resourceGroupName, privateCloudName, globalReachConnectionName).getFinalResult(); } /** @@ -900,7 +976,7 @@ public void delete(String resourceGroupName, String privateCloudName, String glo @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { - deleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context).block(); + beginDelete(resourceGroupName, privateCloudName, globalReachConnectionName, context).getFinalResult(); } /** @@ -929,6 +1005,33 @@ private Mono> listNextSinglePageAsync( .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GlobalReachConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -937,22 +1040,25 @@ private Mono> listNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a GlobalReachConnection list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a GlobalReachConnection list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(GlobalReachConnectionsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsImpl.java index 14d3a90821ce..8679a5ebc4b9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSiteImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSiteImpl.java index 81b63f7735c0..4b2c62546950 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSiteImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSiteImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -8,8 +8,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.HcxEnterpriseSiteInner; import com.azure.resourcemanager.avs.models.HcxEnterpriseSite; -import com.azure.resourcemanager.avs.models.HcxEnterpriseSiteProvisioningState; -import com.azure.resourcemanager.avs.models.HcxEnterpriseSiteStatus; +import com.azure.resourcemanager.avs.models.HcxEnterpriseSiteProperties; public final class HcxEnterpriseSiteImpl implements HcxEnterpriseSite, HcxEnterpriseSite.Definition, HcxEnterpriseSite.Update { @@ -29,20 +28,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public HcxEnterpriseSiteProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String activationKey() { - return this.innerModel().activationKey(); + public HcxEnterpriseSiteProperties properties() { + return this.innerModel().properties(); } - public HcxEnterpriseSiteStatus status() { - return this.innerModel().status(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -138,4 +129,9 @@ public HcxEnterpriseSite refresh(Context context) { .getValue(); return this; } + + public HcxEnterpriseSiteImpl withProperties(HcxEnterpriseSiteProperties properties) { + this.innerModel().withProperties(properties); + return this; + } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesClientImpl.java index 12a5cdda84cb..0e52a3c9d324 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -28,9 +28,10 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.HcxEnterpriseSitesClient; import com.azure.resourcemanager.avs.fluent.models.HcxEnterpriseSiteInner; -import com.azure.resourcemanager.avs.models.HcxEnterpriseSiteList; +import com.azure.resourcemanager.avs.implementation.models.HcxEnterpriseSiteList; import reactor.core.publisher.Mono; /** @@ -62,14 +63,24 @@ public final class HcxEnterpriseSitesClientImpl implements HcxEnterpriseSitesCli * The interface defining all the services for AvsClientHcxEnterpriseSites to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientHcxEnterpri") public interface HcxEnterpriseSitesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, @@ -79,7 +90,7 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @@ -87,22 +98,54 @@ Mono> get(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("hcxEnterpriseSiteName") String hcxEnterpriseSiteName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("hcxEnterpriseSiteName") String hcxEnterpriseSiteName, - @BodyParam("application/json") HcxEnterpriseSiteInner hcxEnterpriseSite, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HcxEnterpriseSiteInner hcxEnterpriseSite, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("hcxEnterpriseSiteName") String hcxEnterpriseSiteName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HcxEnterpriseSiteInner hcxEnterpriseSite, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("hcxEnterpriseSiteName") String hcxEnterpriseSiteName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @@ -114,7 +157,14 @@ Mono> delete(@HostParam("$host") String endpoint, @QueryParam("ap @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -161,39 +211,15 @@ private Mono> listSinglePageAsync(String r * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a HcxEnterpriseSite list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a HcxEnterpriseSite list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -204,12 +230,33 @@ private Mono> listSinglePageAsync(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a HcxEnterpriseSite list operation as paginated response with {@link PagedFlux}. + * @return the response of a HcxEnterpriseSite list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -221,13 +268,34 @@ private PagedFlux listAsync(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a HcxEnterpriseSite list operation as paginated response with {@link PagedFlux}. + * @return the response of a HcxEnterpriseSite list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -242,7 +310,8 @@ private PagedFlux listAsync(String resourceGroupName, St */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -259,7 +328,8 @@ public PagedIterable list(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -304,47 +374,6 @@ private Mono> getWithResponseAsync(String resou .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a HcxEnterpriseSite. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a HcxEnterpriseSite along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String privateCloudName, String hcxEnterpriseSiteName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (hcxEnterpriseSiteName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, hcxEnterpriseSiteName, accept, context); - } - /** * Get a HcxEnterpriseSite. * @@ -378,7 +407,31 @@ private Mono getAsync(String resourceGroupName, String p @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, hcxEnterpriseSiteName, accept, context); } /** @@ -438,64 +491,15 @@ private Mono> createOrUpdateWithResponseAsync(S } else { hcxEnterpriseSite.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, hcxEnterpriseSiteName, - hcxEnterpriseSite, accept, context)) + contentType, accept, hcxEnterpriseSite, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Create a HcxEnterpriseSite. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site. - * @param hcxEnterpriseSite Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an HCX Enterprise Site resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateCloudName, String hcxEnterpriseSiteName, HcxEnterpriseSiteInner hcxEnterpriseSite, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (hcxEnterpriseSiteName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); - } - if (hcxEnterpriseSite == null) { - return Mono - .error(new IllegalArgumentException("Parameter hcxEnterpriseSite is required and cannot be null.")); - } else { - hcxEnterpriseSite.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, hcxEnterpriseSiteName, - hcxEnterpriseSite, accept, context); - } - /** * Create a HcxEnterpriseSite. * @@ -532,8 +536,39 @@ private Mono createOrUpdateAsync(String resourceGroupNam public Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, HcxEnterpriseSiteInner hcxEnterpriseSite, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, - hcxEnterpriseSite, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } + if (hcxEnterpriseSite == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter hcxEnterpriseSite is required and cannot be null.")); + } else { + hcxEnterpriseSite.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, hcxEnterpriseSiteName, contentType, + accept, hcxEnterpriseSite, context); } /** @@ -597,47 +632,6 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Delete a HcxEnterpriseSite. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, - String hcxEnterpriseSiteName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (hcxEnterpriseSiteName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, hcxEnterpriseSiteName, accept, context); - } - /** * Delete a HcxEnterpriseSite. * @@ -670,7 +664,32 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, Context context) { - return deleteWithResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, hcxEnterpriseSiteName, accept, + context); } /** @@ -714,6 +733,33 @@ private Mono> listNextSinglePageAsync(Stri .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HcxEnterpriseSite list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -722,22 +768,25 @@ private Mono> listNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a HcxEnterpriseSite list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a HcxEnterpriseSite list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(HcxEnterpriseSitesClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesImpl.java index 42a7c39ca69e..519363e73a4b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostModelImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostModelImpl.java new file mode 100644 index 000000000000..1ebd8c7e6c6f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostModelImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.avs.fluent.models.HostModelInner; +import com.azure.resourcemanager.avs.models.HostModel; +import com.azure.resourcemanager.avs.models.HostProperties; +import com.azure.resourcemanager.avs.models.Sku; +import java.util.Collections; +import java.util.List; + +public final class HostModelImpl implements HostModel { + private HostModelInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + HostModelImpl(HostModelInner innerObject, com.azure.resourcemanager.avs.AvsManager 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 HostProperties properties() { + return this.innerModel().properties(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public HostModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostsClientImpl.java new file mode 100644 index 000000000000..8c45ac99ff07 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostsClientImpl.java @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.HostsClient; +import com.azure.resourcemanager.avs.fluent.models.HostModelInner; +import com.azure.resourcemanager.avs.implementation.models.HostListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HostsClient. + */ +public final class HostsClientImpl implements HostsClient { + /** + * The proxy service used to perform REST calls. + */ + private final HostsService service; + + /** + * The service client containing this operation class. + */ + private final AvsClientImpl client; + + /** + * Initializes an instance of HostsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HostsClientImpl(AvsClientImpl client) { + this.service = RestProxy.create(HostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientHosts to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "AvsClientHosts") + public interface HostsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/hosts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/hosts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/hosts/{hostId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @PathParam("hostId") String hostId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/hosts/{hostId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @PathParam("hostId") String hostId, @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Host resources by Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName, + String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, 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 Host resources by Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Host resources by Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, + String clusterName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Host resources by Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, + String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Host resources by Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, clusterName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List Host resources by Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, clusterName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get a Host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @param hostId The host identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Host along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, + String clusterName, String hostId) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (hostId == null) { + return Mono.error(new IllegalArgumentException("Parameter hostId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, hostId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @param hostId The host identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Host on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String privateCloudName, String clusterName, + String hostId) { + return getWithResponseAsync(resourceGroupName, privateCloudName, clusterName, hostId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @param hostId The host identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Host along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String hostId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (hostId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter hostId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, clusterName, hostId, accept, context); + } + + /** + * Get a Host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @param hostId The host identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HostModelInner get(String resourceGroupName, String privateCloudName, String clusterName, String hostId) { + return getWithResponse(resourceGroupName, privateCloudName, clusterName, hostId, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(HostsClientImpl.class); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostsImpl.java new file mode 100644 index 000000000000..050f5f62fd68 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostsImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.HostsClient; +import com.azure.resourcemanager.avs.fluent.models.HostModelInner; +import com.azure.resourcemanager.avs.models.HostModel; +import com.azure.resourcemanager.avs.models.Hosts; + +public final class HostsImpl implements Hosts { + private static final ClientLogger LOGGER = new ClientLogger(HostsImpl.class); + + private final HostsClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public HostsImpl(HostsClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, privateCloudName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HostModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, privateCloudName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HostModelImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String privateCloudName, String clusterName, + String hostId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, clusterName, hostId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HostModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HostModel get(String resourceGroupName, String privateCloudName, String clusterName, String hostId) { + HostModelInner inner = this.serviceClient().get(resourceGroupName, privateCloudName, clusterName, hostId); + if (inner != null) { + return new HostModelImpl(inner, this.manager()); + } else { + return null; + } + } + + private HostsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathImpl.java index 5e900351c35b..b7275501bc02 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathImpl.java @@ -1,24 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; import com.azure.core.management.SystemData; +import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.IscsiPathInner; import com.azure.resourcemanager.avs.models.IscsiPath; -import com.azure.resourcemanager.avs.models.IscsiPathProvisioningState; +import com.azure.resourcemanager.avs.models.IscsiPathProperties; -public final class IscsiPathImpl implements IscsiPath { +public final class IscsiPathImpl implements IscsiPath, IscsiPath.Definition, IscsiPath.Update { private IscsiPathInner innerObject; private final com.azure.resourcemanager.avs.AvsManager serviceManager; - IscsiPathImpl(IscsiPathInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - public String id() { return this.innerModel().id(); } @@ -31,16 +27,16 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); + public IscsiPathProperties properties() { + return this.innerModel().properties(); } - public IscsiPathProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } - public String networkBlock() { - return this.innerModel().networkBlock(); + public String resourceGroupName() { + return resourceGroupName; } public IscsiPathInner innerModel() { @@ -50,4 +46,83 @@ public IscsiPathInner innerModel() { private com.azure.resourcemanager.avs.AvsManager manager() { return this.serviceManager; } + + private String resourceGroupName; + + private String privateCloudName; + + private String iscsiPathName; + + public IscsiPathImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public IscsiPath create() { + this.innerObject = serviceManager.serviceClient() + .getIscsiPaths() + .createOrUpdate(resourceGroupName, privateCloudName, iscsiPathName, this.innerModel(), Context.NONE); + return this; + } + + public IscsiPath create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIscsiPaths() + .createOrUpdate(resourceGroupName, privateCloudName, iscsiPathName, this.innerModel(), context); + return this; + } + + IscsiPathImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new IscsiPathInner(); + this.serviceManager = serviceManager; + this.iscsiPathName = name; + } + + public IscsiPathImpl update() { + return this; + } + + public IscsiPath apply() { + this.innerObject = serviceManager.serviceClient() + .getIscsiPaths() + .createOrUpdate(resourceGroupName, privateCloudName, iscsiPathName, this.innerModel(), Context.NONE); + return this; + } + + public IscsiPath apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIscsiPaths() + .createOrUpdate(resourceGroupName, privateCloudName, iscsiPathName, this.innerModel(), context); + return this; + } + + IscsiPathImpl(IscsiPathInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.iscsiPathName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "iscsiPaths"); + } + + public IscsiPath refresh() { + this.innerObject = serviceManager.serviceClient() + .getIscsiPaths() + .getWithResponse(resourceGroupName, privateCloudName, iscsiPathName, Context.NONE) + .getValue(); + return this; + } + + public IscsiPath refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIscsiPaths() + .getWithResponse(resourceGroupName, privateCloudName, iscsiPathName, context) + .getValue(); + return this; + } + + public IscsiPathImpl withProperties(IscsiPathProperties properties) { + this.innerModel().withProperties(properties); + return this; + } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathsClientImpl.java index e3415c8b9cc4..1d43facbf8f0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -27,13 +27,15 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.IscsiPathsClient; import com.azure.resourcemanager.avs.fluent.models.IscsiPathInner; -import com.azure.resourcemanager.avs.models.IscsiPathListResult; +import com.azure.resourcemanager.avs.implementation.models.IscsiPathListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,56 +69,103 @@ public final class IscsiPathsClientImpl implements IscsiPathsClient { * The interface defining all the services for AvsClientIscsiPaths to be used by the proxy service to perform REST * calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientIscsiPaths") public interface IscsiPathsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPrivateCloud(@HostParam("$host") String endpoint, + Mono> listByPrivateCloud(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response listByPrivateCloudSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/{iscsiPathName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("iscsiPathName") String iscsiPathName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/{iscsiPathName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("iscsiPathName") String iscsiPathName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/{iscsiPathName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, - @BodyParam("application/json") IscsiPathInner resource, @HeaderParam("Accept") String accept, - Context context); + @PathParam("privateCloudName") String privateCloudName, @PathParam("iscsiPathName") String iscsiPathName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") IscsiPathInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/{iscsiPathName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("iscsiPathName") String iscsiPathName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") IscsiPathInner resource, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/{iscsiPathName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("privateCloudName") String privateCloudName, @PathParam("iscsiPathName") String iscsiPathName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/{iscsiPathName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("iscsiPathName") String iscsiPathName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByPrivateCloudNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByPrivateCloudNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -164,39 +213,15 @@ private Mono> listByPrivateCloudSinglePageAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a IscsiPath list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a IscsiPath list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateCloudSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPrivateCloud(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPrivateCloudAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>(() -> listByPrivateCloudSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listByPrivateCloudNextSinglePageAsync(nextLink)); } /** @@ -207,12 +232,35 @@ private Mono> listByPrivateCloudSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a IscsiPath list operation as paginated response with {@link PagedFlux}. + * @return the response of a IscsiPath list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPrivateCloudAsync(String resourceGroupName, String privateCloudName) { - return new PagedFlux<>(() -> listByPrivateCloudSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listByPrivateCloudNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByPrivateCloudSinglePage(String resourceGroupName, + String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByPrivateCloudSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -224,13 +272,35 @@ private PagedFlux listByPrivateCloudAsync(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a IscsiPath list operation as paginated response with {@link PagedFlux}. + * @return the response of a IscsiPath list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPrivateCloudAsync(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedFlux<>(() -> listByPrivateCloudSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listByPrivateCloudNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByPrivateCloudSinglePage(String resourceGroupName, + String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByPrivateCloudSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -245,7 +315,8 @@ private PagedFlux listByPrivateCloudAsync(String resourceGroupNa */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPrivateCloud(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listByPrivateCloudAsync(resourceGroupName, privateCloudName)); + return new PagedIterable<>(() -> listByPrivateCloudSinglePage(resourceGroupName, privateCloudName), + nextLink -> listByPrivateCloudNextSinglePage(nextLink)); } /** @@ -262,7 +333,8 @@ public PagedIterable listByPrivateCloud(String resourceGroupName @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPrivateCloud(String resourceGroupName, String privateCloudName, Context context) { - return new PagedIterable<>(listByPrivateCloudAsync(resourceGroupName, privateCloudName, context)); + return new PagedIterable<>(() -> listByPrivateCloudSinglePage(resourceGroupName, privateCloudName, context), + nextLink -> listByPrivateCloudNextSinglePage(nextLink, context)); } /** @@ -270,13 +342,15 @@ public PagedIterable listByPrivateCloud(String resourceGroupName * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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 a IscsiPath along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName) { + private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, + String iscsiPathName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -293,10 +367,13 @@ private Mono> getWithResponseAsync(String resourceGroup return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (iscsiPathName == null) { + return Mono.error(new IllegalArgumentException("Parameter iscsiPathName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, iscsiPathName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -305,50 +382,15 @@ private Mono> getWithResponseAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 IscsiPath along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context); - } - - /** - * Get a IscsiPath. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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 a IscsiPath on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String privateCloudName) { - return getWithResponseAsync(resourceGroupName, privateCloudName) + private Mono getAsync(String resourceGroupName, String privateCloudName, String iscsiPathName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, iscsiPathName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -357,6 +399,7 @@ private Mono getAsync(String resourceGroupName, String privateCl * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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. @@ -365,8 +408,32 @@ private Mono getAsync(String resourceGroupName, String privateCl */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, - Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, context).block(); + String iscsiPathName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (iscsiPathName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter iscsiPathName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, iscsiPathName, accept, context); } /** @@ -374,14 +441,15 @@ public Response getWithResponse(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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 a IscsiPath. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IscsiPathInner get(String resourceGroupName, String privateCloudName) { - return getWithResponse(resourceGroupName, privateCloudName, Context.NONE).getValue(); + public IscsiPathInner get(String resourceGroupName, String privateCloudName, String iscsiPathName) { + return getWithResponse(resourceGroupName, privateCloudName, iscsiPathName, Context.NONE).getValue(); } /** @@ -389,6 +457,7 @@ public IscsiPathInner get(String resourceGroupName, String privateCloudName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -397,7 +466,7 @@ public IscsiPathInner get(String resourceGroupName, String privateCloudName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateCloudName, IscsiPathInner resource) { + String privateCloudName, String iscsiPathName, IscsiPathInner resource) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -414,15 +483,20 @@ private Mono>> createOrUpdateWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (iscsiPathName == null) { + return Mono.error(new IllegalArgumentException("Parameter iscsiPathName is required and cannot be null.")); + } if (resource == null) { return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, resource, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, iscsiPathName, contentType, + accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -431,41 +505,49 @@ private Mono>> createOrUpdateWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an iSCSI path resource along with {@link Response} on successful completion of {@link Mono}. + * @return an iSCSI path resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateCloudName, IscsiPathInner resource, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String iscsiPathName, IscsiPathInner resource) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (iscsiPathName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter iscsiPathName is required and cannot be null.")); } if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); } else { resource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, resource, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, iscsiPathName, contentType, accept, + resource, Context.NONE); } /** @@ -473,19 +555,50 @@ private Mono>> createOrUpdateWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an iSCSI path resource. + * @return an iSCSI path resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, IscsiPathInner> beginCreateOrUpdateAsync(String resourceGroupName, - String privateCloudName, IscsiPathInner resource) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - IscsiPathInner.class, IscsiPathInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String iscsiPathName, IscsiPathInner resource, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (iscsiPathName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter iscsiPathName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, iscsiPathName, contentType, accept, + resource, context); } /** @@ -493,8 +606,8 @@ private PollerFlux, IscsiPathInner> beginCreateOrUpda * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -502,12 +615,11 @@ private PollerFlux, IscsiPathInner> beginCreateOrUpda */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, IscsiPathInner> beginCreateOrUpdateAsync(String resourceGroupName, - String privateCloudName, IscsiPathInner resource, Context context) { - context = this.client.mergeContext(context); + String privateCloudName, String iscsiPathName, IscsiPathInner resource) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, resource, context); + = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, iscsiPathName, resource); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - IscsiPathInner.class, IscsiPathInner.class, context); + IscsiPathInner.class, IscsiPathInner.class, this.client.getContext()); } /** @@ -515,6 +627,7 @@ private PollerFlux, IscsiPathInner> beginCreateOrUpda * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -523,8 +636,11 @@ private PollerFlux, IscsiPathInner> beginCreateOrUpda */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, IscsiPathInner> beginCreateOrUpdate(String resourceGroupName, - String privateCloudName, IscsiPathInner resource) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, resource).getSyncPoller(); + String privateCloudName, String iscsiPathName, IscsiPathInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, iscsiPathName, resource); + return this.client.getLroResult(response, IscsiPathInner.class, + IscsiPathInner.class, Context.NONE); } /** @@ -532,6 +648,7 @@ public SyncPoller, IscsiPathInner> beginCreateOrUpdat * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -541,8 +658,11 @@ public SyncPoller, IscsiPathInner> beginCreateOrUpdat */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, IscsiPathInner> beginCreateOrUpdate(String resourceGroupName, - String privateCloudName, IscsiPathInner resource, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, resource, context).getSyncPoller(); + String privateCloudName, String iscsiPathName, IscsiPathInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, iscsiPathName, resource, context); + return this.client.getLroResult(response, IscsiPathInner.class, + IscsiPathInner.class, context); } /** @@ -550,6 +670,7 @@ public SyncPoller, IscsiPathInner> beginCreateOrUpdat * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -558,27 +679,8 @@ public SyncPoller, IscsiPathInner> beginCreateOrUpdat */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String privateCloudName, - IscsiPathInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, resource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a IscsiPath. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an iSCSI path resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String privateCloudName, - IscsiPathInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, resource, context).last() + String iscsiPathName, IscsiPathInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, iscsiPathName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -587,6 +689,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -594,8 +697,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin * @return an iSCSI path resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IscsiPathInner createOrUpdate(String resourceGroupName, String privateCloudName, IscsiPathInner resource) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, resource).block(); + public IscsiPathInner createOrUpdate(String resourceGroupName, String privateCloudName, String iscsiPathName, + IscsiPathInner resource) { + return beginCreateOrUpdate(resourceGroupName, privateCloudName, iscsiPathName, resource).getFinalResult(); } /** @@ -603,6 +707,7 @@ public IscsiPathInner createOrUpdate(String resourceGroupName, String privateClo * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path resource. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -611,9 +716,10 @@ public IscsiPathInner createOrUpdate(String resourceGroupName, String privateClo * @return an iSCSI path resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IscsiPathInner createOrUpdate(String resourceGroupName, String privateCloudName, IscsiPathInner resource, - Context context) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, resource, context).block(); + public IscsiPathInner createOrUpdate(String resourceGroupName, String privateCloudName, String iscsiPathName, + IscsiPathInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, privateCloudName, iscsiPathName, resource, context) + .getFinalResult(); } /** @@ -621,14 +727,15 @@ public IscsiPathInner createOrUpdate(String resourceGroupName, String privateClo * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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 Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String privateCloudName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, + String iscsiPathName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -645,10 +752,13 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (iscsiPathName == null) { + return Mono.error(new IllegalArgumentException("Parameter iscsiPathName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, iscsiPathName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -657,35 +767,40 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. + * @param iscsiPathName Name of the iSCSI path 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 Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, - Context context) { + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String iscsiPathName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (iscsiPathName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter iscsiPathName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, iscsiPathName, accept, Context.NONE); } /** @@ -693,16 +808,41 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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 long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateCloudName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String iscsiPathName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (iscsiPathName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter iscsiPathName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, iscsiPathName, accept, context); } /** @@ -710,7 +850,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. + * @param iscsiPathName Name of the iSCSI path 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. @@ -718,11 +858,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateCloudName, context); + String iscsiPathName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, privateCloudName, iscsiPathName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -730,14 +870,17 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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 long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, + String iscsiPathName) { + Response response = deleteWithResponse(resourceGroupName, privateCloudName, iscsiPathName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -745,6 +888,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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. @@ -753,8 +897,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, context).getSyncPoller(); + String iscsiPathName, Context context) { + Response response = deleteWithResponse(resourceGroupName, privateCloudName, iscsiPathName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -762,14 +907,15 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String privateCloudName) { - return beginDeleteAsync(resourceGroupName, privateCloudName).last() + private Mono deleteAsync(String resourceGroupName, String privateCloudName, String iscsiPathName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, iscsiPathName).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -778,30 +924,14 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. + * @param iscsiPathName Name of the iSCSI path 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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String privateCloudName, Context context) { - return beginDeleteAsync(resourceGroupName, privateCloudName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a IscsiPath. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 privateCloudName) { - deleteAsync(resourceGroupName, privateCloudName).block(); + public void delete(String resourceGroupName, String privateCloudName, String iscsiPathName) { + beginDelete(resourceGroupName, privateCloudName, iscsiPathName).getFinalResult(); } /** @@ -809,14 +939,15 @@ public void delete(String resourceGroupName, String privateCloudName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String privateCloudName, Context context) { - deleteAsync(resourceGroupName, privateCloudName, context).block(); + public void delete(String resourceGroupName, String privateCloudName, String iscsiPathName, Context context) { + beginDelete(resourceGroupName, privateCloudName, iscsiPathName, context).getFinalResult(); } /** @@ -847,6 +978,33 @@ private Mono> listByPrivateCloudNextSinglePageAsyn .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IscsiPath list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByPrivateCloudNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByPrivateCloudNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -855,23 +1013,25 @@ private Mono> listByPrivateCloudNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a IscsiPath list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a IscsiPath list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPrivateCloudNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listByPrivateCloudNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByPrivateCloudNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByPrivateCloudNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(IscsiPathsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathsImpl.java index 08222a97bdde..4ea5e6c7b4b6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathsImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -39,9 +39,10 @@ public PagedIterable listByPrivateCloud(String resourceGroupName, Str return ResourceManagerUtils.mapPage(inner, inner1 -> new IscsiPathImpl(inner1, this.manager())); } - public Response getWithResponse(String resourceGroupName, String privateCloudName, Context context) { + public Response getWithResponse(String resourceGroupName, String privateCloudName, String iscsiPathName, + Context context) { Response inner - = this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, context); + = this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, iscsiPathName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new IscsiPathImpl(inner.getValue(), this.manager())); @@ -50,8 +51,8 @@ public Response getWithResponse(String resourceGroupName, String priv } } - public IscsiPath get(String resourceGroupName, String privateCloudName) { - IscsiPathInner inner = this.serviceClient().get(resourceGroupName, privateCloudName); + public IscsiPath get(String resourceGroupName, String privateCloudName, String iscsiPathName) { + IscsiPathInner inner = this.serviceClient().get(resourceGroupName, privateCloudName, iscsiPathName); if (inner != null) { return new IscsiPathImpl(inner, this.manager()); } else { @@ -59,32 +60,88 @@ public IscsiPath get(String resourceGroupName, String privateCloudName) { } } - public IscsiPath createOrUpdate(String resourceGroupName, String privateCloudName, IscsiPathInner resource) { - IscsiPathInner inner = this.serviceClient().createOrUpdate(resourceGroupName, privateCloudName, resource); - if (inner != null) { - return new IscsiPathImpl(inner, this.manager()); - } else { - return null; + public void delete(String resourceGroupName, String privateCloudName, String iscsiPathName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, iscsiPathName); + } + + public void delete(String resourceGroupName, String privateCloudName, String iscsiPathName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, iscsiPathName, context); + } + + public IscsiPath getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } + String iscsiPathName = ResourceManagerUtils.getValueFromIdByName(id, "iscsiPaths"); + if (iscsiPathName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iscsiPaths'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, iscsiPathName, Context.NONE).getValue(); } - public IscsiPath createOrUpdate(String resourceGroupName, String privateCloudName, IscsiPathInner resource, - Context context) { - IscsiPathInner inner - = this.serviceClient().createOrUpdate(resourceGroupName, privateCloudName, resource, context); - if (inner != null) { - return new IscsiPathImpl(inner, this.manager()); - } else { - return null; + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } + String iscsiPathName = ResourceManagerUtils.getValueFromIdByName(id, "iscsiPaths"); + if (iscsiPathName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iscsiPaths'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, iscsiPathName, context); } - public void deleteByResourceGroup(String resourceGroupName, String privateCloudName) { - this.serviceClient().delete(resourceGroupName, privateCloudName); + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String iscsiPathName = ResourceManagerUtils.getValueFromIdByName(id, "iscsiPaths"); + if (iscsiPathName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iscsiPaths'.", id))); + } + this.delete(resourceGroupName, privateCloudName, iscsiPathName, Context.NONE); } - public void delete(String resourceGroupName, String privateCloudName, Context context) { - this.serviceClient().delete(resourceGroupName, privateCloudName, context); + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String iscsiPathName = ResourceManagerUtils.getValueFromIdByName(id, "iscsiPaths"); + if (iscsiPathName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iscsiPaths'.", id))); + } + this.delete(resourceGroupName, privateCloudName, iscsiPathName, context); } private IscsiPathsClient serviceClient() { @@ -94,4 +151,8 @@ private IscsiPathsClient serviceClient() { private com.azure.resourcemanager.avs.AvsManager manager() { return this.serviceManager; } + + public IscsiPathImpl define(String name) { + return new IscsiPathImpl(name, this.manager()); + } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsClientImpl.java index aba40d6e6af4..1c3eb41df0ce 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -22,6 +22,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.LocationsClient; import com.azure.resourcemanager.avs.fluent.models.QuotaInner; import com.azure.resourcemanager.avs.fluent.models.TrialInner; @@ -57,38 +58,56 @@ public final class LocationsClientImpl implements LocationsClient { * The interface defining all the services for AvsClientLocations to be used by the proxy service to perform REST * calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientLocations") public interface LocationsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkTrialAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, + @BodyParam("application/json") Sku sku, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkTrialAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, + @BodyParam("application/json") Sku sku, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkQuotaAvailability(@HostParam("$host") String endpoint, + Mono> checkQuotaAvailability(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability") + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkTrialAvailability(@HostParam("$host") String endpoint, + Response checkQuotaAvailabilitySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @BodyParam("application/json") Sku sku, - @HeaderParam("Accept") String accept, Context context); + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); } /** - * Return quota for subscription by region. + * Return trial status for subscription by region. * - * @param location The name of the Azure region. + * @param location A location in a subscription. + * @param sku Optionally, check for a specific 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 subscription quotas along with {@link Response} on successful completion of {@link Mono}. + * @return subscription trial availability along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkQuotaAvailabilityWithResponseAsync(String location) { + private Mono> checkTrialAvailabilityWithResponseAsync(String location, Sku sku) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -100,132 +119,92 @@ private Mono> checkQuotaAvailabilityWithResponseAsync(Strin if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } + if (sku != null) { + sku.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkQuotaAvailability(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context)) + .withContext(context -> service.checkTrialAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, sku, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Return quota for subscription by region. - * - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription quotas along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkQuotaAvailabilityWithResponseAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkQuotaAvailability(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, accept, context); - } - - /** - * Return quota for subscription by region. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription quotas on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkQuotaAvailabilityAsync(String location) { - return checkQuotaAvailabilityWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Return quota for subscription by region. - * - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription quotas along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkQuotaAvailabilityWithResponse(String location, Context context) { - return checkQuotaAvailabilityWithResponseAsync(location, context).block(); - } - - /** - * Return quota for subscription by region. + * Return trial status for subscription by region. * - * @param location The name of the Azure region. + * @param location A location in a subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription quotas. + * @return subscription trial availability on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaInner checkQuotaAvailability(String location) { - return checkQuotaAvailabilityWithResponse(location, Context.NONE).getValue(); + private Mono checkTrialAvailabilityAsync(String location) { + final Sku sku = null; + return checkTrialAvailabilityWithResponseAsync(location, sku).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Return trial status for subscription by region. * - * @param location The name of the Azure region. + * @param location A location in a subscription. * @param sku Optionally, check for a specific 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 subscription trial availability along with {@link Response} on successful completion of {@link Mono}. + * @return subscription trial availability along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkTrialAvailabilityWithResponseAsync(String location, Sku sku) { + public Response checkTrialAvailabilityWithResponse(String location, Sku sku, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (sku != null) { sku.validate(); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.checkTrialAvailability(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), location, sku, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.checkTrialAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, sku, context); } /** * Return trial status for subscription by region. * - * @param location The name of the Azure region. - * @param sku Optionally, check for a specific SKU. - * @param context The context to associate with this operation. + * @param location A location in a subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription trial availability along with {@link Response} on successful completion of {@link Mono}. + * @return subscription trial availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TrialInner checkTrialAvailability(String location) { + final Sku sku = null; + return checkTrialAvailabilityWithResponse(location, sku, Context.NONE).getValue(); + } + + /** + * Return quota for subscription by region. + * + * @param location A location in a subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription quotas along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkTrialAvailabilityWithResponseAsync(String location, Sku sku, - Context context) { + private Mono> checkQuotaAvailabilityWithResponseAsync(String location) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -237,58 +216,71 @@ private Mono> checkTrialAvailabilityWithResponseAsync(Strin if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } - if (sku != null) { - sku.validate(); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkTrialAvailability(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, sku, accept, context); + return FluxUtil + .withContext(context -> service.checkQuotaAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Return trial status for subscription by region. + * Return quota for subscription by region. * - * @param location The name of the Azure region. + * @param location A location in a subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription trial availability on successful completion of {@link Mono}. + * @return subscription quotas on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkTrialAvailabilityAsync(String location) { - final Sku sku = null; - return checkTrialAvailabilityWithResponseAsync(location, sku).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono checkQuotaAvailabilityAsync(String location) { + return checkQuotaAvailabilityWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Return trial status for subscription by region. + * Return quota for subscription by region. * - * @param location The name of the Azure region. - * @param sku Optionally, check for a specific SKU. + * @param location A location in a subscription. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription trial availability along with {@link Response}. + * @return subscription quotas along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkTrialAvailabilityWithResponse(String location, Sku sku, Context context) { - return checkTrialAvailabilityWithResponseAsync(location, sku, context).block(); + public Response checkQuotaAvailabilityWithResponse(String location, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return service.checkQuotaAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context); } /** - * Return trial status for subscription by region. + * Return quota for subscription by region. * - * @param location The name of the Azure region. + * @param location A location in a subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription trial availability. + * @return subscription quotas. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TrialInner checkTrialAvailability(String location) { - final Sku sku = null; - return checkTrialAvailabilityWithResponse(location, sku, Context.NONE).getValue(); + public QuotaInner checkQuotaAvailability(String location) { + return checkQuotaAvailabilityWithResponse(location, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(LocationsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsImpl.java index 74c26507054d..cb4abf7f62df 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -28,39 +28,39 @@ public LocationsImpl(LocationsClient innerClient, com.azure.resourcemanager.avs. this.serviceManager = serviceManager; } - public Response checkQuotaAvailabilityWithResponse(String location, Context context) { - Response inner = this.serviceClient().checkQuotaAvailabilityWithResponse(location, context); + public Response checkTrialAvailabilityWithResponse(String location, Sku sku, Context context) { + Response inner = this.serviceClient().checkTrialAvailabilityWithResponse(location, sku, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new QuotaImpl(inner.getValue(), this.manager())); + new TrialImpl(inner.getValue(), this.manager())); } else { return null; } } - public Quota checkQuotaAvailability(String location) { - QuotaInner inner = this.serviceClient().checkQuotaAvailability(location); + public Trial checkTrialAvailability(String location) { + TrialInner inner = this.serviceClient().checkTrialAvailability(location); if (inner != null) { - return new QuotaImpl(inner, this.manager()); + return new TrialImpl(inner, this.manager()); } else { return null; } } - public Response checkTrialAvailabilityWithResponse(String location, Sku sku, Context context) { - Response inner = this.serviceClient().checkTrialAvailabilityWithResponse(location, sku, context); + public Response checkQuotaAvailabilityWithResponse(String location, Context context) { + Response inner = this.serviceClient().checkQuotaAvailabilityWithResponse(location, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new TrialImpl(inner.getValue(), this.manager())); + new QuotaImpl(inner.getValue(), this.manager())); } else { return null; } } - public Trial checkTrialAvailability(String location) { - TrialInner inner = this.serviceClient().checkTrialAvailability(location); + public Quota checkQuotaAvailability(String location) { + QuotaInner inner = this.serviceClient().checkQuotaAvailability(location); if (inner != null) { - return new TrialImpl(inner, this.manager()); + return new QuotaImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationImpl.java index 71b1ec5903a1..582b45fd69e1 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsClientImpl.java index ab37aaed4fe1..f0206c1d8f78 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -25,9 +25,10 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.OperationsClient; import com.azure.resourcemanager.avs.fluent.models.OperationInner; -import com.azure.resourcemanager.avs.models.OperationListResult; +import com.azure.resourcemanager.avs.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -59,14 +60,21 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for AvsClientOperations to be used by the proxy service to perform REST * calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.AVS/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AVS/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,7 +82,14 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -103,24 +118,14 @@ private Mono> listSinglePageAsync() { /** * List the operations for the provider. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ - @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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -128,12 +133,20 @@ private Mono> listSinglePageAsync(Context context) * * @throws 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}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -143,13 +156,20 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -162,7 +182,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -177,7 +197,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -206,6 +226,33 @@ private Mono> listNextSinglePageAsync(String nextL .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -214,22 +261,24 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsImpl.java index 18874dc0aeff..d95c138012a2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPoliciesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPoliciesClientImpl.java index 315221c4b5fb..9ba480edcd07 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPoliciesClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPoliciesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -28,13 +28,15 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.PlacementPoliciesClient; import com.azure.resourcemanager.avs.fluent.models.PlacementPolicyInner; -import com.azure.resourcemanager.avs.models.PlacementPoliciesList; +import com.azure.resourcemanager.avs.implementation.models.PlacementPoliciesList; import com.azure.resourcemanager.avs.models.PlacementPolicyUpdate; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -69,14 +71,24 @@ public final class PlacementPoliciesClientImpl implements PlacementPoliciesClien * The interface defining all the services for AvsClientPlacementPolicies to be used by the proxy service to perform * REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientPlacementPo") public interface PlacementPoliciesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @@ -86,7 +98,7 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @@ -94,34 +106,76 @@ Mono> get(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @PathParam("placementPolicyName") String placementPolicyName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @PathParam("placementPolicyName") String placementPolicyName, - @BodyParam("application/json") PlacementPolicyInner placementPolicy, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PlacementPolicyInner placementPolicy, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @PathParam("placementPolicyName") String placementPolicyName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PlacementPolicyInner placementPolicy, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @PathParam("placementPolicyName") String placementPolicyName, - @BodyParam("application/json") PlacementPolicyUpdate placementPolicyUpdate, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PlacementPolicyUpdate placementPolicyUpdate, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @PathParam("placementPolicyName") String placementPolicyName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PlacementPolicyUpdate placementPolicyUpdate, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @PathParam("placementPolicyName") String placementPolicyName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @@ -133,7 +187,14 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -185,42 +246,16 @@ private Mono> listSinglePageAsync(String res * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PlacementPolicy list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a PlacementPolicy list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateCloudName, String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, clusterName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -232,13 +267,38 @@ private Mono> listSinglePageAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PlacementPolicy list operation as paginated response with {@link PagedFlux}. + * @return the response of a PlacementPolicy list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String clusterName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName), - nextLink -> listNextSinglePageAsync(nextLink)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -251,13 +311,38 @@ private PagedFlux listAsync(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PlacementPolicy list operation as paginated response with {@link PagedFlux}. + * @return the response of a PlacementPolicy list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String clusterName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -274,7 +359,8 @@ private PagedFlux listAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, clusterName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, clusterName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -292,7 +378,8 @@ public PagedIterable list(String resourceGroupName, String @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, clusterName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, clusterName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -341,51 +428,6 @@ private Mono> getWithResponseAsync(String resourc .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a PlacementPolicy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param placementPolicyName Name of the placement 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 PlacementPolicy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, - String clusterName, String placementPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (placementPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, clusterName, placementPolicyName, accept, context); - } - /** * Get a PlacementPolicy. * @@ -421,8 +463,35 @@ private Mono getAsync(String resourceGroupName, String pri @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, clusterName, placementPolicyName, accept, context); } /** @@ -490,11 +559,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { placementPolicy.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, placementPolicyName, - placementPolicy, accept, context)) + contentType, accept, placementPolicy, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -506,51 +576,51 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. * @param placementPolicy Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 vSphere Distributed Resource Scheduler (DRS) placement policy along with {@link Response} on successful - * completion of {@link Mono}. + * @return a vSphere Distributed Resource Scheduler (DRS) placement policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyInner placementPolicy, - Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String placementPolicyName, PlacementPolicyInner placementPolicy) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (placementPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); } if (placementPolicy == null) { - return Mono - .error(new IllegalArgumentException("Parameter placementPolicy is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicy is required and cannot be null.")); } else { placementPolicy.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, placementPolicyName, - placementPolicy, accept, context); + contentType, accept, placementPolicy, Context.NONE); } /** @@ -561,19 +631,52 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. * @param placementPolicy Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a vSphere Distributed Resource Scheduler (DRS) placement policy. + * @return a vSphere Distributed Resource Scheduler (DRS) placement policy along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PlacementPolicyInner> beginCreateOrUpdateAsync( - String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, - PlacementPolicyInner placementPolicy) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, - clusterName, placementPolicyName, placementPolicy); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - PlacementPolicyInner.class, PlacementPolicyInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String placementPolicyName, PlacementPolicyInner placementPolicy, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } + if (placementPolicy == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicy is required and cannot be null.")); + } else { + placementPolicy.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, placementPolicyName, + contentType, accept, placementPolicy, context); } /** @@ -584,7 +687,6 @@ private PollerFlux, PlacementPolicyInner> begin * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. * @param placementPolicy Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -593,12 +695,11 @@ private PollerFlux, PlacementPolicyInner> begin @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PlacementPolicyInner> beginCreateOrUpdateAsync( String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, - PlacementPolicyInner placementPolicy, Context context) { - context = this.client.mergeContext(context); + PlacementPolicyInner placementPolicy) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, - clusterName, placementPolicyName, placementPolicy, context); + clusterName, placementPolicyName, placementPolicy); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - PlacementPolicyInner.class, PlacementPolicyInner.class, context); + PlacementPolicyInner.class, PlacementPolicyInner.class, this.client.getContext()); } /** @@ -618,10 +719,10 @@ private PollerFlux, PlacementPolicyInner> begin public SyncPoller, PlacementPolicyInner> beginCreateOrUpdate( String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyInner placementPolicy) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, - placementPolicy) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, privateCloudName, clusterName, + placementPolicyName, placementPolicy); + return this.client.getLroResult(response, + PlacementPolicyInner.class, PlacementPolicyInner.class, Context.NONE); } /** @@ -642,10 +743,10 @@ public SyncPoller, PlacementPolicyInner> beginC public SyncPoller, PlacementPolicyInner> beginCreateOrUpdate( String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyInner placementPolicy, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, - placementPolicy, context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, privateCloudName, clusterName, + placementPolicyName, placementPolicy, context); + return this.client.getLroResult(response, + PlacementPolicyInner.class, PlacementPolicyInner.class, context); } /** @@ -668,27 +769,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, placementPolicy).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a PlacementPolicy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param placementPolicyName Name of the placement policy. - * @param placementPolicy Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 vSphere Distributed Resource Scheduler (DRS) placement policy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String privateCloudName, - String clusterName, String placementPolicyName, PlacementPolicyInner placementPolicy, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, - placementPolicy, context).last().flatMap(this.client::getLroFinalResultOrError); - } - /** * Create a PlacementPolicy. * @@ -705,8 +785,8 @@ private Mono createOrUpdateAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public PlacementPolicyInner createOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyInner placementPolicy) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, - placementPolicy).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, clusterName, placementPolicyName, + placementPolicy).getFinalResult(); } /** @@ -726,8 +806,8 @@ public PlacementPolicyInner createOrUpdate(String resourceGroupName, String priv @ServiceMethod(returns = ReturnType.SINGLE) public PlacementPolicyInner createOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyInner placementPolicy, Context context) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, - placementPolicy, context).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, clusterName, placementPolicyName, + placementPolicy, context).getFinalResult(); } /** @@ -737,7 +817,7 @@ public PlacementPolicyInner createOrUpdate(String resourceGroupName, String priv * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. + * @param placementPolicyUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -776,11 +856,12 @@ private Mono>> updateWithResponseAsync(String resource } else { placementPolicyUpdate.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, placementPolicyName, - placementPolicyUpdate, accept, context)) + contentType, accept, placementPolicyUpdate, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -791,51 +872,52 @@ private Mono>> updateWithResponseAsync(String resource * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. - * @param context The context to associate with this operation. + * @param placementPolicyUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 vSphere Distributed Resource Scheduler (DRS) placement policy along with {@link Response} on successful - * completion of {@link Mono}. + * @return a vSphere Distributed Resource Scheduler (DRS) placement policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String privateCloudName, - String clusterName, String placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Context context) { + private Response updateWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (placementPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); } if (placementPolicyUpdate == null) { - return Mono - .error(new IllegalArgumentException("Parameter placementPolicyUpdate is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyUpdate is required and cannot be null.")); } else { placementPolicyUpdate.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicyUpdate, accept, - context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, placementPolicyName, + contentType, accept, placementPolicyUpdate, Context.NONE); } /** @@ -845,20 +927,53 @@ private Mono>> updateWithResponseAsync(String resource * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. + * @param placementPolicyUpdate The resource properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a vSphere Distributed Resource Scheduler (DRS) placement policy. + * @return a vSphere Distributed Resource Scheduler (DRS) placement policy along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PlacementPolicyInner> beginUpdateAsync( - String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, - PlacementPolicyUpdate placementPolicyUpdate) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, privateCloudName, - clusterName, placementPolicyName, placementPolicyUpdate); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - PlacementPolicyInner.class, PlacementPolicyInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } + if (placementPolicyUpdate == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyUpdate is required and cannot be null.")); + } else { + placementPolicyUpdate.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, placementPolicyName, + contentType, accept, placementPolicyUpdate, context); } /** @@ -868,8 +983,7 @@ private PollerFlux, PlacementPolicyInner> begin * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. - * @param context The context to associate with this operation. + * @param placementPolicyUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -878,12 +992,11 @@ private PollerFlux, PlacementPolicyInner> begin @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PlacementPolicyInner> beginUpdateAsync( String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, - PlacementPolicyUpdate placementPolicyUpdate, Context context) { - context = this.client.mergeContext(context); + PlacementPolicyUpdate placementPolicyUpdate) { Mono>> mono = updateWithResponseAsync(resourceGroupName, privateCloudName, - clusterName, placementPolicyName, placementPolicyUpdate, context); + clusterName, placementPolicyName, placementPolicyUpdate); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - PlacementPolicyInner.class, PlacementPolicyInner.class, context); + PlacementPolicyInner.class, PlacementPolicyInner.class, this.client.getContext()); } /** @@ -893,7 +1006,7 @@ private PollerFlux, PlacementPolicyInner> begin * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. + * @param placementPolicyUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -903,10 +1016,10 @@ private PollerFlux, PlacementPolicyInner> begin public SyncPoller, PlacementPolicyInner> beginUpdate(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate) { - return this - .beginUpdateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, - placementPolicyUpdate) - .getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, privateCloudName, clusterName, + placementPolicyName, placementPolicyUpdate); + return this.client.getLroResult(response, + PlacementPolicyInner.class, PlacementPolicyInner.class, Context.NONE); } /** @@ -916,7 +1029,7 @@ public SyncPoller, PlacementPolicyInner> beginU * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. + * @param placementPolicyUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -927,10 +1040,10 @@ public SyncPoller, PlacementPolicyInner> beginU public SyncPoller, PlacementPolicyInner> beginUpdate(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Context context) { - return this - .beginUpdateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, - placementPolicyUpdate, context) - .getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, privateCloudName, clusterName, + placementPolicyName, placementPolicyUpdate, context); + return this.client.getLroResult(response, + PlacementPolicyInner.class, PlacementPolicyInner.class, context); } /** @@ -940,7 +1053,7 @@ public SyncPoller, PlacementPolicyInner> beginU * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. + * @param placementPolicyUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -960,28 +1073,7 @@ private Mono updateAsync(String resourceGroupName, String * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 vSphere Distributed Resource Scheduler (DRS) placement policy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String privateCloudName, - String clusterName, String placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Context context) { - return beginUpdateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, - placementPolicyUpdate, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a PlacementPolicy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. + * @param placementPolicyUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -990,8 +1082,8 @@ private Mono updateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public PlacementPolicyInner update(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate) { - return updateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicyUpdate) - .block(); + return beginUpdate(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicyUpdate) + .getFinalResult(); } /** @@ -1001,7 +1093,7 @@ public PlacementPolicyInner update(String resourceGroupName, String privateCloud * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement policy. - * @param placementPolicyUpdate The placement policy properties to be updated. + * @param placementPolicyUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1011,8 +1103,8 @@ public PlacementPolicyInner update(String resourceGroupName, String privateCloud @ServiceMethod(returns = ReturnType.SINGLE) public PlacementPolicyInner update(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Context context) { - return updateAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicyUpdate, - context).block(); + return beginUpdate(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicyUpdate, + context).getFinalResult(); } /** @@ -1068,42 +1160,44 @@ private Mono>> deleteWithResponseAsync(String resource * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, - String clusterName, String placementPolicyName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String placementPolicyName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (placementPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, clusterName, placementPolicyName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, placementPolicyName, + accept, Context.NONE); } /** @@ -1113,18 +1207,45 @@ private Mono>> deleteWithResponseAsync(String resource * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String clusterName, String placementPolicyName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String placementPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, placementPolicyName, + accept, context); } /** @@ -1134,7 +1255,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param placementPolicyName Name of the placement 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. @@ -1142,12 +1262,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String clusterName, String placementPolicyName, Context context) { - context = this.client.mergeContext(context); + String clusterName, String placementPolicyName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, context); + = deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1165,8 +1284,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName) - .getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, privateCloudName, clusterName, placementPolicyName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1185,8 +1305,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, Context context) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, context) - .getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, privateCloudName, clusterName, placementPolicyName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1208,26 +1329,6 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a PlacementPolicy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param placementPolicyName Name of the placement 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 privateCloudName, String clusterName, - String placementPolicyName, Context context) { - return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a PlacementPolicy. * @@ -1242,7 +1343,7 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName) { - deleteAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName).block(); + beginDelete(resourceGroupName, privateCloudName, clusterName, placementPolicyName).getFinalResult(); } /** @@ -1260,7 +1361,7 @@ public void delete(String resourceGroupName, String privateCloudName, String clu @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, Context context) { - deleteAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, context).block(); + beginDelete(resourceGroupName, privateCloudName, clusterName, placementPolicyName, context).getFinalResult(); } /** @@ -1289,6 +1390,33 @@ private Mono> listNextSinglePageAsync(String .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PlacementPolicy list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1297,22 +1425,25 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PlacementPolicy list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a PlacementPolicy list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(PlacementPoliciesClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPoliciesImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPoliciesImpl.java index f834360a33f7..b2053d8cf91c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPoliciesImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPoliciesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPolicyImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPolicyImpl.java index 6f9a44ad744e..b569436390db 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPolicyImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPolicyImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java index 5faa5fd4dc6c..10e81d913a77 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -10,18 +10,14 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; import com.azure.resourcemanager.avs.models.AdminCredentials; -import com.azure.resourcemanager.avs.models.AvailabilityProperties; -import com.azure.resourcemanager.avs.models.Circuit; import com.azure.resourcemanager.avs.models.DnsZoneType; import com.azure.resourcemanager.avs.models.Encryption; -import com.azure.resourcemanager.avs.models.Endpoints; import com.azure.resourcemanager.avs.models.IdentitySource; import com.azure.resourcemanager.avs.models.InternetEnum; import com.azure.resourcemanager.avs.models.ManagementCluster; -import com.azure.resourcemanager.avs.models.NsxPublicIpQuotaRaisedEnum; import com.azure.resourcemanager.avs.models.PrivateCloud; import com.azure.resourcemanager.avs.models.PrivateCloudIdentity; -import com.azure.resourcemanager.avs.models.PrivateCloudProvisioningState; +import com.azure.resourcemanager.avs.models.PrivateCloudProperties; import com.azure.resourcemanager.avs.models.PrivateCloudUpdate; import com.azure.resourcemanager.avs.models.Sku; import java.util.Collections; @@ -58,6 +54,10 @@ public Map tags() { } } + public PrivateCloudProperties properties() { + return this.innerModel().properties(); + } + public Sku sku() { return this.innerModel().sku(); } @@ -66,37 +66,8 @@ public PrivateCloudIdentity identity() { return this.innerModel().identity(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ManagementCluster managementCluster() { - return this.innerModel().managementCluster(); - } - - public InternetEnum internet() { - return this.innerModel().internet(); - } - - public List identitySources() { - List inner = this.innerModel().identitySources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public AvailabilityProperties availability() { - return this.innerModel().availability(); - } - - public Encryption encryption() { - return this.innerModel().encryption(); - } - - public List extendedNetworkBlocks() { - List inner = this.innerModel().extendedNetworkBlocks(); + public List zones() { + List inner = this.innerModel().zones(); if (inner != null) { return Collections.unmodifiableList(inner); } else { @@ -104,73 +75,8 @@ public List extendedNetworkBlocks() { } } - public PrivateCloudProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public Circuit circuit() { - return this.innerModel().circuit(); - } - - public Endpoints endpoints() { - return this.innerModel().endpoints(); - } - - public String networkBlock() { - return this.innerModel().networkBlock(); - } - - public String managementNetwork() { - return this.innerModel().managementNetwork(); - } - - public String provisioningNetwork() { - return this.innerModel().provisioningNetwork(); - } - - public String vmotionNetwork() { - return this.innerModel().vmotionNetwork(); - } - - public String vcenterPassword() { - return this.innerModel().vcenterPassword(); - } - - public String nsxtPassword() { - return this.innerModel().nsxtPassword(); - } - - public String vcenterCertificateThumbprint() { - return this.innerModel().vcenterCertificateThumbprint(); - } - - public String nsxtCertificateThumbprint() { - return this.innerModel().nsxtCertificateThumbprint(); - } - - public List externalCloudLinks() { - List inner = this.innerModel().externalCloudLinks(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Circuit secondaryCircuit() { - return this.innerModel().secondaryCircuit(); - } - - public NsxPublicIpQuotaRaisedEnum nsxPublicIpQuotaRaised() { - return this.innerModel().nsxPublicIpQuotaRaised(); - } - - public String virtualNetworkId() { - return this.innerModel().virtualNetworkId(); - } - - public DnsZoneType dnsZoneType() { - return this.innerModel().dnsZoneType(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -266,13 +172,12 @@ public PrivateCloud refresh(Context context) { return this; } - public Response listAdminCredentialsWithResponse(Context context) { - return serviceManager.privateClouds() - .listAdminCredentialsWithResponse(resourceGroupName, privateCloudName, context); + public void rotateVcenterPassword() { + serviceManager.privateClouds().rotateVcenterPassword(resourceGroupName, privateCloudName); } - public AdminCredentials listAdminCredentials() { - return serviceManager.privateClouds().listAdminCredentials(resourceGroupName, privateCloudName); + public void rotateVcenterPassword(Context context) { + serviceManager.privateClouds().rotateVcenterPassword(resourceGroupName, privateCloudName, context); } public void rotateNsxtPassword() { @@ -283,12 +188,13 @@ public void rotateNsxtPassword(Context context) { serviceManager.privateClouds().rotateNsxtPassword(resourceGroupName, privateCloudName, context); } - public void rotateVcenterPassword() { - serviceManager.privateClouds().rotateVcenterPassword(resourceGroupName, privateCloudName); + public Response listAdminCredentialsWithResponse(Context context) { + return serviceManager.privateClouds() + .listAdminCredentialsWithResponse(resourceGroupName, privateCloudName, context); } - public void rotateVcenterPassword(Context context) { - serviceManager.privateClouds().rotateVcenterPassword(resourceGroupName, privateCloudName, context); + public AdminCredentials listAdminCredentials() { + return serviceManager.privateClouds().listAdminCredentials(resourceGroupName, privateCloudName); } public PrivateCloudImpl withRegion(Region location) { @@ -321,109 +227,54 @@ public PrivateCloudImpl withTags(Map tags) { } } - public PrivateCloudImpl withIdentity(PrivateCloudIdentity identity) { - if (isInCreateMode()) { - this.innerModel().withIdentity(identity); - return this; - } else { - this.updatePrivateCloudUpdate.withIdentity(identity); - return this; - } - } - - public PrivateCloudImpl withManagementCluster(ManagementCluster managementCluster) { - if (isInCreateMode()) { - this.innerModel().withManagementCluster(managementCluster); - return this; - } else { - this.updatePrivateCloudUpdate.withManagementCluster(managementCluster); - return this; - } - } - - public PrivateCloudImpl withInternet(InternetEnum internet) { - if (isInCreateMode()) { - this.innerModel().withInternet(internet); - return this; - } else { - this.updatePrivateCloudUpdate.withInternet(internet); - return this; - } - } - - public PrivateCloudImpl withIdentitySources(List identitySources) { - if (isInCreateMode()) { - this.innerModel().withIdentitySources(identitySources); - return this; - } else { - this.updatePrivateCloudUpdate.withIdentitySources(identitySources); - return this; - } - } - - public PrivateCloudImpl withAvailability(AvailabilityProperties availability) { - this.innerModel().withAvailability(availability); + public PrivateCloudImpl withProperties(PrivateCloudProperties properties) { + this.innerModel().withProperties(properties); return this; } - public PrivateCloudImpl withEncryption(Encryption encryption) { - if (isInCreateMode()) { - this.innerModel().withEncryption(encryption); - return this; - } else { - this.updatePrivateCloudUpdate.withEncryption(encryption); - return this; - } - } - - public PrivateCloudImpl withExtendedNetworkBlocks(List extendedNetworkBlocks) { + public PrivateCloudImpl withIdentity(PrivateCloudIdentity identity) { if (isInCreateMode()) { - this.innerModel().withExtendedNetworkBlocks(extendedNetworkBlocks); + this.innerModel().withIdentity(identity); return this; } else { - this.updatePrivateCloudUpdate.withExtendedNetworkBlocks(extendedNetworkBlocks); + this.updatePrivateCloudUpdate.withIdentity(identity); return this; } } - public PrivateCloudImpl withCircuit(Circuit circuit) { - this.innerModel().withCircuit(circuit); + public PrivateCloudImpl withZones(List zones) { + this.innerModel().withZones(zones); return this; } - public PrivateCloudImpl withNetworkBlock(String networkBlock) { - this.innerModel().withNetworkBlock(networkBlock); + public PrivateCloudImpl withManagementCluster(ManagementCluster managementCluster) { + this.updatePrivateCloudUpdate.withManagementCluster(managementCluster); return this; } - public PrivateCloudImpl withVcenterPassword(String vcenterPassword) { - this.innerModel().withVcenterPassword(vcenterPassword); + public PrivateCloudImpl withInternet(InternetEnum internet) { + this.updatePrivateCloudUpdate.withInternet(internet); return this; } - public PrivateCloudImpl withNsxtPassword(String nsxtPassword) { - this.innerModel().withNsxtPassword(nsxtPassword); + public PrivateCloudImpl withIdentitySources(List identitySources) { + this.updatePrivateCloudUpdate.withIdentitySources(identitySources); return this; } - public PrivateCloudImpl withSecondaryCircuit(Circuit secondaryCircuit) { - this.innerModel().withSecondaryCircuit(secondaryCircuit); + public PrivateCloudImpl withEncryption(Encryption encryption) { + this.updatePrivateCloudUpdate.withEncryption(encryption); return this; } - public PrivateCloudImpl withVirtualNetworkId(String virtualNetworkId) { - this.innerModel().withVirtualNetworkId(virtualNetworkId); + public PrivateCloudImpl withExtendedNetworkBlocks(List extendedNetworkBlocks) { + this.updatePrivateCloudUpdate.withExtendedNetworkBlocks(extendedNetworkBlocks); return this; } public PrivateCloudImpl withDnsZoneType(DnsZoneType dnsZoneType) { - if (isInCreateMode()) { - this.innerModel().withDnsZoneType(dnsZoneType); - return this; - } else { - this.updatePrivateCloudUpdate.withDnsZoneType(dnsZoneType); - return this; - } + this.updatePrivateCloudUpdate.withDnsZoneType(dnsZoneType); + return this; } private boolean isInCreateMode() { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java index 7e0ea1bb8cf7..235d8d47938c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -29,14 +29,16 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.PrivateCloudsClient; import com.azure.resourcemanager.avs.fluent.models.AdminCredentialsInner; import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; -import com.azure.resourcemanager.avs.models.PrivateCloudList; +import com.azure.resourcemanager.avs.implementation.models.PrivateCloudList; import com.azure.resourcemanager.avs.models.PrivateCloudUpdate; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -71,83 +73,128 @@ public final class PrivateCloudsClientImpl implements PrivateCloudsClient { * The interface defining all the services for AvsClientPrivateClouds to be used by the proxy service to perform * REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientPrivateClou") public interface PrivateCloudsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, - @BodyParam("application/json") PrivateCloudInner privateCloud, @HeaderParam("Accept") String accept, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PrivateCloudInner privateCloud, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PrivateCloudInner privateCloud, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, - @BodyParam("application/json") PrivateCloudUpdate privateCloudUpdate, @HeaderParam("Accept") String accept, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PrivateCloudUpdate privateCloudUpdate, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PrivateCloudUpdate privateCloudUpdate, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAdminCredentials(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> rotateNsxtPassword(@HostParam("$host") String endpoint, + Mono>> rotateVcenterPassword(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, @@ -157,38 +204,95 @@ Mono>> rotateNsxtPassword(@HostParam("$host") String e @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> rotateVcenterPassword(@HostParam("$host") String endpoint, + Response rotateVcenterPasswordSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> rotateNsxtPassword(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response rotateNsxtPasswordSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAdminCredentials(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listAdminCredentialsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listInSubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @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); + Response listInSubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * List PrivateCloud resources by subscription ID. + * List PrivateCloud resources by 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 the response of a PrivateCloud list operation along with {@link PagedResponse} on successful completion * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + 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.")); @@ -197,87 +301,118 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.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.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, 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 PrivateCloud resources by subscription ID. + * List PrivateCloud resources by resource group. * - * @param context The context to associate with this operation. + * @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 the response of a PrivateCloud list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a PrivateCloud list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * List PrivateCloud resources by subscription ID. + * List PrivateCloud resources by 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 the response of a PrivateCloud list operation as paginated response with {@link PagedFlux}. + * @return the response of a PrivateCloud list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listInSubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List PrivateCloud resources by subscription ID. + * List PrivateCloud resources by 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 the response of a PrivateCloud list operation as paginated response with {@link PagedFlux}. + * @return the response of a PrivateCloud list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listInSubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List PrivateCloud resources by subscription ID. + * List PrivateCloud resources by 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 the response of a PrivateCloud list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listNextSinglePage(nextLink)); } /** - * List PrivateCloud resources by subscription ID. + * List PrivateCloud resources by 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. @@ -285,22 +420,21 @@ public PagedIterable list() { * @return the response of a PrivateCloud list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * List PrivateCloud resources by resource group. + * List PrivateCloud resources by subscription ID. * - * @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 the response of a PrivateCloud list operation along with {@link PagedResponse} on successful completion * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -309,103 +443,97 @@ private Mono> listByResourceGroupSinglePageAsyn return Mono.error(new IllegalArgumentException( "Parameter this.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.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List PrivateCloud resources by resource group. + * List PrivateCloud resources by subscription ID. * - * @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 the response of a PrivateCloud list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a PrivateCloud list operation as paginated response with {@link PagedFlux}. */ - @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.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listInSubscriptionNextSinglePageAsync(nextLink)); } /** - * List PrivateCloud resources by resource group. + * List PrivateCloud resources by subscription ID. * - * @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 the response of a PrivateCloud list operation as paginated response with {@link PagedFlux}. + * @return the response of a PrivateCloud list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List PrivateCloud resources by resource group. + * List PrivateCloud resources by subscription ID. * - * @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 the response of a PrivateCloud list operation as paginated response with {@link PagedFlux}. + * @return the response of a PrivateCloud list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List PrivateCloud resources by resource group. + * List PrivateCloud resources by subscription ID. * - * @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 the response of a PrivateCloud list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listInSubscriptionNextSinglePage(nextLink)); } /** - * List PrivateCloud resources by resource group. + * List PrivateCloud resources by subscription ID. * - * @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. @@ -413,8 +541,9 @@ public PagedIterable listByResourceGroup(String resourceGroup * @return the response of a PrivateCloud list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listInSubscriptionNextSinglePage(nextLink, context)); } /** @@ -453,42 +582,6 @@ private Mono> getByResourceGroupWithResponseAsync(St .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a PrivateCloud. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 PrivateCloud along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); - } - /** * Get a PrivateCloud. * @@ -519,7 +612,27 @@ private Mono getByResourceGroupAsync(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String privateCloudName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, privateCloudName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); } /** @@ -572,10 +685,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { privateCloud.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, privateCloud, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, contentType, accept, privateCloud, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -585,40 +700,43 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param privateCloud Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 private cloud resource along with {@link Response} on successful completion of {@link Mono}. + * @return a private cloud resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateCloudName, PrivateCloudInner privateCloud, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + PrivateCloudInner privateCloud) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (privateCloud == null) { - return Mono.error(new IllegalArgumentException("Parameter privateCloud is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloud is required and cannot be null.")); } else { privateCloud.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, privateCloud, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, contentType, accept, privateCloud, + Context.NONE); } /** @@ -627,18 +745,44 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param privateCloud Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a private cloud resource. + * @return a private cloud resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PrivateCloudInner> - beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, privateCloud); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - PrivateCloudInner.class, PrivateCloudInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + PrivateCloudInner privateCloud, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (privateCloud == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloud is required and cannot be null.")); + } else { + privateCloud.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, contentType, accept, privateCloud, + context); } /** @@ -647,20 +791,18 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param privateCloud Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of a private cloud resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PrivateCloudInner> beginCreateOrUpdateAsync( - String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, PrivateCloudInner> + beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, privateCloud, context); + = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, privateCloud); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - PrivateCloudInner.class, PrivateCloudInner.class, context); + PrivateCloudInner.class, PrivateCloudInner.class, this.client.getContext()); } /** @@ -677,7 +819,9 @@ private PollerFlux, PrivateCloudInner> beginCreate @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateCloudInner> beginCreateOrUpdate(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, privateCloud).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, privateCloudName, privateCloud); + return this.client.getLroResult(response, PrivateCloudInner.class, + PrivateCloudInner.class, Context.NONE); } /** @@ -695,8 +839,10 @@ public SyncPoller, PrivateCloudInner> beginCreateO @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateCloudInner> beginCreateOrUpdate(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, privateCloud, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, privateCloud, context); + return this.client.getLroResult(response, PrivateCloudInner.class, + PrivateCloudInner.class, context); } /** @@ -717,25 +863,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, St .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a PrivateCloud. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param privateCloud Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private cloud resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String privateCloudName, - PrivateCloudInner privateCloud, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, privateCloud, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Create a PrivateCloud. * @@ -750,7 +877,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public PrivateCloudInner createOrUpdate(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, privateCloud).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, privateCloud).getFinalResult(); } /** @@ -768,7 +895,7 @@ public PrivateCloudInner createOrUpdate(String resourceGroupName, String private @ServiceMethod(returns = ReturnType.SINGLE) public PrivateCloudInner createOrUpdate(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, Context context) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, privateCloud, context).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, privateCloud, context).getFinalResult(); } /** @@ -776,7 +903,7 @@ public PrivateCloudInner createOrUpdate(String resourceGroupName, String private * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. + * @param privateCloudUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -807,9 +934,12 @@ private Mono>> updateWithResponseAsync(String resource } else { privateCloudUpdate.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, privateCloudUpdate, accept, context)) + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, contentType, accept, + privateCloudUpdate, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -818,42 +948,90 @@ private Mono>> updateWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. + * @param privateCloudUpdate The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private cloud resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String privateCloudName, + PrivateCloudUpdate privateCloudUpdate) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (privateCloudUpdate == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudUpdate is required and cannot be null.")); + } else { + privateCloudUpdate.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, contentType, accept, + privateCloudUpdate, Context.NONE); + } + + /** + * Update a PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 private cloud resource along with {@link Response} on successful completion of {@link Mono}. + * @return a private cloud resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String privateCloudName, + private Response updateWithResponse(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (privateCloudUpdate == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudUpdate is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudUpdate is required and cannot be null.")); } else { privateCloudUpdate.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, privateCloudUpdate, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, contentType, accept, + privateCloudUpdate, context); } /** @@ -861,7 +1039,7 @@ private Mono>> updateWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. + * @param privateCloudUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -881,29 +1059,7 @@ private PollerFlux, PrivateCloudInner> beginUpdate * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a private cloud resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PrivateCloudInner> beginUpdateAsync(String resourceGroupName, - String privateCloudName, PrivateCloudUpdate privateCloudUpdate, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, privateCloudName, privateCloudUpdate, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - PrivateCloudInner.class, PrivateCloudInner.class, context); - } - - /** - * Update a PrivateCloud. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. + * @param privateCloudUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -912,7 +1068,9 @@ private PollerFlux, PrivateCloudInner> beginUpdate @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateCloudInner> beginUpdate(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { - return this.beginUpdateAsync(resourceGroupName, privateCloudName, privateCloudUpdate).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, privateCloudName, privateCloudUpdate); + return this.client.getLroResult(response, PrivateCloudInner.class, + PrivateCloudInner.class, Context.NONE); } /** @@ -920,7 +1078,7 @@ public SyncPoller, PrivateCloudInner> beginUpdate( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. + * @param privateCloudUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -930,7 +1088,10 @@ public SyncPoller, PrivateCloudInner> beginUpdate( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateCloudInner> beginUpdate(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, Context context) { - return this.beginUpdateAsync(resourceGroupName, privateCloudName, privateCloudUpdate, context).getSyncPoller(); + Response response + = updateWithResponse(resourceGroupName, privateCloudName, privateCloudUpdate, context); + return this.client.getLroResult(response, PrivateCloudInner.class, + PrivateCloudInner.class, context); } /** @@ -938,7 +1099,7 @@ public SyncPoller, PrivateCloudInner> beginUpdate( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. + * @param privateCloudUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -956,26 +1117,7 @@ private Mono updateAsync(String resourceGroupName, String pri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private cloud resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String privateCloudName, - PrivateCloudUpdate privateCloudUpdate, Context context) { - return beginUpdateAsync(resourceGroupName, privateCloudName, privateCloudUpdate, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a PrivateCloud. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. + * @param privateCloudUpdate The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -984,7 +1126,7 @@ private Mono updateAsync(String resourceGroupName, String pri @ServiceMethod(returns = ReturnType.SINGLE) public PrivateCloudInner update(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { - return updateAsync(resourceGroupName, privateCloudName, privateCloudUpdate).block(); + return beginUpdate(resourceGroupName, privateCloudName, privateCloudUpdate).getFinalResult(); } /** @@ -992,7 +1134,7 @@ public PrivateCloudInner update(String resourceGroupName, String privateCloudNam * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param privateCloudUpdate The private cloud properties to be updated. + * @param privateCloudUpdate The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1002,7 +1144,7 @@ public PrivateCloudInner update(String resourceGroupName, String privateCloudNam @ServiceMethod(returns = ReturnType.SINGLE) public PrivateCloudInner update(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, Context context) { - return updateAsync(resourceGroupName, privateCloudName, privateCloudUpdate, context).block(); + return beginUpdate(resourceGroupName, privateCloudName, privateCloudUpdate, context).getFinalResult(); } /** @@ -1046,35 +1188,34 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, - Context context) { + private Response deleteWithResponse(String resourceGroupName, String privateCloudName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); } /** @@ -1082,16 +1223,36 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateCloudName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); } /** @@ -1099,19 +1260,16 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 privateCloudName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateCloudName, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateCloudName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1126,7 +1284,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, privateCloudName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1143,7 +1302,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, Context context) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, privateCloudName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1162,23 +1322,6 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a PrivateCloud. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 privateCloudName, Context context) { - return beginDeleteAsync(resourceGroupName, privateCloudName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a PrivateCloud. * @@ -1190,7 +1333,7 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName) { - deleteAsync(resourceGroupName, privateCloudName).block(); + beginDelete(resourceGroupName, privateCloudName).getFinalResult(); } /** @@ -1205,22 +1348,21 @@ public void delete(String resourceGroupName, String privateCloudName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, Context context) { - deleteAsync(resourceGroupName, privateCloudName, context).block(); + beginDelete(resourceGroupName, privateCloudName, context).getFinalResult(); } /** - * List the admin credentials for the private cloud. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return administrative credentials for accessing vCenter and NSX-T along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAdminCredentialsWithResponseAsync(String resourceGroupName, + private Mono>> rotateVcenterPasswordWithResponseAsync(String resourceGroupName, String privateCloudName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1240,134 +1382,49 @@ private Mono> listAdminCredentialsWithResponseAs } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAdminCredentials(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + .withContext( + context -> service.rotateVcenterPassword(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List the admin credentials for the private cloud. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return administrative credentials for accessing vCenter and NSX-T along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAdminCredentialsWithResponseAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAdminCredentials(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); - } - - /** - * List the admin credentials for the private cloud. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return administrative credentials for accessing vCenter and NSX-T on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAdminCredentialsAsync(String resourceGroupName, String privateCloudName) { - return listAdminCredentialsWithResponseAsync(resourceGroupName, privateCloudName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * List the admin credentials for the private cloud. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return administrative credentials for accessing vCenter and NSX-T along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAdminCredentialsWithResponse(String resourceGroupName, - String privateCloudName, Context context) { - return listAdminCredentialsWithResponseAsync(resourceGroupName, privateCloudName, context).block(); - } - - /** - * List the admin credentials for the private cloud. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return administrative credentials for accessing vCenter and NSX-T. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdminCredentialsInner listAdminCredentials(String resourceGroupName, String privateCloudName) { - return listAdminCredentialsWithResponse(resourceGroupName, privateCloudName, Context.NONE).getValue(); - } - - /** - * Rotate the NSX-T Manager password. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> rotateNsxtPasswordWithResponseAsync(String resourceGroupName, - String privateCloudName) { + private Response rotateVcenterPasswordWithResponse(String resourceGroupName, String privateCloudName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.rotateNsxtPassword(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.rotateVcenterPasswordSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); } /** - * Rotate the NSX-T Manager password. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. @@ -1375,35 +1432,36 @@ private Mono>> rotateNsxtPasswordWithResponseAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> rotateNsxtPasswordWithResponseAsync(String resourceGroupName, - String privateCloudName, Context context) { + private Response rotateVcenterPasswordWithResponse(String resourceGroupName, String privateCloudName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.rotateNsxtPassword(this.client.getEndpoint(), this.client.getApiVersion(), + return service.rotateVcenterPasswordSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); } /** - * Rotate the NSX-T Manager password. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. @@ -1413,103 +1471,67 @@ private Mono>> rotateNsxtPasswordWithResponseAsync(Str * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRotateNsxtPasswordAsync(String resourceGroupName, + private PollerFlux, Void> beginRotateVcenterPasswordAsync(String resourceGroupName, String privateCloudName) { Mono>> mono - = rotateNsxtPasswordWithResponseAsync(resourceGroupName, privateCloudName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Rotate the NSX-T Manager password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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> beginRotateNsxtPasswordAsync(String resourceGroupName, - String privateCloudName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = rotateNsxtPasswordWithResponseAsync(resourceGroupName, privateCloudName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Rotate the NSX-T Manager password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked 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> beginRotateNsxtPassword(String resourceGroupName, - String privateCloudName) { - return this.beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName).getSyncPoller(); + = rotateVcenterPasswordWithResponseAsync(resourceGroupName, privateCloudName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Rotate the NSX-T Manager password. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked 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> beginRotateNsxtPassword(String resourceGroupName, String privateCloudName, - Context context) { - return this.beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName, context).getSyncPoller(); + public SyncPoller, Void> beginRotateVcenterPassword(String resourceGroupName, + String privateCloudName) { + Response response = rotateVcenterPasswordWithResponse(resourceGroupName, privateCloudName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Rotate the NSX-T Manager password. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono rotateNsxtPasswordAsync(String resourceGroupName, String privateCloudName) { - return beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRotateVcenterPassword(String resourceGroupName, + String privateCloudName, Context context) { + Response response = rotateVcenterPasswordWithResponse(resourceGroupName, privateCloudName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Rotate the NSX-T Manager password. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 rotateNsxtPasswordAsync(String resourceGroupName, String privateCloudName, Context context) { - return beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName, context).last() + private Mono rotateVcenterPasswordAsync(String resourceGroupName, String privateCloudName) { + return beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Rotate the NSX-T Manager password. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. @@ -1518,12 +1540,12 @@ private Mono rotateNsxtPasswordAsync(String resourceGroupName, String priv * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void rotateNsxtPassword(String resourceGroupName, String privateCloudName) { - rotateNsxtPasswordAsync(resourceGroupName, privateCloudName).block(); + public void rotateVcenterPassword(String resourceGroupName, String privateCloudName) { + beginRotateVcenterPassword(resourceGroupName, privateCloudName).getFinalResult(); } /** - * Rotate the NSX-T Manager password. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. @@ -1533,12 +1555,12 @@ public void rotateNsxtPassword(String resourceGroupName, String privateCloudName * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context) { - rotateNsxtPasswordAsync(resourceGroupName, privateCloudName, context).block(); + public void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context) { + beginRotateVcenterPassword(resourceGroupName, privateCloudName, context).getFinalResult(); } /** - * Rotate the vCenter password. + * Rotate the NSX-T Manager password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. @@ -1548,7 +1570,7 @@ public void rotateNsxtPassword(String resourceGroupName, String privateCloudName * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> rotateVcenterPasswordWithResponseAsync(String resourceGroupName, + private Mono>> rotateNsxtPasswordWithResponseAsync(String resourceGroupName, String privateCloudName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1568,90 +1590,104 @@ private Mono>> rotateVcenterPasswordWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.rotateVcenterPassword(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + .withContext(context -> service.rotateNsxtPassword(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Rotate the vCenter password. + * Rotate the NSX-T Manager password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> rotateVcenterPasswordWithResponseAsync(String resourceGroupName, - String privateCloudName, Context context) { + private Response rotateNsxtPasswordWithResponse(String resourceGroupName, String privateCloudName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.rotateVcenterPassword(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); + return service.rotateNsxtPasswordSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); } /** - * Rotate the vCenter password. + * Rotate the NSX-T Manager password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRotateVcenterPasswordAsync(String resourceGroupName, - String privateCloudName) { - Mono>> mono - = rotateVcenterPasswordWithResponseAsync(resourceGroupName, privateCloudName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response rotateNsxtPasswordWithResponse(String resourceGroupName, String privateCloudName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.rotateNsxtPasswordSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); } /** - * Rotate the vCenter password. + * Rotate the NSX-T Manager password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginRotateVcenterPasswordAsync(String resourceGroupName, - String privateCloudName, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, Void> beginRotateNsxtPasswordAsync(String resourceGroupName, + String privateCloudName) { Mono>> mono - = rotateVcenterPasswordWithResponseAsync(resourceGroupName, privateCloudName, context); + = rotateNsxtPasswordWithResponseAsync(resourceGroupName, privateCloudName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** - * Rotate the vCenter password. + * Rotate the NSX-T Manager password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. @@ -1661,13 +1697,14 @@ private PollerFlux, Void> beginRotateVcenterPasswordAsync(Strin * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRotateVcenterPassword(String resourceGroupName, + public SyncPoller, Void> beginRotateNsxtPassword(String resourceGroupName, String privateCloudName) { - return this.beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName).getSyncPoller(); + Response response = rotateNsxtPasswordWithResponse(resourceGroupName, privateCloudName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Rotate the vCenter password. + * Rotate the NSX-T Manager password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. @@ -1678,13 +1715,14 @@ public SyncPoller, Void> beginRotateVcenterPassword(String reso * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRotateVcenterPassword(String resourceGroupName, - String privateCloudName, Context context) { - return this.beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName, context).getSyncPoller(); + public SyncPoller, Void> beginRotateNsxtPassword(String resourceGroupName, String privateCloudName, + Context context) { + Response response = rotateNsxtPasswordWithResponse(resourceGroupName, privateCloudName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Rotate the vCenter password. + * Rotate the NSX-T Manager password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. @@ -1694,13 +1732,27 @@ public SyncPoller, Void> beginRotateVcenterPassword(String reso * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono rotateVcenterPasswordAsync(String resourceGroupName, String privateCloudName) { - return beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName).last() + private Mono rotateNsxtPasswordAsync(String resourceGroupName, String privateCloudName) { + return beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Rotate the vCenter password. + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 rotateNsxtPassword(String resourceGroupName, String privateCloudName) { + beginRotateNsxtPassword(resourceGroupName, privateCloudName).getFinalResult(); + } + + /** + * Rotate the NSX-T Manager password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. @@ -1708,30 +1760,67 @@ private Mono rotateVcenterPasswordAsync(String resourceGroupName, String p * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 rotateVcenterPasswordAsync(String resourceGroupName, String privateCloudName, Context context) { - return beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context) { + beginRotateNsxtPassword(resourceGroupName, privateCloudName, context).getFinalResult(); } /** - * Rotate the vCenter password. + * List the admin credentials for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAdminCredentialsWithResponseAsync(String resourceGroupName, + String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAdminCredentials(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the admin credentials for the private cloud. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void rotateVcenterPassword(String resourceGroupName, String privateCloudName) { - rotateVcenterPasswordAsync(resourceGroupName, privateCloudName).block(); + private Mono listAdminCredentialsAsync(String resourceGroupName, String privateCloudName) { + return listAdminCredentialsWithResponseAsync(resourceGroupName, privateCloudName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Rotate the vCenter password. + * List the admin credentials for the private cloud. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. @@ -1739,10 +1828,47 @@ public void rotateVcenterPassword(String resourceGroupName, String privateCloudN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context) { - rotateVcenterPasswordAsync(resourceGroupName, privateCloudName, context).block(); + public Response listAdminCredentialsWithResponse(String resourceGroupName, + String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listAdminCredentialsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); + } + + /** + * List the admin credentials for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AdminCredentialsInner listAdminCredentials(String resourceGroupName, String privateCloudName) { + return listAdminCredentialsWithResponse(resourceGroupName, privateCloudName, Context.NONE).getValue(); } /** @@ -1756,7 +1882,7 @@ public void rotateVcenterPassword(String resourceGroupName, String privateCloudN * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInSubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1765,14 +1891,39 @@ private Mono> listInSubscriptionNextSinglePageA new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listInSubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateCloud list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1781,24 +1932,23 @@ private Mono> listInSubscriptionNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PrivateCloud list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a PrivateCloud list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInSubscriptionNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listInSubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1812,7 +1962,7 @@ private Mono> listInSubscriptionNextSinglePageA * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listInSubscriptionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1821,12 +1971,41 @@ private Mono> listNextSinglePageAsync(String ne 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)) + return FluxUtil + .withContext( + context -> service.listInSubscriptionNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateCloud list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listInSubscriptionNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listInSubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1835,22 +2014,25 @@ private Mono> listNextSinglePageAsync(String ne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PrivateCloud list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a PrivateCloud list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listInSubscriptionNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listInSubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateCloudsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java index 26069246d296..b06033b8fb3b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -28,23 +28,23 @@ public PrivateCloudsImpl(PrivateCloudsClient innerClient, com.azure.resourcemana this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateCloudImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateCloudImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateCloudImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateCloudImpl(inner1, this.manager())); } @@ -77,6 +77,22 @@ public void delete(String resourceGroupName, String privateCloudName, Context co this.serviceClient().delete(resourceGroupName, privateCloudName, context); } + public void rotateVcenterPassword(String resourceGroupName, String privateCloudName) { + this.serviceClient().rotateVcenterPassword(resourceGroupName, privateCloudName); + } + + public void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context) { + this.serviceClient().rotateVcenterPassword(resourceGroupName, privateCloudName, context); + } + + public void rotateNsxtPassword(String resourceGroupName, String privateCloudName) { + this.serviceClient().rotateNsxtPassword(resourceGroupName, privateCloudName); + } + + public void rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context) { + this.serviceClient().rotateNsxtPassword(resourceGroupName, privateCloudName, context); + } + public Response listAdminCredentialsWithResponse(String resourceGroupName, String privateCloudName, Context context) { Response inner @@ -98,22 +114,6 @@ public AdminCredentials listAdminCredentials(String resourceGroupName, String pr } } - public void rotateNsxtPassword(String resourceGroupName, String privateCloudName) { - this.serviceClient().rotateNsxtPassword(resourceGroupName, privateCloudName); - } - - public void rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context) { - this.serviceClient().rotateNsxtPassword(resourceGroupName, privateCloudName, context); - } - - public void rotateVcenterPassword(String resourceGroupName, String privateCloudName) { - this.serviceClient().rotateVcenterPassword(resourceGroupName, privateCloudName); - } - - public void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context) { - this.serviceClient().rotateVcenterPassword(resourceGroupName, privateCloudName, context); - } - public PrivateCloud getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworkImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworkImpl.java new file mode 100644 index 000000000000..31b4280fa12c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworkImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.avs.fluent.models.ProvisionedNetworkInner; +import com.azure.resourcemanager.avs.models.ProvisionedNetwork; +import com.azure.resourcemanager.avs.models.ProvisionedNetworkProperties; + +public final class ProvisionedNetworkImpl implements ProvisionedNetwork { + private ProvisionedNetworkInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + ProvisionedNetworkImpl(ProvisionedNetworkInner innerObject, + com.azure.resourcemanager.avs.AvsManager 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 ProvisionedNetworkProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisionedNetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworksClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworksClientImpl.java new file mode 100644 index 000000000000..d647034fafe4 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworksClientImpl.java @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.ProvisionedNetworksClient; +import com.azure.resourcemanager.avs.fluent.models.ProvisionedNetworkInner; +import com.azure.resourcemanager.avs.implementation.models.ProvisionedNetworkListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProvisionedNetworksClient. + */ +public final class ProvisionedNetworksClientImpl implements ProvisionedNetworksClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProvisionedNetworksService service; + + /** + * The service client containing this operation class. + */ + private final AvsClientImpl client; + + /** + * Initializes an instance of ProvisionedNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProvisionedNetworksClientImpl(AvsClientImpl client) { + this.service = RestProxy.create(ProvisionedNetworksService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientProvisionedNetworks to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "AvsClientProvisioned") + public interface ProvisionedNetworksService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/provisionedNetworks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/provisionedNetworks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/provisionedNetworks/{provisionedNetworkName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("provisionedNetworkName") String provisionedNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/provisionedNetworks/{provisionedNetworkName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("provisionedNetworkName") String provisionedNetworkName, @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ProvisionedNetwork resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, 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 ProvisionedNetwork resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List ProvisionedNetwork resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List ProvisionedNetwork resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List ProvisionedNetwork resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List ProvisionedNetwork resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get a ProvisionedNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param provisionedNetworkName Name of the cloud link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ProvisionedNetwork along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String privateCloudName, String provisionedNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (provisionedNetworkName == null) { + return Mono.error( + new IllegalArgumentException("Parameter provisionedNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, provisionedNetworkName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ProvisionedNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param provisionedNetworkName Name of the cloud link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ProvisionedNetwork on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String privateCloudName, + String provisionedNetworkName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, provisionedNetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ProvisionedNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param provisionedNetworkName Name of the cloud link. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ProvisionedNetwork along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String privateCloudName, + String provisionedNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (provisionedNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter provisionedNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, provisionedNetworkName, accept, context); + } + + /** + * Get a ProvisionedNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param provisionedNetworkName Name of the cloud link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ProvisionedNetwork. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProvisionedNetworkInner get(String resourceGroupName, String privateCloudName, + String provisionedNetworkName) { + return getWithResponse(resourceGroupName, privateCloudName, provisionedNetworkName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(ProvisionedNetworksClientImpl.class); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworksImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworksImpl.java new file mode 100644 index 000000000000..1ed83c668a21 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworksImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.ProvisionedNetworksClient; +import com.azure.resourcemanager.avs.fluent.models.ProvisionedNetworkInner; +import com.azure.resourcemanager.avs.models.ProvisionedNetwork; +import com.azure.resourcemanager.avs.models.ProvisionedNetworks; + +public final class ProvisionedNetworksImpl implements ProvisionedNetworks { + private static final ClientLogger LOGGER = new ClientLogger(ProvisionedNetworksImpl.class); + + private final ProvisionedNetworksClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public ProvisionedNetworksImpl(ProvisionedNetworksClient innerClient, + com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProvisionedNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, privateCloudName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProvisionedNetworkImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String privateCloudName, + String provisionedNetworkName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, privateCloudName, provisionedNetworkName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProvisionedNetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProvisionedNetwork get(String resourceGroupName, String privateCloudName, String provisionedNetworkName) { + ProvisionedNetworkInner inner + = this.serviceClient().get(resourceGroupName, privateCloudName, provisionedNetworkName); + if (inner != null) { + return new ProvisionedNetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + private ProvisionedNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/QuotaImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/QuotaImpl.java index b36fd06002ea..0f23f297755a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/QuotaImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/QuotaImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ResourceManagerUtils.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ResourceManagerUtils.java index 502692ff6d0a..42a0bed0a6f7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ResourceManagerUtils.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ResourceSkuImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ResourceSkuImpl.java new file mode 100644 index 000000000000..d7b06ea3f050 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ResourceSkuImpl.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.ResourceSkuInner; +import com.azure.resourcemanager.avs.models.ResourceSku; +import com.azure.resourcemanager.avs.models.ResourceSkuCapabilities; +import com.azure.resourcemanager.avs.models.ResourceSkuLocationInfo; +import com.azure.resourcemanager.avs.models.ResourceSkuResourceType; +import com.azure.resourcemanager.avs.models.ResourceSkuRestrictions; +import java.util.Collections; +import java.util.List; + +public final class ResourceSkuImpl implements ResourceSku { + private ResourceSkuInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + ResourceSkuImpl(ResourceSkuInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ResourceSkuResourceType resourceType() { + return this.innerModel().resourceType(); + } + + public String name() { + return this.innerModel().name(); + } + + public String tier() { + return this.innerModel().tier(); + } + + public String size() { + return this.innerModel().size(); + } + + public String family() { + return this.innerModel().family(); + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List locationInfo() { + List inner = this.innerModel().locationInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List capabilities() { + List inner = this.innerModel().capabilities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletImpl.java index 5f05cd19ffd6..98cad17d6995 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletImpl.java @@ -1,17 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; import com.azure.core.management.SystemData; import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner; import com.azure.resourcemanager.avs.models.ScriptCmdlet; -import com.azure.resourcemanager.avs.models.ScriptCmdletAudience; -import com.azure.resourcemanager.avs.models.ScriptCmdletProvisioningState; -import com.azure.resourcemanager.avs.models.ScriptParameter; -import java.util.Collections; -import java.util.List; +import com.azure.resourcemanager.avs.models.ScriptCmdletProperties; public final class ScriptCmdletImpl implements ScriptCmdlet { private ScriptCmdletInner innerObject; @@ -35,33 +31,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ScriptCmdletProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String description() { - return this.innerModel().description(); + public ScriptCmdletProperties properties() { + return this.innerModel().properties(); } - public String timeout() { - return this.innerModel().timeout(); - } - - public ScriptCmdletAudience audience() { - return this.innerModel().audience(); - } - - public List parameters() { - List inner = this.innerModel().parameters(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public SystemData systemData() { + return this.innerModel().systemData(); } public ScriptCmdletInner innerModel() { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsClientImpl.java index 7a41e65b04b3..b80a4ea126e1 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -25,9 +25,10 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.ScriptCmdletsClient; import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner; -import com.azure.resourcemanager.avs.models.ScriptCmdletsList; +import com.azure.resourcemanager.avs.implementation.models.ScriptCmdletsList; import reactor.core.publisher.Mono; /** @@ -59,25 +60,48 @@ public final class ScriptCmdletsClientImpl implements ScriptCmdletsClient { * The interface defining all the services for AvsClientScriptCmdlets to be used by the proxy service to perform * REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientScriptCmdle") public interface ScriptCmdletsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("scriptPackageName") String scriptPackageName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptPackageName") String scriptPackageName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptPackageName") String scriptPackageName, + @PathParam("scriptCmdletName") String scriptCmdletName, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @@ -90,7 +114,14 @@ Mono> get(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -142,43 +173,16 @@ private Mono> listSinglePageAsync(String resour * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param scriptPackageName Name of the script package. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ScriptCmdlet list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a ScriptCmdlet list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateCloudName, String scriptPackageName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (scriptPackageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, scriptPackageName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + String scriptPackageName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, scriptPackageName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -190,13 +194,39 @@ private Mono> listSinglePageAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ScriptCmdlet list operation as paginated response with {@link PagedFlux}. + * @return the response of a ScriptCmdlet list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String scriptPackageName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, scriptPackageName), - nextLink -> listNextSinglePageAsync(nextLink)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, scriptPackageName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -209,14 +239,38 @@ private PagedFlux listAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ScriptCmdlet list operation as paginated response with {@link PagedFlux}. + * @return the response of a ScriptCmdlet list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String scriptPackageName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, privateCloudName, scriptPackageName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptPackageName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -233,7 +287,8 @@ private PagedFlux listAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, String scriptPackageName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, scriptPackageName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, scriptPackageName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -251,7 +306,9 @@ public PagedIterable list(String resourceGroupName, String pr @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, String scriptPackageName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, scriptPackageName, context)); + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, privateCloudName, scriptPackageName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -301,52 +358,6 @@ private Mono> getWithResponseAsync(String resourceGr .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a ScriptCmdlet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param scriptPackageName Name of the script package. - * @param scriptCmdletName Name of the script cmdlet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 ScriptCmdlet along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, - String scriptPackageName, String scriptCmdletName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (scriptPackageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); - } - if (scriptCmdletName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scriptCmdletName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, scriptPackageName, scriptCmdletName, accept, context); - } - /** * Get a ScriptCmdlet. * @@ -382,8 +393,35 @@ private Mono getAsync(String resourceGroupName, String privat @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String scriptPackageName, String scriptCmdletName, Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, scriptPackageName, scriptCmdletName, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } + if (scriptCmdletName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptCmdletName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, scriptPackageName, scriptCmdletName, accept, context); } /** @@ -431,6 +469,33 @@ private Mono> listNextSinglePageAsync(String ne .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ScriptCmdlet list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -439,22 +504,24 @@ private Mono> listNextSinglePageAsync(String ne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ScriptCmdlet list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a ScriptCmdlet list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptCmdletsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsImpl.java index a935e62ffb64..6835222c336d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionImpl.java index 06233fd7ea5e..a082271d7102 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -9,13 +9,9 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.ScriptExecutionInner; import com.azure.resourcemanager.avs.models.ScriptExecution; -import com.azure.resourcemanager.avs.models.ScriptExecutionParameter; -import com.azure.resourcemanager.avs.models.ScriptExecutionProvisioningState; +import com.azure.resourcemanager.avs.models.ScriptExecutionProperties; import com.azure.resourcemanager.avs.models.ScriptOutputStreamType; -import java.time.OffsetDateTime; -import java.util.Collections; import java.util.List; -import java.util.Map; public final class ScriptExecutionImpl implements ScriptExecution, ScriptExecution.Definition, ScriptExecution.Update { private ScriptExecutionInner innerObject; @@ -34,103 +30,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String scriptCmdletId() { - return this.innerModel().scriptCmdletId(); - } - - public List parameters() { - List inner = this.innerModel().parameters(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List hiddenParameters() { - List inner = this.innerModel().hiddenParameters(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String failureReason() { - return this.innerModel().failureReason(); - } - - public String timeout() { - return this.innerModel().timeout(); - } - - public String retention() { - return this.innerModel().retention(); + public ScriptExecutionProperties properties() { + return this.innerModel().properties(); } - public OffsetDateTime submittedAt() { - return this.innerModel().submittedAt(); - } - - public OffsetDateTime startedAt() { - return this.innerModel().startedAt(); - } - - public OffsetDateTime finishedAt() { - return this.innerModel().finishedAt(); - } - - public ScriptExecutionProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public List output() { - List inner = this.innerModel().output(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Map namedOutputs() { - Map inner = this.innerModel().namedOutputs(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public List information() { - List inner = this.innerModel().information(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List warnings() { - List inner = this.innerModel().warnings(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List errors() { - List inner = this.innerModel().errors(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -231,43 +136,8 @@ public ScriptExecution getExecutionLogs() { .getExecutionLogs(resourceGroupName, privateCloudName, scriptExecutionName); } - public ScriptExecutionImpl withScriptCmdletId(String scriptCmdletId) { - this.innerModel().withScriptCmdletId(scriptCmdletId); - return this; - } - - public ScriptExecutionImpl withParameters(List parameters) { - this.innerModel().withParameters(parameters); - return this; - } - - public ScriptExecutionImpl withHiddenParameters(List hiddenParameters) { - this.innerModel().withHiddenParameters(hiddenParameters); - return this; - } - - public ScriptExecutionImpl withFailureReason(String failureReason) { - this.innerModel().withFailureReason(failureReason); - return this; - } - - public ScriptExecutionImpl withTimeout(String timeout) { - this.innerModel().withTimeout(timeout); - return this; - } - - public ScriptExecutionImpl withRetention(String retention) { - this.innerModel().withRetention(retention); - return this; - } - - public ScriptExecutionImpl withOutput(List output) { - this.innerModel().withOutput(output); - return this; - } - - public ScriptExecutionImpl withNamedOutputs(Map namedOutputs) { - this.innerModel().withNamedOutputs(namedOutputs); + public ScriptExecutionImpl withProperties(ScriptExecutionProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsClientImpl.java index 8d400d3d99cf..9f71fa5ce96a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -28,13 +28,15 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.ScriptExecutionsClient; import com.azure.resourcemanager.avs.fluent.models.ScriptExecutionInner; -import com.azure.resourcemanager.avs.models.ScriptExecutionsList; +import com.azure.resourcemanager.avs.implementation.models.ScriptExecutionsList; import com.azure.resourcemanager.avs.models.ScriptOutputStreamType; import java.nio.ByteBuffer; import java.util.List; @@ -70,14 +72,24 @@ public final class ScriptExecutionsClientImpl implements ScriptExecutionsClient * The interface defining all the services for AvsClientScriptExecutions to be used by the proxy service to perform * REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientScriptExecu") public interface ScriptExecutionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, @@ -87,7 +99,7 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @@ -95,22 +107,54 @@ Mono> get(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptExecutionName") String scriptExecutionName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptExecutionName") String scriptExecutionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScriptExecutionInner scriptExecution, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("scriptExecutionName") String scriptExecutionName, - @BodyParam("application/json") ScriptExecutionInner scriptExecution, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScriptExecutionInner scriptExecution, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptExecutionName") String scriptExecutionName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @@ -121,20 +165,37 @@ Mono>> delete(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}/getExecutionLogs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getExecutionLogs(@HostParam("$host") String endpoint, + Mono> getExecutionLogs(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, - @PathParam("scriptExecutionName") String scriptExecutionName, - @BodyParam("application/json") List scriptOutputStreamType, - @HeaderParam("Accept") String accept, Context context); + @PathParam("scriptExecutionName") String scriptExecutionName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") List scriptOutputStreamType, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}/getExecutionLogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getExecutionLogsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptExecutionName") String scriptExecutionName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") List scriptOutputStreamType, 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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -181,39 +242,15 @@ private Mono> listSinglePageAsync(String res * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ScriptExecution list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a ScriptExecution list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -224,12 +261,33 @@ private Mono> listSinglePageAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ScriptExecution list operation as paginated response with {@link PagedFlux}. + * @return the response of a ScriptExecution list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -241,13 +299,34 @@ private PagedFlux listAsync(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ScriptExecution list operation as paginated response with {@link PagedFlux}. + * @return the response of a ScriptExecution list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -262,7 +341,8 @@ private PagedFlux listAsync(String resourceGroupName, Stri */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -279,7 +359,8 @@ public PagedIterable list(String resourceGroupName, String @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -322,47 +403,6 @@ private Mono> getWithResponseAsync(String resourc .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a ScriptExecution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param scriptExecutionName Name of the script cmdlet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 ScriptExecution along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, - String scriptExecutionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (scriptExecutionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, scriptExecutionName, accept, context); - } - /** * Get a ScriptExecution. * @@ -396,7 +436,31 @@ private Mono getAsync(String resourceGroupName, String pri @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, scriptExecutionName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, scriptExecutionName, accept, context); } /** @@ -457,11 +521,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { scriptExecution.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, - scriptExecution, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, contentType, + accept, scriptExecution, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -472,47 +537,47 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param scriptExecutionName Name of the script cmdlet. * @param scriptExecution Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an instance of a script executed by a user - custom or AVS along with {@link Response} on successful - * completion of {@link Mono}. + * @return an instance of a script executed by a user - custom or AVS along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateCloudName, String scriptExecutionName, ScriptExecutionInner scriptExecution, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String scriptExecutionName, ScriptExecutionInner scriptExecution) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (scriptExecutionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); } if (scriptExecution == null) { - return Mono - .error(new IllegalArgumentException("Parameter scriptExecution is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecution is required and cannot be null.")); } else { scriptExecution.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution, - accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, contentType, + accept, scriptExecution, Context.NONE); } /** @@ -522,19 +587,48 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param privateCloudName Name of the private cloud. * @param scriptExecutionName Name of the script cmdlet. * @param scriptExecution Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an instance of a script executed by a user - custom or AVS. + * @return an instance of a script executed by a user - custom or AVS along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ScriptExecutionInner> beginCreateOrUpdateAsync( - String resourceGroupName, String privateCloudName, String scriptExecutionName, - ScriptExecutionInner scriptExecution) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, - scriptExecutionName, scriptExecution); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ScriptExecutionInner.class, ScriptExecutionInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + String scriptExecutionName, ScriptExecutionInner scriptExecution, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + if (scriptExecution == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecution is required and cannot be null.")); + } else { + scriptExecution.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, contentType, + accept, scriptExecution, context); } /** @@ -544,7 +638,6 @@ private PollerFlux, ScriptExecutionInner> begin * @param privateCloudName Name of the private cloud. * @param scriptExecutionName Name of the script cmdlet. * @param scriptExecution Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -553,12 +646,11 @@ private PollerFlux, ScriptExecutionInner> begin @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ScriptExecutionInner> beginCreateOrUpdateAsync( String resourceGroupName, String privateCloudName, String scriptExecutionName, - ScriptExecutionInner scriptExecution, Context context) { - context = this.client.mergeContext(context); + ScriptExecutionInner scriptExecution) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, - scriptExecutionName, scriptExecution, context); + scriptExecutionName, scriptExecution); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ScriptExecutionInner.class, ScriptExecutionInner.class, context); + ScriptExecutionInner.class, ScriptExecutionInner.class, this.client.getContext()); } /** @@ -577,8 +669,10 @@ private PollerFlux, ScriptExecutionInner> begin public SyncPoller, ScriptExecutionInner> beginCreateOrUpdate( String resourceGroupName, String privateCloudName, String scriptExecutionName, ScriptExecutionInner scriptExecution) { - return this.beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution); + return this.client.getLroResult(response, + ScriptExecutionInner.class, ScriptExecutionInner.class, Context.NONE); } /** @@ -598,10 +692,10 @@ public SyncPoller, ScriptExecutionInner> beginC public SyncPoller, ScriptExecutionInner> beginCreateOrUpdate( String resourceGroupName, String privateCloudName, String scriptExecutionName, ScriptExecutionInner scriptExecution, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution, - context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, privateCloudName, + scriptExecutionName, scriptExecution, context); + return this.client.getLroResult(response, + ScriptExecutionInner.class, ScriptExecutionInner.class, context); } /** @@ -624,26 +718,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create a ScriptExecution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param scriptExecutionName Name of the script cmdlet. - * @param scriptExecution Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an instance of a script executed by a user - custom or AVS on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String privateCloudName, - String scriptExecutionName, ScriptExecutionInner scriptExecution, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - /** * Create a ScriptExecution. * @@ -659,7 +733,8 @@ private Mono createOrUpdateAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public ScriptExecutionInner createOrUpdate(String resourceGroupName, String privateCloudName, String scriptExecutionName, ScriptExecutionInner scriptExecution) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution).block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution) + .getFinalResult(); } /** @@ -678,8 +753,8 @@ public ScriptExecutionInner createOrUpdate(String resourceGroupName, String priv @ServiceMethod(returns = ReturnType.SINGLE) public ScriptExecutionInner createOrUpdate(String resourceGroupName, String privateCloudName, String scriptExecutionName, ScriptExecutionInner scriptExecution, Context context) { - return createOrUpdateAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution, context) - .block(); + return beginCreateOrUpdate(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution, context) + .getFinalResult(); } /** @@ -728,39 +803,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param scriptExecutionName Name of the script cmdlet. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, - String scriptExecutionName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String scriptExecutionName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (scriptExecutionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, scriptExecutionName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, accept, + Context.NONE); } /** @@ -769,18 +845,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param scriptExecutionName Name of the script cmdlet. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String scriptExecutionName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, scriptExecutionName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String privateCloudName, + String scriptExecutionName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, accept, context); } /** @@ -789,7 +887,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param scriptExecutionName Name of the script cmdlet. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -797,12 +894,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName, - String scriptExecutionName, Context context) { - context = this.client.mergeContext(context); + String scriptExecutionName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateCloudName, scriptExecutionName, context); + = deleteWithResponseAsync(resourceGroupName, privateCloudName, scriptExecutionName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -819,7 +915,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String scriptExecutionName) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, scriptExecutionName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, privateCloudName, scriptExecutionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -837,7 +934,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context) { - return this.beginDeleteAsync(resourceGroupName, privateCloudName, scriptExecutionName, context).getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, privateCloudName, scriptExecutionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -857,25 +956,6 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a ScriptExecution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param scriptExecutionName Name of the script cmdlet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 privateCloudName, String scriptExecutionName, - Context context) { - return beginDeleteAsync(resourceGroupName, privateCloudName, scriptExecutionName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a ScriptExecution. * @@ -888,7 +968,7 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String scriptExecutionName) { - deleteAsync(resourceGroupName, privateCloudName, scriptExecutionName).block(); + beginDelete(resourceGroupName, privateCloudName, scriptExecutionName).getFinalResult(); } /** @@ -904,7 +984,7 @@ public void delete(String resourceGroupName, String privateCloudName, String scr */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context) { - deleteAsync(resourceGroupName, privateCloudName, scriptExecutionName, context).block(); + beginDelete(resourceGroupName, privateCloudName, scriptExecutionName, context).getFinalResult(); } /** @@ -947,57 +1027,11 @@ private Mono> getExecutionLogsWithResponseAsync(S final String accept = "application/json"; return FluxUtil .withContext(context -> service.getExecutionLogs(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, - scriptOutputStreamType, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, accept, + scriptOutputStreamType, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Return the logs for a script execution resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param scriptExecutionName Name of the script cmdlet. - * @param scriptOutputStreamType Name of the desired output stream to return. If not provided, will return all. An - * empty array will return nothing. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an instance of a script executed by a user - custom or AVS along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getExecutionLogsWithResponseAsync(String resourceGroupName, - String privateCloudName, String scriptExecutionName, List scriptOutputStreamType, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (scriptExecutionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getExecutionLogs(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, - scriptOutputStreamType, accept, context); - } - /** * Return the logs for a script execution resource. * @@ -1035,8 +1069,32 @@ private Mono getExecutionLogsAsync(String resourceGroupNam public Response getExecutionLogsWithResponse(String resourceGroupName, String privateCloudName, String scriptExecutionName, List scriptOutputStreamType, Context context) { - return getExecutionLogsWithResponseAsync(resourceGroupName, privateCloudName, scriptExecutionName, - scriptOutputStreamType, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getExecutionLogsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, accept, + scriptOutputStreamType, context); } /** @@ -1084,6 +1142,33 @@ private Mono> listNextSinglePageAsync(String .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ScriptExecution list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1092,22 +1177,24 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ScriptExecution list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a ScriptExecution list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptExecutionsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsImpl.java index 22a9eeb7535e..6815b319f0bd 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackageImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackageImpl.java index 84b03be05d64..40ee66dde60b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackageImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackageImpl.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; import com.azure.core.management.SystemData; import com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner; import com.azure.resourcemanager.avs.models.ScriptPackage; -import com.azure.resourcemanager.avs.models.ScriptPackageProvisioningState; +import com.azure.resourcemanager.avs.models.ScriptPackageProperties; public final class ScriptPackageImpl implements ScriptPackage { private ScriptPackageInner innerObject; @@ -31,28 +31,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ScriptPackageProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String description() { - return this.innerModel().description(); + public ScriptPackageProperties properties() { + return this.innerModel().properties(); } - public String version() { - return this.innerModel().version(); - } - - public String company() { - return this.innerModel().company(); - } - - public String uri() { - return this.innerModel().uri(); + public SystemData systemData() { + return this.innerModel().systemData(); } public ScriptPackageInner innerModel() { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesClientImpl.java index e39f30b20756..b70f2bc0a69a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -25,9 +25,10 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.ScriptPackagesClient; import com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner; -import com.azure.resourcemanager.avs.models.ScriptPackagesList; +import com.azure.resourcemanager.avs.implementation.models.ScriptPackagesList; import reactor.core.publisher.Mono; /** @@ -59,24 +60,45 @@ public final class ScriptPackagesClientImpl implements ScriptPackagesClient { * The interface defining all the services for AvsClientScriptPackages to be used by the proxy service to perform * REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientScriptPacka") public interface ScriptPackagesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptPackageName") String scriptPackageName, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @@ -88,7 +110,14 @@ Mono> get(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -135,39 +164,15 @@ private Mono> listSinglePageAsync(String resou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ScriptPackage list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a ScriptPackage list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -178,12 +183,33 @@ private Mono> listSinglePageAsync(String resou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ScriptPackage list operation as paginated response with {@link PagedFlux}. + * @return the response of a ScriptPackage list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -195,13 +221,34 @@ private PagedFlux listAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ScriptPackage list operation as paginated response with {@link PagedFlux}. + * @return the response of a ScriptPackage list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -216,7 +263,8 @@ private PagedFlux listAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -232,7 +280,8 @@ public PagedIterable list(String resourceGroupName, String p */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -275,47 +324,6 @@ private Mono> getWithResponseAsync(String resourceG .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a ScriptPackage. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param scriptPackageName Name of the script package. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 ScriptPackage along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, - String scriptPackageName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (scriptPackageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, scriptPackageName, accept, context); - } - /** * Get a ScriptPackage. * @@ -349,7 +357,31 @@ private Mono getAsync(String resourceGroupName, String priva @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String scriptPackageName, Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, scriptPackageName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, scriptPackageName, accept, context); } /** @@ -394,6 +426,33 @@ private Mono> listNextSinglePageAsync(String n .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ScriptPackage list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -402,22 +461,24 @@ private Mono> listNextSinglePageAsync(String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a ScriptPackage list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a ScriptPackage list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptPackagesClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesImpl.java index 7290241ccce6..952cb1c3a3d2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/SkusClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/SkusClientImpl.java new file mode 100644 index 000000000000..0246dbb18ea8 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/SkusClientImpl.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.SkusClient; +import com.azure.resourcemanager.avs.fluent.models.ResourceSkuInner; +import com.azure.resourcemanager.avs.implementation.models.PagedResourceSku; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SkusClient. + */ +public final class SkusClientImpl implements SkusClient { + /** + * The proxy service used to perform REST calls. + */ + private final SkusService service; + + /** + * The service client containing this operation class. + */ + private final AvsClientImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(AvsClientImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientSkus to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "AvsClientSkus") + public interface SkusService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/skus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/skus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * A list of SKUs. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A list of SKUs. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * A list of SKUs. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * A list of SKUs. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * A list of SKUs. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * A list of SKUs. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(SkusClientImpl.class); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/SkusImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/SkusImpl.java new file mode 100644 index 000000000000..3e03f84c3114 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/SkusImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.SkusClient; +import com.azure.resourcemanager.avs.fluent.models.ResourceSkuInner; +import com.azure.resourcemanager.avs.models.ResourceSku; +import com.azure.resourcemanager.avs.models.Skus; + +public final class SkusImpl implements Skus { + private static final ClientLogger LOGGER = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public SkusImpl(SkusClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceSkuImpl(inner1, this.manager())); + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/TrialImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/TrialImpl.java index f88b14d500e7..5879989614aa 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/TrialImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/TrialImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachineImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachineImpl.java index d1a268fd18d5..e0b12c59ada2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachineImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachineImpl.java @@ -1,14 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; import com.azure.core.management.SystemData; import com.azure.resourcemanager.avs.fluent.models.VirtualMachineInner; import com.azure.resourcemanager.avs.models.VirtualMachine; -import com.azure.resourcemanager.avs.models.VirtualMachineProvisioningState; -import com.azure.resourcemanager.avs.models.VirtualMachineRestrictMovementState; +import com.azure.resourcemanager.avs.models.VirtualMachineProperties; public final class VirtualMachineImpl implements VirtualMachine { private VirtualMachineInner innerObject; @@ -32,28 +31,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public VirtualMachineProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String displayName() { - return this.innerModel().displayName(); + public VirtualMachineProperties properties() { + return this.innerModel().properties(); } - public String moRefId() { - return this.innerModel().moRefId(); - } - - public String folderPath() { - return this.innerModel().folderPath(); - } - - public VirtualMachineRestrictMovementState restrictMovement() { - return this.innerModel().restrictMovement(); + public SystemData systemData() { + return this.innerModel().systemData(); } public VirtualMachineInner innerModel() { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachinesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachinesClientImpl.java index 0ab9572552ee..52e0c0d937a1 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachinesClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachinesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -26,14 +26,16 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.VirtualMachinesClient; import com.azure.resourcemanager.avs.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.avs.implementation.models.VirtualMachinesList; import com.azure.resourcemanager.avs.models.VirtualMachineRestrictMovement; -import com.azure.resourcemanager.avs.models.VirtualMachinesList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,14 +69,24 @@ public final class VirtualMachinesClientImpl implements VirtualMachinesClient { * The interface defining all the services for AvsClientVirtualMachines to be used by the proxy service to perform * REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientVirtualMach") public interface VirtualMachinesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @@ -84,7 +96,7 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, @@ -92,23 +104,51 @@ Mono> get(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @PathParam("virtualMachineId") String virtualMachineId, @HeaderParam("Accept") String accept, + Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restrictMovement(@HostParam("$host") String endpoint, + Mono>> restrictMovement(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, - @PathParam("virtualMachineId") String virtualMachineId, - @BodyParam("application/json") VirtualMachineRestrictMovement restrictMovement, - @HeaderParam("Accept") String accept, Context context); + @PathParam("virtualMachineId") String virtualMachineId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") VirtualMachineRestrictMovement restrictMovement, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response restrictMovementSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("clusterName") String clusterName, + @PathParam("virtualMachineId") String virtualMachineId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") VirtualMachineRestrictMovement restrictMovement, 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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -160,42 +200,16 @@ private Mono> listSinglePageAsync(String reso * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a VirtualMachine list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a VirtualMachine list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateCloudName, String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, clusterName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -207,13 +221,38 @@ private Mono> listSinglePageAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a VirtualMachine list operation as paginated response with {@link PagedFlux}. + * @return the response of a VirtualMachine list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String clusterName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName), - nextLink -> listNextSinglePageAsync(nextLink)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -226,13 +265,38 @@ private PagedFlux listAsync(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a VirtualMachine list operation as paginated response with {@link PagedFlux}. + * @return the response of a VirtualMachine list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String clusterName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -249,7 +313,8 @@ private PagedFlux listAsync(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, clusterName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, clusterName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -267,7 +332,8 @@ public PagedIterable list(String resourceGroupName, String @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, clusterName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, clusterName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -316,51 +382,6 @@ private Mono> getWithResponseAsync(String resource .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a VirtualMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param virtualMachineId ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 VirtualMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, - String clusterName, String virtualMachineId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (virtualMachineId == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, clusterName, virtualMachineId, accept, context); - } - /** * Get a VirtualMachine. * @@ -396,8 +417,35 @@ private Mono getAsync(String resourceGroupName, String priv @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String virtualMachineId, Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (virtualMachineId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, clusterName, virtualMachineId, accept, context); } /** @@ -426,7 +474,7 @@ public VirtualMachineInner get(String resourceGroupName, String privateCloudName * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -465,11 +513,12 @@ private Mono>> restrictMovementWithResponseAsync(Strin } else { restrictMovement.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.restrictMovement(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, virtualMachineId, - restrictMovement, accept, context)) + contentType, accept, restrictMovement, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -480,51 +529,52 @@ private Mono>> restrictMovementWithResponseAsync(Strin * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. - * @param context The context to associate with this operation. + * @param restrictMovement The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restrictMovementWithResponseAsync(String resourceGroupName, - String privateCloudName, String clusterName, String virtualMachineId, - VirtualMachineRestrictMovement restrictMovement, Context context) { + private Response restrictMovementWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String virtualMachineId, VirtualMachineRestrictMovement restrictMovement) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (virtualMachineId == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); } if (restrictMovement == null) { - return Mono - .error(new IllegalArgumentException("Parameter restrictMovement is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter restrictMovement is required and cannot be null.")); } else { restrictMovement.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.restrictMovement(this.client.getEndpoint(), this.client.getApiVersion(), + return service.restrictMovementSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, virtualMachineId, - restrictMovement, accept, context); + contentType, accept, restrictMovement, Context.NONE); } /** @@ -534,20 +584,53 @@ private Mono>> restrictMovementWithResponseAsync(Strin * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestrictMovementAsync(String resourceGroupName, - String privateCloudName, String clusterName, String virtualMachineId, - VirtualMachineRestrictMovement restrictMovement) { - Mono>> mono = restrictMovementWithResponseAsync(resourceGroupName, privateCloudName, - clusterName, virtualMachineId, restrictMovement); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response restrictMovementWithResponse(String resourceGroupName, String privateCloudName, + String clusterName, String virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (virtualMachineId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } + if (restrictMovement == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter restrictMovement is required and cannot be null.")); + } else { + restrictMovement.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.restrictMovementSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, virtualMachineId, + contentType, accept, restrictMovement, context); } /** @@ -557,8 +640,7 @@ private PollerFlux, Void> beginRestrictMovementAsync(String res * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. - * @param context The context to associate with this operation. + * @param restrictMovement The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -567,12 +649,11 @@ private PollerFlux, Void> beginRestrictMovementAsync(String res @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRestrictMovementAsync(String resourceGroupName, String privateCloudName, String clusterName, String virtualMachineId, - VirtualMachineRestrictMovement restrictMovement, Context context) { - context = this.client.mergeContext(context); + VirtualMachineRestrictMovement restrictMovement) { Mono>> mono = restrictMovementWithResponseAsync(resourceGroupName, privateCloudName, - clusterName, virtualMachineId, restrictMovement, context); + clusterName, virtualMachineId, restrictMovement); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -582,7 +663,7 @@ private PollerFlux, Void> beginRestrictMovementAsync(String res * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -591,10 +672,9 @@ private PollerFlux, Void> beginRestrictMovementAsync(String res @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRestrictMovement(String resourceGroupName, String privateCloudName, String clusterName, String virtualMachineId, VirtualMachineRestrictMovement restrictMovement) { - return this - .beginRestrictMovementAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, - restrictMovement) - .getSyncPoller(); + Response response = restrictMovementWithResponse(resourceGroupName, privateCloudName, clusterName, + virtualMachineId, restrictMovement); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -604,7 +684,7 @@ public SyncPoller, Void> beginRestrictMovement(String resourceG * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -614,10 +694,9 @@ public SyncPoller, Void> beginRestrictMovement(String resourceG @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRestrictMovement(String resourceGroupName, String privateCloudName, String clusterName, String virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Context context) { - return this - .beginRestrictMovementAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, - restrictMovement, context) - .getSyncPoller(); + Response response = restrictMovementWithResponse(resourceGroupName, privateCloudName, clusterName, + virtualMachineId, restrictMovement, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -627,7 +706,7 @@ public SyncPoller, Void> beginRestrictMovement(String resourceG * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -647,28 +726,7 @@ private Mono restrictMovementAsync(String resourceGroupName, String privat * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 restrictMovementAsync(String resourceGroupName, String privateCloudName, String clusterName, - String virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Context context) { - return beginRestrictMovementAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, - restrictMovement, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enable or disable DRS-driven VM movement restriction. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param clusterName Name of the cluster. - * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -676,8 +734,8 @@ private Mono restrictMovementAsync(String resourceGroupName, String privat @ServiceMethod(returns = ReturnType.SINGLE) public void restrictMovement(String resourceGroupName, String privateCloudName, String clusterName, String virtualMachineId, VirtualMachineRestrictMovement restrictMovement) { - restrictMovementAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement) - .block(); + beginRestrictMovement(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement) + .getFinalResult(); } /** @@ -687,7 +745,7 @@ public void restrictMovement(String resourceGroupName, String privateCloudName, * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -696,8 +754,8 @@ public void restrictMovement(String resourceGroupName, String privateCloudName, @ServiceMethod(returns = ReturnType.SINGLE) public void restrictMovement(String resourceGroupName, String privateCloudName, String clusterName, String virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Context context) { - restrictMovementAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement, - context).block(); + beginRestrictMovement(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement, + context).getFinalResult(); } /** @@ -726,6 +784,33 @@ private Mono> listNextSinglePageAsync(String .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VirtualMachine list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -734,22 +819,24 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a VirtualMachine list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a VirtualMachine list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachinesClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachinesImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachinesImpl.java index 51aa0e3684b4..761b520d83dd 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachinesImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachinesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDhcpImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDhcpImpl.java index 750f8d914f70..bd50b77cd1ce 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDhcpImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDhcpImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -52,25 +52,30 @@ private com.azure.resourcemanager.avs.AvsManager manager() { private String privateCloudName; + private String workloadNetworkName; + private String dhcpId; - public WorkloadNetworkDhcpImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + public WorkloadNetworkDhcpImpl withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { this.resourceGroupName = resourceGroupName; this.privateCloudName = privateCloudName; + this.workloadNetworkName = workloadNetworkName; return this; } public WorkloadNetworkDhcp create() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createDhcp(resourceGroupName, privateCloudName, dhcpId, this.innerModel(), Context.NONE); + .createDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, this.innerModel(), + Context.NONE); return this; } public WorkloadNetworkDhcp create(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createDhcp(resourceGroupName, privateCloudName, dhcpId, this.innerModel(), context); + .createDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, this.innerModel(), context); return this; } @@ -87,14 +92,15 @@ public WorkloadNetworkDhcpImpl update() { public WorkloadNetworkDhcp apply() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .updateDhcp(resourceGroupName, privateCloudName, dhcpId, this.innerModel(), Context.NONE); + .updateDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, this.innerModel(), + Context.NONE); return this; } public WorkloadNetworkDhcp apply(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .updateDhcp(resourceGroupName, privateCloudName, dhcpId, this.innerModel(), context); + .updateDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, this.innerModel(), context); return this; } @@ -104,25 +110,10 @@ public WorkloadNetworkDhcp apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.privateCloudName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workloadNetworks"); this.dhcpId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dhcpConfigurations"); } - public WorkloadNetworkDhcp refresh() { - this.innerObject = serviceManager.serviceClient() - .getWorkloadNetworks() - .getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, Context.NONE) - .getValue(); - return this; - } - - public WorkloadNetworkDhcp refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getWorkloadNetworks() - .getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, context) - .getValue(); - return this; - } - public WorkloadNetworkDhcpImpl withProperties(WorkloadNetworkDhcpEntity properties) { this.innerModel().withProperties(properties); return this; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsServiceImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsServiceImpl.java index 38bed7102c23..a8ed55072c66 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsServiceImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsServiceImpl.java @@ -1,18 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; -import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; -import com.azure.resourcemanager.avs.models.DnsServiceStatusEnum; import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsService; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProvisioningState; -import java.util.Collections; -import java.util.List; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProperties; public final class WorkloadNetworkDnsServiceImpl implements WorkloadNetworkDnsService, WorkloadNetworkDnsService.Definition, WorkloadNetworkDnsService.Update { @@ -32,45 +28,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); + public WorkloadNetworkDnsServiceProperties properties() { + return this.innerModel().properties(); } - public String displayName() { - return this.innerModel().displayName(); - } - - public String dnsServiceIp() { - return this.innerModel().dnsServiceIp(); - } - - public String defaultDnsZone() { - return this.innerModel().defaultDnsZone(); - } - - public List fqdnZones() { - List inner = this.innerModel().fqdnZones(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public DnsServiceLogLevelEnum logLevel() { - return this.innerModel().logLevel(); - } - - public DnsServiceStatusEnum status() { - return this.innerModel().status(); - } - - public WorkloadNetworkDnsServiceProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public Long revision() { - return this.innerModel().revision(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -89,25 +52,31 @@ private com.azure.resourcemanager.avs.AvsManager manager() { private String privateCloudName; + private String workloadNetworkName; + private String dnsServiceId; - public WorkloadNetworkDnsServiceImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + public WorkloadNetworkDnsServiceImpl withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { this.resourceGroupName = resourceGroupName; this.privateCloudName = privateCloudName; + this.workloadNetworkName = workloadNetworkName; return this; } public WorkloadNetworkDnsService create() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createDnsService(resourceGroupName, privateCloudName, dnsServiceId, this.innerModel(), Context.NONE); + .createDnsService(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, this.innerModel(), + Context.NONE); return this; } public WorkloadNetworkDnsService create(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createDnsService(resourceGroupName, privateCloudName, dnsServiceId, this.innerModel(), context); + .createDnsService(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, this.innerModel(), + context); return this; } @@ -124,14 +93,16 @@ public WorkloadNetworkDnsServiceImpl update() { public WorkloadNetworkDnsService apply() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .updateDnsService(resourceGroupName, privateCloudName, dnsServiceId, this.innerModel(), Context.NONE); + .updateDnsService(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, this.innerModel(), + Context.NONE); return this; } public WorkloadNetworkDnsService apply(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .updateDnsService(resourceGroupName, privateCloudName, dnsServiceId, this.innerModel(), context); + .updateDnsService(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, this.innerModel(), + context); return this; } @@ -141,13 +112,15 @@ public WorkloadNetworkDnsService apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.privateCloudName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workloadNetworks"); this.dnsServiceId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dnsServices"); } public WorkloadNetworkDnsService refresh() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, Context.NONE) + .getDnsServiceWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + Context.NONE) .getValue(); return this; } @@ -155,38 +128,13 @@ public WorkloadNetworkDnsService refresh() { public WorkloadNetworkDnsService refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, context) + .getDnsServiceWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, context) .getValue(); return this; } - public WorkloadNetworkDnsServiceImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public WorkloadNetworkDnsServiceImpl withDnsServiceIp(String dnsServiceIp) { - this.innerModel().withDnsServiceIp(dnsServiceIp); - return this; - } - - public WorkloadNetworkDnsServiceImpl withDefaultDnsZone(String defaultDnsZone) { - this.innerModel().withDefaultDnsZone(defaultDnsZone); - return this; - } - - public WorkloadNetworkDnsServiceImpl withFqdnZones(List fqdnZones) { - this.innerModel().withFqdnZones(fqdnZones); - return this; - } - - public WorkloadNetworkDnsServiceImpl withLogLevel(DnsServiceLogLevelEnum logLevel) { - this.innerModel().withLogLevel(logLevel); - return this; - } - - public WorkloadNetworkDnsServiceImpl withRevision(Long revision) { - this.innerModel().withRevision(revision); + public WorkloadNetworkDnsServiceImpl withProperties(WorkloadNetworkDnsServiceProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsZoneImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsZoneImpl.java index afe450f2ca42..d79b3d094995 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsZoneImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsZoneImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -8,9 +8,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZone; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProvisioningState; -import java.util.Collections; -import java.util.List; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProperties; public final class WorkloadNetworkDnsZoneImpl implements WorkloadNetworkDnsZone, WorkloadNetworkDnsZone.Definition, WorkloadNetworkDnsZone.Update { @@ -30,46 +28,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public List domain() { - List inner = this.innerModel().domain(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List dnsServerIps() { - List inner = this.innerModel().dnsServerIps(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public WorkloadNetworkDnsZoneProperties properties() { + return this.innerModel().properties(); } - public String sourceIp() { - return this.innerModel().sourceIp(); - } - - public Long dnsServices() { - return this.innerModel().dnsServices(); - } - - public WorkloadNetworkDnsZoneProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public Long revision() { - return this.innerModel().revision(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -88,25 +52,31 @@ private com.azure.resourcemanager.avs.AvsManager manager() { private String privateCloudName; + private String workloadNetworkName; + private String dnsZoneId; - public WorkloadNetworkDnsZoneImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + public WorkloadNetworkDnsZoneImpl withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { this.resourceGroupName = resourceGroupName; this.privateCloudName = privateCloudName; + this.workloadNetworkName = workloadNetworkName; return this; } public WorkloadNetworkDnsZone create() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createDnsZone(resourceGroupName, privateCloudName, dnsZoneId, this.innerModel(), Context.NONE); + .createDnsZone(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, this.innerModel(), + Context.NONE); return this; } public WorkloadNetworkDnsZone create(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createDnsZone(resourceGroupName, privateCloudName, dnsZoneId, this.innerModel(), context); + .createDnsZone(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, this.innerModel(), + context); return this; } @@ -123,14 +93,16 @@ public WorkloadNetworkDnsZoneImpl update() { public WorkloadNetworkDnsZone apply() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .updateDnsZone(resourceGroupName, privateCloudName, dnsZoneId, this.innerModel(), Context.NONE); + .updateDnsZone(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, this.innerModel(), + Context.NONE); return this; } public WorkloadNetworkDnsZone apply(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .updateDnsZone(resourceGroupName, privateCloudName, dnsZoneId, this.innerModel(), context); + .updateDnsZone(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, this.innerModel(), + context); return this; } @@ -140,13 +112,14 @@ public WorkloadNetworkDnsZone apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.privateCloudName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workloadNetworks"); this.dnsZoneId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dnsZones"); } public WorkloadNetworkDnsZone refresh() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, Context.NONE) + .getDnsZoneWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, Context.NONE) .getValue(); return this; } @@ -154,38 +127,13 @@ public WorkloadNetworkDnsZone refresh() { public WorkloadNetworkDnsZone refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, context) + .getDnsZoneWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, context) .getValue(); return this; } - public WorkloadNetworkDnsZoneImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public WorkloadNetworkDnsZoneImpl withDomain(List domain) { - this.innerModel().withDomain(domain); - return this; - } - - public WorkloadNetworkDnsZoneImpl withDnsServerIps(List dnsServerIps) { - this.innerModel().withDnsServerIps(dnsServerIps); - return this; - } - - public WorkloadNetworkDnsZoneImpl withSourceIp(String sourceIp) { - this.innerModel().withSourceIp(sourceIp); - return this; - } - - public WorkloadNetworkDnsZoneImpl withDnsServices(Long dnsServices) { - this.innerModel().withDnsServices(dnsServices); - return this; - } - - public WorkloadNetworkDnsZoneImpl withRevision(Long revision) { - this.innerModel().withRevision(revision); + public WorkloadNetworkDnsZoneImpl withProperties(WorkloadNetworkDnsZoneProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkGatewayImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkGatewayImpl.java index 55de480046ca..5353807b04ce 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkGatewayImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkGatewayImpl.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; import com.azure.core.management.SystemData; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; import com.azure.resourcemanager.avs.models.WorkloadNetworkGateway; -import com.azure.resourcemanager.avs.models.WorkloadNetworkProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkGatewayProperties; public final class WorkloadNetworkGatewayImpl implements WorkloadNetworkGateway { private WorkloadNetworkGatewayInner innerObject; @@ -32,20 +32,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public WorkloadNetworkProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public WorkloadNetworkGatewayProperties properties() { + return this.innerModel().properties(); } - public String displayName() { - return this.innerModel().displayName(); - } - - public String path() { - return this.innerModel().path(); + public SystemData systemData() { + return this.innerModel().systemData(); } public WorkloadNetworkGatewayInner innerModel() { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkImpl.java index fef141164276..9eb9e787f4a7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkImpl.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; import com.azure.core.management.SystemData; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkInner; import com.azure.resourcemanager.avs.models.WorkloadNetwork; -import com.azure.resourcemanager.avs.models.WorkloadNetworkProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkProperties; public final class WorkloadNetworkImpl implements WorkloadNetwork { private WorkloadNetworkInner innerObject; @@ -31,12 +31,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); + public WorkloadNetworkProperties properties() { + return this.innerModel().properties(); } - public WorkloadNetworkProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public WorkloadNetworkInner innerModel() { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPortMirroringImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPortMirroringImpl.java index d0bc64160ab3..52a0ec71c2df 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPortMirroringImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPortMirroringImpl.java @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; -import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; -import com.azure.resourcemanager.avs.models.PortMirroringStatusEnum; import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroring; -import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProperties; public final class WorkloadNetworkPortMirroringImpl implements WorkloadNetworkPortMirroring, WorkloadNetworkPortMirroring.Definition, WorkloadNetworkPortMirroring.Update { @@ -30,36 +28,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public PortMirroringDirectionEnum direction() { - return this.innerModel().direction(); - } - - public String source() { - return this.innerModel().source(); + public WorkloadNetworkPortMirroringProperties properties() { + return this.innerModel().properties(); } - public String destination() { - return this.innerModel().destination(); - } - - public PortMirroringStatusEnum status() { - return this.innerModel().status(); - } - - public WorkloadNetworkPortMirroringProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public Long revision() { - return this.innerModel().revision(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -78,26 +52,31 @@ private com.azure.resourcemanager.avs.AvsManager manager() { private String privateCloudName; + private String workloadNetworkName; + private String portMirroringId; - public WorkloadNetworkPortMirroringImpl withExistingPrivateCloud(String resourceGroupName, - String privateCloudName) { + public WorkloadNetworkPortMirroringImpl withExistingWorkloadNetwork(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { this.resourceGroupName = resourceGroupName; this.privateCloudName = privateCloudName; + this.workloadNetworkName = workloadNetworkName; return this; } public WorkloadNetworkPortMirroring create() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createPortMirroring(resourceGroupName, privateCloudName, portMirroringId, this.innerModel(), Context.NONE); + .createPortMirroring(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + this.innerModel(), Context.NONE); return this; } public WorkloadNetworkPortMirroring create(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createPortMirroring(resourceGroupName, privateCloudName, portMirroringId, this.innerModel(), context); + .createPortMirroring(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + this.innerModel(), context); return this; } @@ -114,14 +93,16 @@ public WorkloadNetworkPortMirroringImpl update() { public WorkloadNetworkPortMirroring apply() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .updatePortMirroring(resourceGroupName, privateCloudName, portMirroringId, this.innerModel(), Context.NONE); + .updatePortMirroring(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + this.innerModel(), Context.NONE); return this; } public WorkloadNetworkPortMirroring apply(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .updatePortMirroring(resourceGroupName, privateCloudName, portMirroringId, this.innerModel(), context); + .updatePortMirroring(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + this.innerModel(), context); return this; } @@ -131,13 +112,15 @@ public WorkloadNetworkPortMirroring apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.privateCloudName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workloadNetworks"); this.portMirroringId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "portMirroringProfiles"); } public WorkloadNetworkPortMirroring refresh() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, Context.NONE) + .getPortMirroringWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + Context.NONE) .getValue(); return this; } @@ -145,33 +128,14 @@ public WorkloadNetworkPortMirroring refresh() { public WorkloadNetworkPortMirroring refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, context) + .getPortMirroringWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + context) .getValue(); return this; } - public WorkloadNetworkPortMirroringImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public WorkloadNetworkPortMirroringImpl withDirection(PortMirroringDirectionEnum direction) { - this.innerModel().withDirection(direction); - return this; - } - - public WorkloadNetworkPortMirroringImpl withSource(String source) { - this.innerModel().withSource(source); - return this; - } - - public WorkloadNetworkPortMirroringImpl withDestination(String destination) { - this.innerModel().withDestination(destination); - return this; - } - - public WorkloadNetworkPortMirroringImpl withRevision(Long revision) { - this.innerModel().withRevision(revision); + public WorkloadNetworkPortMirroringImpl withProperties(WorkloadNetworkPortMirroringProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPublicIpImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPublicIpImpl.java index e4b15ecc103e..24e6a8e5bffa 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPublicIpImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPublicIpImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -8,7 +8,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner; import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIp; -import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIpProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIpProperties; public final class WorkloadNetworkPublicIpImpl implements WorkloadNetworkPublicIp, WorkloadNetworkPublicIp.Definition { private WorkloadNetworkPublicIpInner innerObject; @@ -33,24 +33,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public Long numberOfPublicIPs() { - return this.innerModel().numberOfPublicIPs(); - } - - public String publicIpBlock() { - return this.innerModel().publicIpBlock(); + public WorkloadNetworkPublicIpProperties properties() { + return this.innerModel().properties(); } - public WorkloadNetworkPublicIpProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public WorkloadNetworkPublicIpInner innerModel() { @@ -65,38 +53,44 @@ private com.azure.resourcemanager.avs.AvsManager manager() { private String privateCloudName; - private String publicIpId; + private String workloadNetworkName; + + private String publicIPId; - public WorkloadNetworkPublicIpImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + public WorkloadNetworkPublicIpImpl withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { this.resourceGroupName = resourceGroupName; this.privateCloudName = privateCloudName; + this.workloadNetworkName = workloadNetworkName; return this; } public WorkloadNetworkPublicIp create() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createPublicIp(resourceGroupName, privateCloudName, publicIpId, this.innerModel(), Context.NONE); + .createPublicIP(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, this.innerModel(), + Context.NONE); return this; } public WorkloadNetworkPublicIp create(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createPublicIp(resourceGroupName, privateCloudName, publicIpId, this.innerModel(), context); + .createPublicIP(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, this.innerModel(), + context); return this; } WorkloadNetworkPublicIpImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { this.innerObject = new WorkloadNetworkPublicIpInner(); this.serviceManager = serviceManager; - this.publicIpId = name; + this.publicIPId = name; } public WorkloadNetworkPublicIp refresh() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .getPublicIpWithResponse(resourceGroupName, privateCloudName, publicIpId, Context.NONE) + .getPublicIPWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, Context.NONE) .getValue(); return this; } @@ -104,18 +98,13 @@ public WorkloadNetworkPublicIp refresh() { public WorkloadNetworkPublicIp refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .getPublicIpWithResponse(resourceGroupName, privateCloudName, publicIpId, context) + .getPublicIPWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, context) .getValue(); return this; } - public WorkloadNetworkPublicIpImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public WorkloadNetworkPublicIpImpl withNumberOfPublicIPs(Long numberOfPublicIPs) { - this.innerModel().withNumberOfPublicIPs(numberOfPublicIPs); + public WorkloadNetworkPublicIpImpl withProperties(WorkloadNetworkPublicIpProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkSegmentImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkSegmentImpl.java index 24b21c254e1e..fde5cd6889f4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkSegmentImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkSegmentImpl.java @@ -1,19 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; -import com.azure.resourcemanager.avs.models.SegmentStatusEnum; import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentPortVif; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProvisioningState; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; -import java.util.Collections; -import java.util.List; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProperties; public final class WorkloadNetworkSegmentImpl implements WorkloadNetworkSegment, WorkloadNetworkSegment.Definition, WorkloadNetworkSegment.Update { @@ -33,41 +28,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String connectedGateway() { - return this.innerModel().connectedGateway(); - } - - public WorkloadNetworkSegmentSubnet subnet() { - return this.innerModel().subnet(); - } - - public List portVif() { - List inner = this.innerModel().portVif(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public SegmentStatusEnum status() { - return this.innerModel().status(); - } - - public WorkloadNetworkSegmentProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public WorkloadNetworkSegmentProperties properties() { + return this.innerModel().properties(); } - public Long revision() { - return this.innerModel().revision(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -86,25 +52,31 @@ private com.azure.resourcemanager.avs.AvsManager manager() { private String privateCloudName; + private String workloadNetworkName; + private String segmentId; - public WorkloadNetworkSegmentImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + public WorkloadNetworkSegmentImpl withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { this.resourceGroupName = resourceGroupName; this.privateCloudName = privateCloudName; + this.workloadNetworkName = workloadNetworkName; return this; } public WorkloadNetworkSegment create() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createSegments(resourceGroupName, privateCloudName, segmentId, this.innerModel(), Context.NONE); + .createSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, this.innerModel(), + Context.NONE); return this; } public WorkloadNetworkSegment create(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createSegments(resourceGroupName, privateCloudName, segmentId, this.innerModel(), context); + .createSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, this.innerModel(), + context); return this; } @@ -121,14 +93,16 @@ public WorkloadNetworkSegmentImpl update() { public WorkloadNetworkSegment apply() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .updateSegments(resourceGroupName, privateCloudName, segmentId, this.innerModel(), Context.NONE); + .updateSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, this.innerModel(), + Context.NONE); return this; } public WorkloadNetworkSegment apply(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .updateSegments(resourceGroupName, privateCloudName, segmentId, this.innerModel(), context); + .updateSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, this.innerModel(), + context); return this; } @@ -138,13 +112,14 @@ public WorkloadNetworkSegment apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.privateCloudName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workloadNetworks"); this.segmentId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "segments"); } public WorkloadNetworkSegment refresh() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, Context.NONE) + .getSegmentWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, Context.NONE) .getValue(); return this; } @@ -152,28 +127,13 @@ public WorkloadNetworkSegment refresh() { public WorkloadNetworkSegment refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, context) + .getSegmentWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, context) .getValue(); return this; } - public WorkloadNetworkSegmentImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public WorkloadNetworkSegmentImpl withConnectedGateway(String connectedGateway) { - this.innerModel().withConnectedGateway(connectedGateway); - return this; - } - - public WorkloadNetworkSegmentImpl withSubnet(WorkloadNetworkSegmentSubnet subnet) { - this.innerModel().withSubnet(subnet); - return this; - } - - public WorkloadNetworkSegmentImpl withRevision(Long revision) { - this.innerModel().withRevision(revision); + public WorkloadNetworkSegmentImpl withProperties(WorkloadNetworkSegmentProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVMGroupImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVMGroupImpl.java index b54099b813d7..82f294d9a6b3 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVMGroupImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVMGroupImpl.java @@ -1,17 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; -import com.azure.resourcemanager.avs.models.VMGroupStatusEnum; import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroup; -import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProvisioningState; -import java.util.Collections; -import java.util.List; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProperties; public final class WorkloadNetworkVMGroupImpl implements WorkloadNetworkVMGroup, WorkloadNetworkVMGroup.Definition, WorkloadNetworkVMGroup.Update { @@ -31,33 +28,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public List members() { - List inner = this.innerModel().members(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public VMGroupStatusEnum status() { - return this.innerModel().status(); - } - - public WorkloadNetworkVMGroupProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public WorkloadNetworkVMGroupProperties properties() { + return this.innerModel().properties(); } - public Long revision() { - return this.innerModel().revision(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -76,25 +52,31 @@ private com.azure.resourcemanager.avs.AvsManager manager() { private String privateCloudName; + private String workloadNetworkName; + private String vmGroupId; - public WorkloadNetworkVMGroupImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + public WorkloadNetworkVMGroupImpl withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { this.resourceGroupName = resourceGroupName; this.privateCloudName = privateCloudName; + this.workloadNetworkName = workloadNetworkName; return this; } public WorkloadNetworkVMGroup create() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createVMGroup(resourceGroupName, privateCloudName, vmGroupId, this.innerModel(), Context.NONE); + .createVMGroup(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, this.innerModel(), + Context.NONE); return this; } public WorkloadNetworkVMGroup create(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .createVMGroup(resourceGroupName, privateCloudName, vmGroupId, this.innerModel(), context); + .createVMGroup(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, this.innerModel(), + context); return this; } @@ -111,14 +93,16 @@ public WorkloadNetworkVMGroupImpl update() { public WorkloadNetworkVMGroup apply() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .updateVMGroup(resourceGroupName, privateCloudName, vmGroupId, this.innerModel(), Context.NONE); + .updateVMGroup(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, this.innerModel(), + Context.NONE); return this; } public WorkloadNetworkVMGroup apply(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .updateVMGroup(resourceGroupName, privateCloudName, vmGroupId, this.innerModel(), context); + .updateVMGroup(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, this.innerModel(), + context); return this; } @@ -128,13 +112,14 @@ public WorkloadNetworkVMGroup apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.privateCloudName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workloadNetworks"); this.vmGroupId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "vmGroups"); } public WorkloadNetworkVMGroup refresh() { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, Context.NONE) + .getVMGroupWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, Context.NONE) .getValue(); return this; } @@ -142,23 +127,13 @@ public WorkloadNetworkVMGroup refresh() { public WorkloadNetworkVMGroup refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkloadNetworks() - .getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, context) + .getVMGroupWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, context) .getValue(); return this; } - public WorkloadNetworkVMGroupImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public WorkloadNetworkVMGroupImpl withMembers(List members) { - this.innerModel().withMembers(members); - return this; - } - - public WorkloadNetworkVMGroupImpl withRevision(Long revision) { - this.innerModel().withRevision(revision); + public WorkloadNetworkVMGroupImpl withProperties(WorkloadNetworkVMGroupProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVirtualMachineImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVirtualMachineImpl.java index 14b6a9cdacef..0a4ce8d356d3 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVirtualMachineImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVirtualMachineImpl.java @@ -1,14 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; import com.azure.core.management.SystemData; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; -import com.azure.resourcemanager.avs.models.VMTypeEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkProvisioningState; import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachine; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachineProperties; public final class WorkloadNetworkVirtualMachineImpl implements WorkloadNetworkVirtualMachine { private WorkloadNetworkVirtualMachineInner innerObject; @@ -33,20 +32,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public WorkloadNetworkProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public WorkloadNetworkVirtualMachineProperties properties() { + return this.innerModel().properties(); } - public String displayName() { - return this.innerModel().displayName(); - } - - public VMTypeEnum vmType() { - return this.innerModel().vmType(); + public SystemData systemData() { + return this.innerModel().systemData(); } public WorkloadNetworkVirtualMachineInner innerModel() { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java index 81accb80eb4f..aba2948e6e6d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -28,8 +28,10 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.WorkloadNetworksClient; @@ -41,18 +43,18 @@ import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpList; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServicesList; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZonesList; -import com.azure.resourcemanager.avs.models.WorkloadNetworkGatewayList; -import com.azure.resourcemanager.avs.models.WorkloadNetworkList; -import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringList; -import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIPsList; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentsList; -import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachinesList; -import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupsList; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; +import com.azure.resourcemanager.avs.implementation.models.WorkloadNetworkDhcpList; +import com.azure.resourcemanager.avs.implementation.models.WorkloadNetworkDnsServicesList; +import com.azure.resourcemanager.avs.implementation.models.WorkloadNetworkDnsZonesList; +import com.azure.resourcemanager.avs.implementation.models.WorkloadNetworkGatewayList; +import com.azure.resourcemanager.avs.implementation.models.WorkloadNetworkList; +import com.azure.resourcemanager.avs.implementation.models.WorkloadNetworkPortMirroringList; +import com.azure.resourcemanager.avs.implementation.models.WorkloadNetworkPublicIPsList; +import com.azure.resourcemanager.avs.implementation.models.WorkloadNetworkSegmentsList; +import com.azure.resourcemanager.avs.implementation.models.WorkloadNetworkVMGroupsList; +import com.azure.resourcemanager.avs.implementation.models.WorkloadNetworkVirtualMachinesList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -86,255 +88,526 @@ public final class WorkloadNetworksClientImpl implements WorkloadNetworksClient * The interface defining all the services for AvsClientWorkloadNetworks to be used by the proxy service to perform * REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "AvsClientWorkloadNet") public interface WorkloadNetworksService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDhcp(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dhcpConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDhcp(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dhcpConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listDhcpSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{dhcpId}/{privateCloudName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getDhcp(@HostParam("$host") String endpoint, + Mono> getDhcp(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("dhcpId") String dhcpId, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{dhcpId}/{privateCloudName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getDhcpSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("dhcpId") String dhcpId, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dhcpConfigurations/{dhcpId}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createDhcp(@HostParam("$host") String endpoint, + Mono>> createDhcp(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("dhcpId") String dhcpId, - @BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp, - @HeaderParam("Accept") String accept, Context context); + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("dhcpId") String dhcpId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context); - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dhcpConfigurations/{dhcpId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createDhcpSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("dhcpId") String dhcpId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dhcpConfigurations/{dhcpId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateDhcp(@HostParam("$host") String endpoint, + Mono>> updateDhcp(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("dhcpId") String dhcpId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dhcpConfigurations/{dhcpId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateDhcpSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("dhcpId") String dhcpId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dhcpConfigurations/{dhcpId}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteDhcp(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("dhcpId") String dhcpId, - @BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("dhcpId") String dhcpId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dhcpConfigurations/{dhcpId}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteDhcp(@HostParam("$host") String endpoint, + Response deleteDhcpSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("dhcpId") String dhcpId, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("dhcpId") String dhcpId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsServices") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDnsServices(@HostParam("$host") String endpoint, + Mono> listDnsService(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsServices") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getDnsService(@HostParam("$host") String endpoint, + Response listDnsServiceSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("dnsServiceId") String dnsServiceId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsServices/{dnsServiceId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createDnsService(@HostParam("$host") String endpoint, + Mono> getDnsService(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("dnsServiceId") String dnsServiceId, - @BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService, - @HeaderParam("Accept") String accept, Context context); + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("dnsServiceId") String dnsServiceId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsServices/{dnsServiceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getDnsServiceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("dnsServiceId") String dnsServiceId, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsServices/{dnsServiceId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createDnsService(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("dnsServiceId") String dnsServiceId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsServices/{dnsServiceId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createDnsServiceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("dnsServiceId") String dnsServiceId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsServices/{dnsServiceId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateDnsService(@HostParam("$host") String endpoint, + Mono>> updateDnsService(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("dnsServiceId") String dnsServiceId, - @BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService, - @HeaderParam("Accept") String accept, Context context); + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("dnsServiceId") String dnsServiceId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsServices/{dnsServiceId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateDnsServiceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("dnsServiceId") String dnsServiceId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{dnsServiceId}/{privateCloudName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteDnsService(@HostParam("$host") String endpoint, + Mono>> deleteDnsService(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("dnsServiceId") String dnsServiceId, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{dnsServiceId}/{privateCloudName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteDnsServiceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("dnsServiceId") String dnsServiceId, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsZones") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDnsZones(@HostParam("$host") String endpoint, + Mono> listDnsZones(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsZones") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getDnsZone(@HostParam("$host") String endpoint, + Response listDnsZonesSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("dnsZoneId") String dnsZoneId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsZones/{dnsZoneId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createDnsZone(@HostParam("$host") String endpoint, + Mono> getDnsZone(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("dnsZoneId") String dnsZoneId, - @BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("dnsZoneId") String dnsZoneId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsZones/{dnsZoneId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateDnsZone(@HostParam("$host") String endpoint, + Response getDnsZoneSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("dnsZoneId") String dnsZoneId, - @BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("dnsZoneId") String dnsZoneId, @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsZones/{dnsZoneId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createDnsZone(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("dnsZoneId") String dnsZoneId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsZones/{dnsZoneId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createDnsZoneSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("dnsZoneId") String dnsZoneId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsZones/{dnsZoneId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateDnsZone(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("dnsZoneId") String dnsZoneId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/dnsZones/{dnsZoneId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateDnsZoneSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("dnsZoneId") String dnsZoneId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{dnsZoneId}/{privateCloudName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteDnsZone(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("dnsZoneId") String dnsZoneId, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{dnsZoneId}/{privateCloudName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteDnsZone(@HostParam("$host") String endpoint, + Response deleteDnsZoneSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("dnsZoneId") String dnsZoneId, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/gateways") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listGateways(@HostParam("$host") String endpoint, + Mono> listGateways(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/gateways") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listGatewaysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/gateways/{gatewayId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getGateway(@HostParam("$host") String endpoint, + Mono> getGateway(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("gatewayId") String gatewayId, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("gatewayId") String gatewayId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/gateways/{gatewayId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listPortMirroring(@HostParam("$host") String endpoint, + Response getGatewaySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("gatewayId") String gatewayId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/portMirroringProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPortMirroring(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/portMirroringProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listPortMirroringSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/portMirroringProfiles/{portMirroringId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getPortMirroring(@HostParam("$host") String endpoint, + Mono> getPortMirroring(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("portMirroringId") String portMirroringId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/portMirroringProfiles/{portMirroringId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getPortMirroringSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("portMirroringId") String portMirroringId, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/portMirroringProfiles/{portMirroringId}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createPortMirroring(@HostParam("$host") String endpoint, + Mono>> createPortMirroring(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, - @PathParam("portMirroringId") String portMirroringId, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("portMirroringId") String portMirroringId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/portMirroringProfiles/{portMirroringId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createPortMirroringSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("portMirroringId") String portMirroringId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/portMirroringProfiles/{portMirroringId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updatePortMirroring(@HostParam("$host") String endpoint, + Mono>> updatePortMirroring(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("privateCloudName") String privateCloudName, - @PathParam("portMirroringId") String portMirroringId, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("portMirroringId") String portMirroringId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, - @HeaderParam("Accept") String accept, Context context); + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/portMirroringProfiles/{portMirroringId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updatePortMirroringSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("portMirroringId") String portMirroringId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{portMirroringId}/{privateCloudName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deletePortMirroring(@HostParam("$host") String endpoint, + Mono>> deletePortMirroring(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("portMirroringId") String portMirroringId, @@ -342,248 +615,522 @@ Mono>> deletePortMirroring(@HostParam("$host") String Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{portMirroringId}/{privateCloudName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deletePortMirroringSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("portMirroringId") String portMirroringId, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/publicIPs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPublicIPs(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/publicIPs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listPublicIPsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/publicIPs/{publicIPId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getPublicIP(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("publicIPId") String publicIPId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/publicIPs/{publicIPId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listPublicIPs(@HostParam("$host") String endpoint, + Response getPublicIPSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("publicIPId") String publicIPId, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/publicIPs/{publicIPId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createPublicIP(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("publicIPId") String publicIPId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkPublicIpInner workloadNetworkPublicIP, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/publicIPs/{publicIPId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createPublicIPSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("publicIPId") String publicIPId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkPublicIpInner workloadNetworkPublicIP, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{publicIPId}/{privateCloudName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deletePublicIP(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("publicIPId") String publicIPId, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{publicIPId}/{privateCloudName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deletePublicIPSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("publicIPId") String publicIPId, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/segments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSegments(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/segments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSegmentsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/segments/{segmentId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSegment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("segmentId") String segmentId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/segments/{segmentId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSegmentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("segmentId") String segmentId, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/segments/{segmentId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createSegment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("segmentId") String segmentId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/segments/{segmentId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSegmentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("segmentId") String segmentId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/segments/{segmentId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateSegment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("segmentId") String segmentId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/segments/{segmentId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSegmentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("segmentId") String segmentId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/segments/{segmentId}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteSegment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("segmentId") String segmentId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/segments/{segmentId}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSegmentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("segmentId") String segmentId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/virtualMachines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachines(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/virtualMachines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listVirtualMachinesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/virtualMachines/{virtualMachineId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVirtualMachine(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("virtualMachineId") String virtualMachineId, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/virtualMachines/{virtualMachineId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getPublicIp(@HostParam("$host") String endpoint, + Response getVirtualMachineSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("publicIPId") String publicIpId, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, + @PathParam("virtualMachineId") String virtualMachineId, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/vmGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVMGroups(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/vmGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listVMGroupsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/vmGroups/{vmGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVMGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("vmGroupId") String vmGroupId, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}") - @ExpectedResponses({ 200, 201 }) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/vmGroups/{vmGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getVMGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("vmGroupId") String vmGroupId, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/vmGroups/{vmGroupId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createVMGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("vmGroupId") String vmGroupId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/vmGroups/{vmGroupId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createVMGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("vmGroupId") String vmGroupId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/vmGroups/{vmGroupId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateVMGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("vmGroupId") String vmGroupId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}/vmGroups/{vmGroupId}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createPublicIp(@HostParam("$host") String endpoint, + Response updateVMGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("publicIPId") String publicIpId, - @BodyParam("application/json") WorkloadNetworkPublicIpInner workloadNetworkPublicIp, - @HeaderParam("Accept") String accept, Context context); + @PathParam("privateCloudName") String privateCloudName, + @PathParam("workloadNetworkName") String workloadNetworkName, @PathParam("vmGroupId") String vmGroupId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{vmGroupId}/{privateCloudName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deletePublicIp(@HostParam("$host") String endpoint, + Mono>> deleteVMGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("publicIPId") String publicIpId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmGroupId") String vmGroupId, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/{vmGroupId}/{privateCloudName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSegments(@HostParam("$host") String endpoint, + Response deleteVMGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmGroupId") String vmGroupId, @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSegment(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("segmentId") String segmentId, - @HeaderParam("Accept") String accept, Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") - @ExpectedResponses({ 200, 201 }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createSegments(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("segmentId") String segmentId, - @BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment, - @HeaderParam("Accept") String accept, Context context); + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") - @ExpectedResponses({ 200, 202 }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateSegments(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("segmentId") String segmentId, - @BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment, + Mono> listDhcpNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") - @ExpectedResponses({ 200, 202, 204 }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteSegment(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("segmentId") String segmentId, + Response listDhcpNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVirtualMachines(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, - Context context); + Mono> listDnsServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getVirtualMachine(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, - @PathParam("virtualMachineId") String virtualMachineId, @HeaderParam("Accept") String accept, - Context context); + Response listDnsServiceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVMGroups(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, - Context context); + Mono> listDnsZonesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getVMGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("vmGroupId") String vmGroupId, + Response listDnsZonesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") - @ExpectedResponses({ 200, 201 }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createVMGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("vmGroupId") String vmGroupId, - @BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Mono> listGatewaysNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") - @ExpectedResponses({ 200, 202 }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateVMGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateCloudName") String privateCloudName, @PathParam("vmGroupId") String vmGroupId, - @BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Response listGatewaysNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteVMGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmGroupId") String vmGroupId, - @PathParam("privateCloudName") String privateCloudName, @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); + Mono> listPortMirroringNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDhcpNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listPortMirroringNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDnsServicesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listPublicIPsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDnsZonesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listPublicIPsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listGatewaysNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listSegmentsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listPortMirroringNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listSegmentsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listPublicIPsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listVirtualMachinesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSegmentsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listVirtualMachinesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVirtualMachinesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listVMGroupsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVMGroupsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listVMGroupsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -631,39 +1178,15 @@ private Mono> listSinglePageAsync(String res * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetwork list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetwork list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -674,12 +1197,33 @@ private Mono> listSinglePageAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetwork list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetwork list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -691,13 +1235,34 @@ private PagedFlux listAsync(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetwork list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetwork list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -712,7 +1277,8 @@ private PagedFlux listAsync(String resourceGroupName, Stri */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -729,7 +1295,8 @@ public PagedIterable list(String resourceGroupName, String @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -737,14 +1304,15 @@ public PagedIterable list(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 WorkloadNetwork along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String privateCloudName) { + private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -761,47 +1329,14 @@ private Mono> getWithResponseAsync(String resourc return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a WorkloadNetwork. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 WorkloadNetwork along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { + if (workloadNetworkName == null) { return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -809,14 +1344,16 @@ private Mono> getWithResponseAsync(String resourc * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 WorkloadNetwork on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String privateCloudName) { - return getWithResponseAsync(resourceGroupName, privateCloudName) + private Mono getAsync(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, workloadNetworkName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -825,6 +1362,7 @@ private Mono getAsync(String resourceGroupName, String pri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -833,8 +1371,32 @@ private Mono getAsync(String resourceGroupName, String pri */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, - Context context) { - return getWithResponseAsync(resourceGroupName, privateCloudName, context).block(); + String workloadNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, workloadNetworkName, accept, context); } /** @@ -842,14 +1404,15 @@ public Response getWithResponse(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 WorkloadNetwork. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkInner get(String resourceGroupName, String privateCloudName) { - return getWithResponse(resourceGroupName, privateCloudName, Context.NONE).getValue(); + public WorkloadNetworkInner get(String resourceGroupName, String privateCloudName, String workloadNetworkName) { + return getWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, Context.NONE).getValue(); } /** @@ -857,6 +1420,7 @@ public WorkloadNetworkInner get(String resourceGroupName, String privateCloudNam * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -865,7 +1429,7 @@ public WorkloadNetworkInner get(String resourceGroupName, String privateCloudNam */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDhcpSinglePageAsync(String resourceGroupName, - String privateCloudName) { + String privateCloudName, String workloadNetworkName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -882,10 +1446,13 @@ private Mono> listDhcpSinglePageAsync(St return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listDhcp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + return FluxUtil.withContext(context -> service.listDhcp(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, 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())); @@ -896,39 +1463,17 @@ private Mono> listDhcpSinglePageAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkDhcp list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDhcpSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDhcp(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDhcpAsync(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { + return new PagedFlux<>(() -> listDhcpSinglePageAsync(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listDhcpNextSinglePageAsync(nextLink)); } /** @@ -936,15 +1481,43 @@ private Mono> listDhcpSinglePageAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkDhcp list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDhcpAsync(String resourceGroupName, String privateCloudName) { - return new PagedFlux<>(() -> listDhcpSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listDhcpNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDhcpSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listDhcpSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -952,17 +1525,44 @@ private PagedFlux listDhcpAsync(String resourceGroupNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkDhcp list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDhcpAsync(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedFlux<>(() -> listDhcpSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listDhcpNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDhcpSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listDhcpSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -970,14 +1570,17 @@ private PagedFlux listDhcpAsync(String resourceGroupNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDhcp(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listDhcpAsync(resourceGroupName, privateCloudName)); + public PagedIterable listDhcp(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { + return new PagedIterable<>(() -> listDhcpSinglePage(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listDhcpNextSinglePage(nextLink)); } /** @@ -985,6 +1588,7 @@ public PagedIterable listDhcp(String resourceGroupName * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -993,8 +1597,10 @@ public PagedIterable listDhcp(String resourceGroupName */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDhcp(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedIterable<>(listDhcpAsync(resourceGroupName, privateCloudName, context)); + String workloadNetworkName, Context context) { + return new PagedIterable<>( + () -> listDhcpSinglePage(resourceGroupName, privateCloudName, workloadNetworkName, context), + nextLink -> listDhcpNextSinglePage(nextLink, context)); } /** @@ -1037,46 +1643,6 @@ private Mono> getDhcpWithResponseAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a WorkloadNetworkDhcp. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dhcpId The ID of the DHCP configuration. - * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 WorkloadNetworkDhcp along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDhcpWithResponseAsync(String resourceGroupName, String dhcpId, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (dhcpId == null) { - return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getDhcp(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, dhcpId, privateCloudName, accept, context); - } - /** * Get a WorkloadNetworkDhcp. * @@ -1110,7 +1676,31 @@ private Mono getDhcpAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response getDhcpWithResponse(String resourceGroupName, String dhcpId, String privateCloudName, Context context) { - return getDhcpWithResponseAsync(resourceGroupName, dhcpId, privateCloudName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dhcpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dhcpId, privateCloudName, accept, context); } /** @@ -1134,6 +1724,7 @@ public WorkloadNetworkDhcpInner getDhcp(String resourceGroupName, String dhcpId, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1143,7 +1734,8 @@ public WorkloadNetworkDhcpInner getDhcp(String resourceGroupName, String dhcpId, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createDhcpWithResponseAsync(String resourceGroupName, - String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + String privateCloudName, String workloadNetworkName, String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1160,6 +1752,10 @@ private Mono>> createDhcpWithResponseAsync(String reso return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (dhcpId == null) { return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); } @@ -1169,11 +1765,12 @@ private Mono>> createDhcpWithResponseAsync(String reso } else { workloadNetworkDhcp.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createDhcp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, - accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, + contentType, accept, workloadNetworkDhcp, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1182,47 +1779,54 @@ private Mono>> createDhcpWithResponseAsync(String reso * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX DHCP along with {@link Response} on successful completion of {@link Mono}. + * @return nSX DHCP along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createDhcpWithResponseAsync(String resourceGroupName, - String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { + private Response createDhcpWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (dhcpId == null) { - return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); } if (workloadNetworkDhcp == null) { - return Mono - .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); } else { workloadNetworkDhcp.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createDhcp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, accept, - context); + return service.createDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, + contentType, accept, workloadNetworkDhcp, Context.NONE); } /** @@ -1230,22 +1834,55 @@ private Mono>> createDhcpWithResponseAsync(String reso * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX DHCP. + * @return nSX DHCP along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkDhcpInner> beginCreateDhcpAsync( - String resourceGroupName, String privateCloudName, String dhcpId, - WorkloadNetworkDhcpInner workloadNetworkDhcp) { - Mono>> mono - = createDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createDhcpWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (dhcpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, + contentType, accept, workloadNetworkDhcp, context); } /** @@ -1253,9 +1890,9 @@ private PollerFlux, WorkloadNetworkDhcpInne * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1263,13 +1900,13 @@ private PollerFlux, WorkloadNetworkDhcpInne */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkloadNetworkDhcpInner> beginCreateDhcpAsync( - String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context); + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + Mono>> mono = createDhcpWithResponseAsync(resourceGroupName, privateCloudName, + workloadNetworkName, dhcpId, workloadNetworkDhcp); return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, context); + this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, + this.client.getContext()); } /** @@ -1277,6 +1914,7 @@ private PollerFlux, WorkloadNetworkDhcpInne * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1286,10 +1924,12 @@ private PollerFlux, WorkloadNetworkDhcpInne */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp( - String resourceGroupName, String privateCloudName, String dhcpId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { - return this.beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp) - .getSyncPoller(); + Response response = createDhcpWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, + dhcpId, workloadNetworkDhcp); + return this.client.getLroResult(response, + WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, Context.NONE); } /** @@ -1297,6 +1937,7 @@ public SyncPoller, WorkloadNetworkDhcpInner * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. * @param context The context to associate with this operation. @@ -1307,29 +1948,12 @@ public SyncPoller, WorkloadNetworkDhcpInner */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp( - String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, - Context context) { - return this.beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context) - .getSyncPoller(); - } - - /** - * Create a WorkloadNetworkDhcp. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param dhcpId The ID of the DHCP configuration. - * @param workloadNetworkDhcp Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX DHCP on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createDhcpAsync(String resourceGroupName, String privateCloudName, - String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { - return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).last() - .flatMap(this.client::getLroFinalResultOrError); + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { + Response response = createDhcpWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, + dhcpId, workloadNetworkDhcp, context); + return this.client.getLroResult(response, + WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, context); } /** @@ -1337,9 +1961,9 @@ private Mono createDhcpAsync(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1347,9 +1971,9 @@ private Mono createDhcpAsync(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createDhcpAsync(String resourceGroupName, String privateCloudName, - String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { - return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).last() - .flatMap(this.client::getLroFinalResultOrError); + String workloadNetworkName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginCreateDhcpAsync(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, + workloadNetworkDhcp).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -1357,6 +1981,7 @@ private Mono createDhcpAsync(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1365,9 +1990,10 @@ private Mono createDhcpAsync(String resourceGroupName, * @return nSX DHCP. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, String dhcpId, - WorkloadNetworkDhcpInner workloadNetworkDhcp) { - return createDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).block(); + public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginCreateDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, workloadNetworkDhcp) + .getFinalResult(); } /** @@ -1375,6 +2001,7 @@ public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String priv * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp Resource create parameters. * @param context The context to associate with this operation. @@ -1384,9 +2011,10 @@ public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String priv * @return nSX DHCP. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, String dhcpId, - WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { - return createDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).block(); + public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { + return beginCreateDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, workloadNetworkDhcp, + context).getFinalResult(); } /** @@ -1394,6 +2022,7 @@ public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String priv * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1403,7 +2032,8 @@ public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String priv */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateDhcpWithResponseAsync(String resourceGroupName, - String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + String privateCloudName, String workloadNetworkName, String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1420,6 +2050,10 @@ private Mono>> updateDhcpWithResponseAsync(String reso return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (dhcpId == null) { return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); } @@ -1429,11 +2063,12 @@ private Mono>> updateDhcpWithResponseAsync(String reso } else { workloadNetworkDhcp.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.updateDhcp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, - accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, + contentType, accept, workloadNetworkDhcp, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1442,47 +2077,54 @@ private Mono>> updateDhcpWithResponseAsync(String reso * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX DHCP along with {@link Response} on successful completion of {@link Mono}. + * @return nSX DHCP along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateDhcpWithResponseAsync(String resourceGroupName, - String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { + private Response updateDhcpWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (dhcpId == null) { - return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); } if (workloadNetworkDhcp == null) { - return Mono - .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); } else { workloadNetworkDhcp.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateDhcp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, accept, - context); + return service.updateDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, + contentType, accept, workloadNetworkDhcp, Context.NONE); } /** @@ -1490,22 +2132,55 @@ private Mono>> updateDhcpWithResponseAsync(String reso * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX DHCP. + * @return nSX DHCP along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkDhcpInner> beginUpdateDhcpAsync( - String resourceGroupName, String privateCloudName, String dhcpId, - WorkloadNetworkDhcpInner workloadNetworkDhcp) { - Mono>> mono - = updateDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateDhcpWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (dhcpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, + contentType, accept, workloadNetworkDhcp, context); } /** @@ -1513,9 +2188,9 @@ private PollerFlux, WorkloadNetworkDhcpInne * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1523,13 +2198,13 @@ private PollerFlux, WorkloadNetworkDhcpInne */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkloadNetworkDhcpInner> beginUpdateDhcpAsync( - String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context); + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + Mono>> mono = updateDhcpWithResponseAsync(resourceGroupName, privateCloudName, + workloadNetworkName, dhcpId, workloadNetworkDhcp); return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, context); + this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, + this.client.getContext()); } /** @@ -1537,6 +2212,7 @@ private PollerFlux, WorkloadNetworkDhcpInne * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1546,10 +2222,12 @@ private PollerFlux, WorkloadNetworkDhcpInne */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp( - String resourceGroupName, String privateCloudName, String dhcpId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { - return this.beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp) - .getSyncPoller(); + Response response = updateDhcpWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, + dhcpId, workloadNetworkDhcp); + return this.client.getLroResult(response, + WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, Context.NONE); } /** @@ -1557,6 +2235,7 @@ public SyncPoller, WorkloadNetworkDhcpInner * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. * @param context The context to associate with this operation. @@ -1567,29 +2246,12 @@ public SyncPoller, WorkloadNetworkDhcpInner */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp( - String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, - Context context) { - return this.beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context) - .getSyncPoller(); - } - - /** - * Update a WorkloadNetworkDhcp. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param dhcpId The ID of the DHCP configuration. - * @param workloadNetworkDhcp The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX DHCP on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateDhcpAsync(String resourceGroupName, String privateCloudName, - String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { - return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).last() - .flatMap(this.client::getLroFinalResultOrError); + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { + Response response = updateDhcpWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, + dhcpId, workloadNetworkDhcp, context); + return this.client.getLroResult(response, + WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, context); } /** @@ -1597,9 +2259,9 @@ private Mono updateDhcpAsync(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1607,9 +2269,9 @@ private Mono updateDhcpAsync(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateDhcpAsync(String resourceGroupName, String privateCloudName, - String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { - return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).last() - .flatMap(this.client::getLroFinalResultOrError); + String workloadNetworkName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, + workloadNetworkDhcp).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -1617,6 +2279,7 @@ private Mono updateDhcpAsync(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1625,9 +2288,10 @@ private Mono updateDhcpAsync(String resourceGroupName, * @return nSX DHCP. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, String dhcpId, - WorkloadNetworkDhcpInner workloadNetworkDhcp) { - return updateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).block(); + public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginUpdateDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, workloadNetworkDhcp) + .getFinalResult(); } /** @@ -1635,6 +2299,7 @@ public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String priv * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param workloadNetworkDhcp The resource properties to be updated. * @param context The context to associate with this operation. @@ -1644,9 +2309,10 @@ public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String priv * @return nSX DHCP. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, String dhcpId, - WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { - return updateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).block(); + public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { + return beginUpdateDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, workloadNetworkDhcp, + context).getFinalResult(); } /** @@ -1654,6 +2320,7 @@ public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String priv * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1662,7 +2329,7 @@ public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String priv */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteDhcpWithResponseAsync(String resourceGroupName, - String privateCloudName, String dhcpId) { + String privateCloudName, String workloadNetworkName, String dhcpId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1679,13 +2346,18 @@ private Mono>> deleteDhcpWithResponseAsync(String reso return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (dhcpId == null) { return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.deleteDhcp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1694,39 +2366,46 @@ private Mono>> deleteDhcpWithResponseAsync(String reso * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteDhcpWithResponseAsync(String resourceGroupName, - String privateCloudName, String dhcpId, Context context) { + private Response deleteDhcpWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dhcpId) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (dhcpId == null) { - return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteDhcp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, accept, context); + return service.deleteDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, accept, + Context.NONE); } /** @@ -1734,19 +2413,47 @@ private Mono>> deleteDhcpWithResponseAsync(String reso * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteDhcpAsync(String resourceGroupName, String privateCloudName, - String dhcpId) { - Mono>> mono - = deleteDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteDhcpWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dhcpId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (dhcpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, accept, + context); } /** @@ -1754,8 +2461,8 @@ private PollerFlux, Void> beginDeleteDhcpAsync(String resourceG * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1763,12 +2470,11 @@ private PollerFlux, Void> beginDeleteDhcpAsync(String resourceG */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteDhcpAsync(String resourceGroupName, String privateCloudName, - String dhcpId, Context context) { - context = this.client.mergeContext(context); + String workloadNetworkName, String dhcpId) { Mono>> mono - = deleteDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, context); + = deleteDhcpWithResponseAsync(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1776,6 +2482,7 @@ private PollerFlux, Void> beginDeleteDhcpAsync(String resourceG * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1784,8 +2491,10 @@ private PollerFlux, Void> beginDeleteDhcpAsync(String resourceG */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, String privateCloudName, - String dhcpId) { - return this.beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).getSyncPoller(); + String workloadNetworkName, String dhcpId) { + Response response + = deleteDhcpWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1793,34 +2502,20 @@ public SyncPoller, Void> beginDeleteDhcp(String resourceGroupNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked 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> beginDeleteDhcp(String resourceGroupName, String privateCloudName, - String dhcpId, Context context) { - return this.beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).getSyncPoller(); - } - - /** - * Delete a WorkloadNetworkDhcp. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param dhcpId The ID of the DHCP configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId) { - return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dhcpId, Context context) { + Response response + = deleteDhcpWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1828,17 +2523,17 @@ private Mono deleteDhcpAsync(String resourceGroupName, String privateCloud * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId, - Context context) { - return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).last() + private Mono deleteDhcpAsync(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String dhcpId) { + return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1847,14 +2542,16 @@ private Mono deleteDhcpAsync(String resourceGroupName, String privateCloud * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId) { - deleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).block(); + public void deleteDhcp(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String dhcpId) { + beginDeleteDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId).getFinalResult(); } /** @@ -1862,6 +2559,7 @@ public void deleteDhcp(String resourceGroupName, String privateCloudName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1869,8 +2567,9 @@ public void deleteDhcp(String resourceGroupName, String privateCloudName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context) { - deleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).block(); + public void deleteDhcp(String resourceGroupName, String privateCloudName, String workloadNetworkName, String dhcpId, + Context context) { + beginDeleteDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, context).getFinalResult(); } /** @@ -1878,6 +2577,7 @@ public void deleteDhcp(String resourceGroupName, String privateCloudName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1885,8 +2585,8 @@ public void deleteDhcp(String resourceGroupName, String privateCloudName, String * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDnsServicesSinglePageAsync(String resourceGroupName, - String privateCloudName) { + private Mono> listDnsServiceSinglePageAsync(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1903,10 +2603,15 @@ private Mono> listDnsServicesSingl return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDnsServices(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + .withContext(context -> service.listDnsService(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, 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())); @@ -1917,39 +2622,18 @@ private Mono> listDnsServicesSingl * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkDnsService list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkDnsService list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDnsServicesSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDnsServices(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDnsServiceAsync(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + return new PagedFlux<>( + () -> listDnsServiceSinglePageAsync(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listDnsServiceNextSinglePageAsync(nextLink)); } /** @@ -1957,16 +2641,43 @@ private Mono> listDnsServicesSingl * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkDnsService list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkDnsService list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDnsServicesAsync(String resourceGroupName, - String privateCloudName) { - return new PagedFlux<>(() -> listDnsServicesSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listDnsServicesNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDnsServiceSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listDnsServiceSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1974,17 +2685,44 @@ private PagedFlux listDnsServicesAsync(String re * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkDnsService list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkDnsService list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDnsServicesAsync(String resourceGroupName, - String privateCloudName, Context context) { - return new PagedFlux<>(() -> listDnsServicesSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listDnsServicesNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDnsServiceSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listDnsServiceSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1992,6 +2730,7 @@ private PagedFlux listDnsServicesAsync(String re * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1999,9 +2738,11 @@ private PagedFlux listDnsServicesAsync(String re * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDnsServices(String resourceGroupName, - String privateCloudName) { - return new PagedIterable<>(listDnsServicesAsync(resourceGroupName, privateCloudName)); + public PagedIterable listDnsService(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + return new PagedIterable<>( + () -> listDnsServiceSinglePage(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listDnsServiceNextSinglePage(nextLink)); } /** @@ -2009,6 +2750,7 @@ public PagedIterable listDnsServices(String reso * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2017,9 +2759,11 @@ public PagedIterable listDnsServices(String reso * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDnsServices(String resourceGroupName, - String privateCloudName, Context context) { - return new PagedIterable<>(listDnsServicesAsync(resourceGroupName, privateCloudName, context)); + public PagedIterable listDnsService(String resourceGroupName, + String privateCloudName, String workloadNetworkName, Context context) { + return new PagedIterable<>( + () -> listDnsServiceSinglePage(resourceGroupName, privateCloudName, workloadNetworkName, context), + nextLink -> listDnsServiceNextSinglePage(nextLink, context)); } /** @@ -2027,6 +2771,7 @@ public PagedIterable listDnsServices(String reso * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2035,7 +2780,7 @@ public PagedIterable listDnsServices(String reso */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDnsServiceWithResponseAsync(String resourceGroupName, - String privateCloudName, String dnsServiceId) { + String privateCloudName, String workloadNetworkName, String dnsServiceId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2052,13 +2797,18 @@ private Mono> getDnsServiceWithResponse return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (dnsServiceId == null) { return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getDnsService(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2067,46 +2817,7 @@ private Mono> getDnsServiceWithResponse * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param dnsServiceId ID of the DNS service. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a WorkloadNetworkDnsService along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDnsServiceWithResponseAsync(String resourceGroupName, - String privateCloudName, String dnsServiceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (dnsServiceId == null) { - return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getDnsService(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId, accept, context); - } - - /** - * Get a WorkloadNetworkDnsService. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2115,8 +2826,8 @@ private Mono> getDnsServiceWithResponse */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getDnsServiceAsync(String resourceGroupName, String privateCloudName, - String dnsServiceId) { - return getDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, dnsServiceId) + String workloadNetworkName, String dnsServiceId) { + return getDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -2125,6 +2836,7 @@ private Mono getDnsServiceAsync(String resourceG * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2134,8 +2846,37 @@ private Mono getDnsServiceAsync(String resourceG */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDnsServiceWithResponse(String resourceGroupName, - String privateCloudName, String dnsServiceId, Context context) { - return getDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, dnsServiceId, context).block(); + String privateCloudName, String workloadNetworkName, String dnsServiceId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (dnsServiceId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + accept, context); } /** @@ -2143,6 +2884,7 @@ public Response getDnsServiceWithResponse(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2151,8 +2893,9 @@ public Response getDnsServiceWithResponse(String */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkDnsServiceInner getDnsService(String resourceGroupName, String privateCloudName, - String dnsServiceId) { - return getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, Context.NONE).getValue(); + String workloadNetworkName, String dnsServiceId) { + return getDnsServiceWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + Context.NONE).getValue(); } /** @@ -2160,6 +2903,7 @@ public WorkloadNetworkDnsServiceInner getDnsService(String resourceGroupName, St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2169,7 +2913,8 @@ public WorkloadNetworkDnsServiceInner getDnsService(String resourceGroupName, St */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createDnsServiceWithResponseAsync(String resourceGroupName, - String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + String privateCloudName, String workloadNetworkName, String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2186,6 +2931,10 @@ private Mono>> createDnsServiceWithResponseAsync(Strin return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (dnsServiceId == null) { return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); } @@ -2195,11 +2944,12 @@ private Mono>> createDnsServiceWithResponseAsync(Strin } else { workloadNetworkDnsService.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createDnsService(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId, - workloadNetworkDnsService, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + contentType, accept, workloadNetworkDnsService, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2208,48 +2958,55 @@ private Mono>> createDnsServiceWithResponseAsync(Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX DNS Service along with {@link Response} on successful completion of {@link Mono}. + * @return nSX DNS Service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createDnsServiceWithResponseAsync(String resourceGroupName, - String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, - Context context) { + private Response createDnsServiceWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (dnsServiceId == null) { - return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); } if (workloadNetworkDnsService == null) { - return Mono.error( - new IllegalArgumentException("Parameter workloadNetworkDnsService is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); } else { workloadNetworkDnsService.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createDnsService(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId, - workloadNetworkDnsService, accept, context); + return service.createDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + contentType, accept, workloadNetworkDnsService, Context.NONE); } /** @@ -2257,22 +3014,57 @@ private Mono>> createDnsServiceWithResponseAsync(Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX DNS Service. + * @return nSX DNS Service along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkDnsServiceInner> - beginCreateDnsServiceAsync(String resourceGroupName, String privateCloudName, String dnsServiceId, - WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { - Mono>> mono = createDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, - dnsServiceId, workloadNetworkDnsService); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createDnsServiceWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (dnsServiceId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + contentType, accept, workloadNetworkDnsService, context); } /** @@ -2280,9 +3072,9 @@ private Mono>> createDnsServiceWithResponseAsync(Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2290,14 +3082,13 @@ private Mono>> createDnsServiceWithResponseAsync(Strin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkloadNetworkDnsServiceInner> - beginCreateDnsServiceAsync(String resourceGroupName, String privateCloudName, String dnsServiceId, - WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) { - context = this.client.mergeContext(context); + beginCreateDnsServiceAsync(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { Mono>> mono = createDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, - dnsServiceId, workloadNetworkDnsService, context); + workloadNetworkName, dnsServiceId, workloadNetworkDnsService); return this.client.getLroResult(mono, this.client.getHttpPipeline(), WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class, - context); + this.client.getContext()); } /** @@ -2305,6 +3096,7 @@ private Mono>> createDnsServiceWithResponseAsync(Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2314,11 +3106,12 @@ private Mono>> createDnsServiceWithResponseAsync(Strin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService( - String resourceGroupName, String privateCloudName, String dnsServiceId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { - return this - .beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) - .getSyncPoller(); + Response response = createDnsServiceWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, dnsServiceId, workloadNetworkDnsService); + return this.client.getLroResult(response, + WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class, Context.NONE); } /** @@ -2326,6 +3119,7 @@ public SyncPoller, WorkloadNetworkDns * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. * @param context The context to associate with this operation. @@ -2336,32 +3130,12 @@ public SyncPoller, WorkloadNetworkDns */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService( - String resourceGroupName, String privateCloudName, String dnsServiceId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) { - return this - .beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, - context) - .getSyncPoller(); - } - - /** - * Create a WorkloadNetworkDnsService. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param dnsServiceId ID of the DNS service. - * @param workloadNetworkDnsService Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX DNS Service on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createDnsServiceAsync(String resourceGroupName, - String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { - return beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) - .last() - .flatMap(this.client::getLroFinalResultOrError); + Response response = createDnsServiceWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, dnsServiceId, workloadNetworkDnsService, context); + return this.client.getLroResult(response, + WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class, context); } /** @@ -2369,9 +3143,9 @@ private Mono createDnsServiceAsync(String resour * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2379,10 +3153,10 @@ private Mono createDnsServiceAsync(String resour */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createDnsServiceAsync(String resourceGroupName, - String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, - Context context) { - return beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, - context).last().flatMap(this.client::getLroFinalResultOrError); + String privateCloudName, String workloadNetworkName, String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + workloadNetworkDnsService).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -2390,6 +3164,7 @@ private Mono createDnsServiceAsync(String resour * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2399,9 +3174,9 @@ private Mono createDnsServiceAsync(String resour */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, String privateCloudName, - String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { - return createDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) - .block(); + String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return beginCreateDnsService(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + workloadNetworkDnsService).getFinalResult(); } /** @@ -2409,6 +3184,7 @@ public WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService Resource create parameters. * @param context The context to associate with this operation. @@ -2419,9 +3195,10 @@ public WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, String privateCloudName, - String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) { - return createDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, - context).block(); + String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return beginCreateDnsService(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + workloadNetworkDnsService, context).getFinalResult(); } /** @@ -2429,6 +3206,7 @@ public WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2438,7 +3216,8 @@ public WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateDnsServiceWithResponseAsync(String resourceGroupName, - String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + String privateCloudName, String workloadNetworkName, String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2455,6 +3234,10 @@ private Mono>> updateDnsServiceWithResponseAsync(Strin return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (dnsServiceId == null) { return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); } @@ -2464,11 +3247,12 @@ private Mono>> updateDnsServiceWithResponseAsync(Strin } else { workloadNetworkDnsService.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.updateDnsService(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId, - workloadNetworkDnsService, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + contentType, accept, workloadNetworkDnsService, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2477,48 +3261,55 @@ private Mono>> updateDnsServiceWithResponseAsync(Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX DNS Service along with {@link Response} on successful completion of {@link Mono}. + * @return nSX DNS Service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateDnsServiceWithResponseAsync(String resourceGroupName, - String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, - Context context) { + private Response updateDnsServiceWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (dnsServiceId == null) { - return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); } if (workloadNetworkDnsService == null) { - return Mono.error( - new IllegalArgumentException("Parameter workloadNetworkDnsService is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); } else { workloadNetworkDnsService.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateDnsService(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId, - workloadNetworkDnsService, accept, context); + return service.updateDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + contentType, accept, workloadNetworkDnsService, Context.NONE); } /** @@ -2526,22 +3317,57 @@ private Mono>> updateDnsServiceWithResponseAsync(Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX DNS Service. + * @return nSX DNS Service along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkDnsServiceInner> - beginUpdateDnsServiceAsync(String resourceGroupName, String privateCloudName, String dnsServiceId, - WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { - Mono>> mono = updateDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, - dnsServiceId, workloadNetworkDnsService); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateDnsServiceWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (dnsServiceId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + contentType, accept, workloadNetworkDnsService, context); } /** @@ -2549,9 +3375,9 @@ private Mono>> updateDnsServiceWithResponseAsync(Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2559,14 +3385,13 @@ private Mono>> updateDnsServiceWithResponseAsync(Strin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkloadNetworkDnsServiceInner> - beginUpdateDnsServiceAsync(String resourceGroupName, String privateCloudName, String dnsServiceId, - WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) { - context = this.client.mergeContext(context); + beginUpdateDnsServiceAsync(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { Mono>> mono = updateDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, - dnsServiceId, workloadNetworkDnsService, context); + workloadNetworkName, dnsServiceId, workloadNetworkDnsService); return this.client.getLroResult(mono, this.client.getHttpPipeline(), WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class, - context); + this.client.getContext()); } /** @@ -2574,6 +3399,7 @@ private Mono>> updateDnsServiceWithResponseAsync(Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2583,11 +3409,12 @@ private Mono>> updateDnsServiceWithResponseAsync(Strin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService( - String resourceGroupName, String privateCloudName, String dnsServiceId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { - return this - .beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) - .getSyncPoller(); + Response response = updateDnsServiceWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, dnsServiceId, workloadNetworkDnsService); + return this.client.getLroResult(response, + WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class, Context.NONE); } /** @@ -2595,6 +3422,7 @@ public SyncPoller, WorkloadNetworkDns * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. * @param context The context to associate with this operation. @@ -2605,32 +3433,12 @@ public SyncPoller, WorkloadNetworkDns */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService( - String resourceGroupName, String privateCloudName, String dnsServiceId, - WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) { - return this - .beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, - context) - .getSyncPoller(); - } - - /** - * Update a WorkloadNetworkDnsService. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param dnsServiceId ID of the DNS service. - * @param workloadNetworkDnsService The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX DNS Service on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateDnsServiceAsync(String resourceGroupName, - String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { - return beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) - .last() - .flatMap(this.client::getLroFinalResultOrError); + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) { + Response response = updateDnsServiceWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, dnsServiceId, workloadNetworkDnsService, context); + return this.client.getLroResult(response, + WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class, context); } /** @@ -2638,9 +3446,9 @@ private Mono updateDnsServiceAsync(String resour * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2648,10 +3456,10 @@ private Mono updateDnsServiceAsync(String resour */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateDnsServiceAsync(String resourceGroupName, - String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, - Context context) { - return beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, - context).last().flatMap(this.client::getLroFinalResultOrError); + String privateCloudName, String workloadNetworkName, String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + workloadNetworkDnsService).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -2659,6 +3467,7 @@ private Mono updateDnsServiceAsync(String resour * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2668,9 +3477,9 @@ private Mono updateDnsServiceAsync(String resour */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkDnsServiceInner updateDnsService(String resourceGroupName, String privateCloudName, - String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { - return updateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) - .block(); + String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return beginUpdateDnsService(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + workloadNetworkDnsService).getFinalResult(); } /** @@ -2678,6 +3487,7 @@ public WorkloadNetworkDnsServiceInner updateDnsService(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param workloadNetworkDnsService The resource properties to be updated. * @param context The context to associate with this operation. @@ -2688,9 +3498,10 @@ public WorkloadNetworkDnsServiceInner updateDnsService(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkDnsServiceInner updateDnsService(String resourceGroupName, String privateCloudName, - String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) { - return updateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, - context).block(); + String workloadNetworkName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return beginUpdateDnsService(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + workloadNetworkDnsService, context).getFinalResult(); } /** @@ -2739,38 +3550,39 @@ private Mono>> deleteDnsServiceWithResponseAsync(Strin * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dnsServiceId ID of the DNS service. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteDnsServiceWithResponseAsync(String resourceGroupName, - String dnsServiceId, String privateCloudName, Context context) { + private Response deleteDnsServiceWithResponse(String resourceGroupName, String dnsServiceId, + String privateCloudName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (dnsServiceId == null) { - return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteDnsService(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, dnsServiceId, privateCloudName, accept, context); + return service.deleteDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dnsServiceId, privateCloudName, accept, Context.NONE); } /** @@ -2779,18 +3591,40 @@ private Mono>> deleteDnsServiceWithResponseAsync(Strin * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dnsServiceId ID of the DNS service. * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteDnsServiceAsync(String resourceGroupName, String dnsServiceId, - String privateCloudName) { - Mono>> mono - = deleteDnsServiceWithResponseAsync(resourceGroupName, dnsServiceId, privateCloudName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteDnsServiceWithResponse(String resourceGroupName, String dnsServiceId, + String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dnsServiceId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dnsServiceId, privateCloudName, accept, context); } /** @@ -2799,7 +3633,6 @@ private PollerFlux, Void> beginDeleteDnsServiceAsync(String res * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dnsServiceId ID of the DNS service. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2807,12 +3640,11 @@ private PollerFlux, Void> beginDeleteDnsServiceAsync(String res */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteDnsServiceAsync(String resourceGroupName, String dnsServiceId, - String privateCloudName, Context context) { - context = this.client.mergeContext(context); + String privateCloudName) { Mono>> mono - = deleteDnsServiceWithResponseAsync(resourceGroupName, dnsServiceId, privateCloudName, context); + = deleteDnsServiceWithResponseAsync(resourceGroupName, dnsServiceId, privateCloudName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -2829,7 +3661,8 @@ private PollerFlux, Void> beginDeleteDnsServiceAsync(String res @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName) { - return this.beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).getSyncPoller(); + Response response = deleteDnsServiceWithResponse(resourceGroupName, dnsServiceId, privateCloudName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -2847,8 +3680,9 @@ public SyncPoller, Void> beginDeleteDnsService(String resourceG @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { - return this.beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context) - .getSyncPoller(); + Response response + = deleteDnsServiceWithResponse(resourceGroupName, dnsServiceId, privateCloudName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -2868,25 +3702,6 @@ private Mono deleteDnsServiceAsync(String resourceGroupName, String dnsSer .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a WorkloadNetworkDnsService. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dnsServiceId ID of the DNS service. - * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deleteDnsServiceAsync(String resourceGroupName, String dnsServiceId, String privateCloudName, - Context context) { - return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a WorkloadNetworkDnsService. * @@ -2899,7 +3714,7 @@ private Mono deleteDnsServiceAsync(String resourceGroupName, String dnsSer */ @ServiceMethod(returns = ReturnType.SINGLE) public void deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName) { - deleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).block(); + beginDeleteDnsService(resourceGroupName, dnsServiceId, privateCloudName).getFinalResult(); } /** @@ -2916,7 +3731,7 @@ public void deleteDnsService(String resourceGroupName, String dnsServiceId, Stri @ServiceMethod(returns = ReturnType.SINGLE) public void deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { - deleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context).block(); + beginDeleteDnsService(resourceGroupName, dnsServiceId, privateCloudName, context).getFinalResult(); } /** @@ -2924,6 +3739,7 @@ public void deleteDnsService(String resourceGroupName, String dnsServiceId, Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2932,7 +3748,7 @@ public void deleteDnsService(String resourceGroupName, String dnsServiceId, Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDnsZonesSinglePageAsync(String resourceGroupName, - String privateCloudName) { + String privateCloudName, String workloadNetworkName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2949,10 +3765,15 @@ private Mono> listDnsZonesSinglePageA return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDnsZones(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, 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())); @@ -2963,39 +3784,18 @@ private Mono> listDnsZonesSinglePageA * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkDnsZone list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDnsZonesSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listDnsZones(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDnsZonesAsync(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { + return new PagedFlux<>( + () -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listDnsZonesNextSinglePageAsync(nextLink)); } /** @@ -3003,16 +3803,43 @@ private Mono> listDnsZonesSinglePageA * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkDnsZone list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDnsZonesAsync(String resourceGroupName, - String privateCloudName) { - return new PagedFlux<>(() -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listDnsZonesNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDnsZonesSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listDnsZonesSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -3020,17 +3847,44 @@ private PagedFlux listDnsZonesAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkDnsZone list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDnsZonesAsync(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedFlux<>(() -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listDnsZonesNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDnsZonesSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listDnsZonesSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -3038,14 +3892,18 @@ private PagedFlux listDnsZonesAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listDnsZonesAsync(resourceGroupName, privateCloudName)); + public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { + return new PagedIterable<>( + () -> listDnsZonesSinglePage(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listDnsZonesNextSinglePage(nextLink)); } /** @@ -3053,6 +3911,7 @@ public PagedIterable listDnsZones(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3061,8 +3920,10 @@ public PagedIterable listDnsZones(String resourceGr */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedIterable<>(listDnsZonesAsync(resourceGroupName, privateCloudName, context)); + String workloadNetworkName, Context context) { + return new PagedIterable<>( + () -> listDnsZonesSinglePage(resourceGroupName, privateCloudName, workloadNetworkName, context), + nextLink -> listDnsZonesNextSinglePage(nextLink, context)); } /** @@ -3070,6 +3931,7 @@ public PagedIterable listDnsZones(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3078,7 +3940,7 @@ public PagedIterable listDnsZones(String resourceGr */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDnsZoneWithResponseAsync(String resourceGroupName, - String privateCloudName, String dnsZoneId) { + String privateCloudName, String workloadNetworkName, String dnsZoneId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3095,13 +3957,18 @@ private Mono> getDnsZoneWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (dnsZoneId == null) { return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getDnsZone(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3110,46 +3977,7 @@ private Mono> getDnsZoneWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param dnsZoneId ID of the DNS zone. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 WorkloadNetworkDnsZone along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDnsZoneWithResponseAsync(String resourceGroupName, - String privateCloudName, String dnsZoneId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (dnsZoneId == null) { - return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getDnsZone(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, accept, context); - } - - /** - * Get a WorkloadNetworkDnsZone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3158,8 +3986,8 @@ private Mono> getDnsZoneWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getDnsZoneAsync(String resourceGroupName, String privateCloudName, - String dnsZoneId) { - return getDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId) + String workloadNetworkName, String dnsZoneId) { + return getDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -3168,6 +3996,7 @@ private Mono getDnsZoneAsync(String resourceGroupNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3177,8 +4006,37 @@ private Mono getDnsZoneAsync(String resourceGroupNa */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDnsZoneWithResponse(String resourceGroupName, - String privateCloudName, String dnsZoneId, Context context) { - return getDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, context).block(); + String privateCloudName, String workloadNetworkName, String dnsZoneId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (dnsZoneId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + accept, context); } /** @@ -3186,6 +4044,7 @@ public Response getDnsZoneWithResponse(String resou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3193,8 +4052,10 @@ public Response getDnsZoneWithResponse(String resou * @return a WorkloadNetworkDnsZone. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId) { - return getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, Context.NONE).getValue(); + public WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsZoneId) { + return getDnsZoneWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, Context.NONE) + .getValue(); } /** @@ -3202,6 +4063,7 @@ public WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String p * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3211,7 +4073,8 @@ public WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String p */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createDnsZoneWithResponseAsync(String resourceGroupName, - String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + String privateCloudName, String workloadNetworkName, String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3228,6 +4091,10 @@ private Mono>> createDnsZoneWithResponseAsync(String r return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (dnsZoneId == null) { return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); } @@ -3237,11 +4104,12 @@ private Mono>> createDnsZoneWithResponseAsync(String r } else { workloadNetworkDnsZone.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createDnsZone(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, - accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + contentType, accept, workloadNetworkDnsZone, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3250,48 +4118,54 @@ private Mono>> createDnsZoneWithResponseAsync(String r * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX DNS Zone along with {@link Response} on successful completion of {@link Mono}. + * @return nSX DNS Zone along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createDnsZoneWithResponseAsync(String resourceGroupName, - String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, - Context context) { + private Response createDnsZoneWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (dnsZoneId == null) { - return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); } if (workloadNetworkDnsZone == null) { - return Mono.error( - new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); } else { workloadNetworkDnsZone.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createDnsZone(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, - accept, context); + return service.createDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + contentType, accept, workloadNetworkDnsZone, Context.NONE); } /** @@ -3299,22 +4173,56 @@ private Mono>> createDnsZoneWithResponseAsync(String r * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX DNS Zone. + * @return nSX DNS Zone along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkDnsZoneInner> beginCreateDnsZoneAsync( - String resourceGroupName, String privateCloudName, String dnsZoneId, - WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { - Mono>> mono - = createDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createDnsZoneWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (dnsZoneId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + contentType, accept, workloadNetworkDnsZone, context); } /** @@ -3322,9 +4230,9 @@ private PollerFlux, WorkloadNetworkDnsZo * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -3332,14 +4240,13 @@ private PollerFlux, WorkloadNetworkDnsZo */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkloadNetworkDnsZoneInner> beginCreateDnsZoneAsync( - String resourceGroupName, String privateCloudName, String dnsZoneId, - WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { Mono>> mono = createDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, - dnsZoneId, workloadNetworkDnsZone, context); + workloadNetworkName, dnsZoneId, workloadNetworkDnsZone); return this.client.getLroResult(mono, this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class, - context); + this.client.getContext()); } /** @@ -3347,6 +4254,7 @@ private PollerFlux, WorkloadNetworkDnsZo * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3356,10 +4264,12 @@ private PollerFlux, WorkloadNetworkDnsZo */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( - String resourceGroupName, String privateCloudName, String dnsZoneId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { - return this.beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone) - .getSyncPoller(); + Response response = createDnsZoneWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, dnsZoneId, workloadNetworkDnsZone); + return this.client.getLroResult(response, + WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class, Context.NONE); } /** @@ -3367,6 +4277,7 @@ public SyncPoller, WorkloadNetworkDnsZon * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. * @param context The context to associate with this operation. @@ -3374,33 +4285,15 @@ public SyncPoller, WorkloadNetworkDnsZon * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of nSX DNS Zone. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( - String resourceGroupName, String privateCloudName, String dnsZoneId, - WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) { - return this - .beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) - .getSyncPoller(); - } - - /** - * Create a WorkloadNetworkDnsZone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param dnsZoneId ID of the DNS zone. - * @param workloadNetworkDnsZone Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX DNS Zone on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createDnsZoneAsync(String resourceGroupName, String privateCloudName, - String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { - return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).last() - .flatMap(this.client::getLroFinalResultOrError); + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) { + Response response = createDnsZoneWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, dnsZoneId, workloadNetworkDnsZone, context); + return this.client.getLroResult(response, + WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class, context); } /** @@ -3408,9 +4301,9 @@ private Mono createDnsZoneAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -3418,10 +4311,9 @@ private Mono createDnsZoneAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createDnsZoneAsync(String resourceGroupName, String privateCloudName, - String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) { - return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + workloadNetworkDnsZone).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -3429,6 +4321,7 @@ private Mono createDnsZoneAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3438,8 +4331,9 @@ private Mono createDnsZoneAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, String privateCloudName, - String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { - return createDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).block(); + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return beginCreateDnsZone(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + workloadNetworkDnsZone).getFinalResult(); } /** @@ -3447,6 +4341,7 @@ public WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone Resource create parameters. * @param context The context to associate with this operation. @@ -3457,9 +4352,10 @@ public WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, String privateCloudName, - String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) { - return createDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) - .block(); + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return beginCreateDnsZone(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + workloadNetworkDnsZone, context).getFinalResult(); } /** @@ -3467,6 +4363,7 @@ public WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3476,7 +4373,8 @@ public WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateDnsZoneWithResponseAsync(String resourceGroupName, - String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + String privateCloudName, String workloadNetworkName, String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3493,6 +4391,10 @@ private Mono>> updateDnsZoneWithResponseAsync(String r return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (dnsZoneId == null) { return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); } @@ -3502,11 +4404,12 @@ private Mono>> updateDnsZoneWithResponseAsync(String r } else { workloadNetworkDnsZone.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.updateDnsZone(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, - accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + contentType, accept, workloadNetworkDnsZone, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3515,48 +4418,54 @@ private Mono>> updateDnsZoneWithResponseAsync(String r * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX DNS Zone along with {@link Response} on successful completion of {@link Mono}. + * @return nSX DNS Zone along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateDnsZoneWithResponseAsync(String resourceGroupName, - String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, - Context context) { + private Response updateDnsZoneWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (dnsZoneId == null) { - return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); } if (workloadNetworkDnsZone == null) { - return Mono.error( - new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); } else { workloadNetworkDnsZone.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateDnsZone(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, - accept, context); + return service.updateDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + contentType, accept, workloadNetworkDnsZone, Context.NONE); } /** @@ -3564,22 +4473,56 @@ private Mono>> updateDnsZoneWithResponseAsync(String r * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX DNS Zone. + * @return nSX DNS Zone along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkDnsZoneInner> beginUpdateDnsZoneAsync( - String resourceGroupName, String privateCloudName, String dnsZoneId, - WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { - Mono>> mono - = updateDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateDnsZoneWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (dnsZoneId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + contentType, accept, workloadNetworkDnsZone, context); } /** @@ -3587,9 +4530,9 @@ private PollerFlux, WorkloadNetworkDnsZo * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -3597,14 +4540,13 @@ private PollerFlux, WorkloadNetworkDnsZo */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkloadNetworkDnsZoneInner> beginUpdateDnsZoneAsync( - String resourceGroupName, String privateCloudName, String dnsZoneId, - WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { Mono>> mono = updateDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, - dnsZoneId, workloadNetworkDnsZone, context); + workloadNetworkName, dnsZoneId, workloadNetworkDnsZone); return this.client.getLroResult(mono, this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class, - context); + this.client.getContext()); } /** @@ -3612,6 +4554,7 @@ private PollerFlux, WorkloadNetworkDnsZo * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3621,10 +4564,12 @@ private PollerFlux, WorkloadNetworkDnsZo */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone( - String resourceGroupName, String privateCloudName, String dnsZoneId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { - return this.beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone) - .getSyncPoller(); + Response response = updateDnsZoneWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, dnsZoneId, workloadNetworkDnsZone); + return this.client.getLroResult(response, + WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class, Context.NONE); } /** @@ -3632,6 +4577,7 @@ public SyncPoller, WorkloadNetworkDnsZon * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. * @param context The context to associate with this operation. @@ -3642,30 +4588,12 @@ public SyncPoller, WorkloadNetworkDnsZon */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone( - String resourceGroupName, String privateCloudName, String dnsZoneId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) { - return this - .beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) - .getSyncPoller(); - } - - /** - * Update a WorkloadNetworkDnsZone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param dnsZoneId ID of the DNS zone. - * @param workloadNetworkDnsZone The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX DNS Zone on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateDnsZoneAsync(String resourceGroupName, String privateCloudName, - String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { - return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).last() - .flatMap(this.client::getLroFinalResultOrError); + Response response = updateDnsZoneWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, dnsZoneId, workloadNetworkDnsZone, context); + return this.client.getLroResult(response, + WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class, context); } /** @@ -3673,9 +4601,9 @@ private Mono updateDnsZoneAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -3683,10 +4611,9 @@ private Mono updateDnsZoneAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateDnsZoneAsync(String resourceGroupName, String privateCloudName, - String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) { - return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + workloadNetworkDnsZone).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -3694,6 +4621,7 @@ private Mono updateDnsZoneAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3703,8 +4631,9 @@ private Mono updateDnsZoneAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, String privateCloudName, - String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { - return updateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).block(); + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return beginUpdateDnsZone(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + workloadNetworkDnsZone).getFinalResult(); } /** @@ -3712,6 +4641,7 @@ public WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param workloadNetworkDnsZone The resource properties to be updated. * @param context The context to associate with this operation. @@ -3722,9 +4652,10 @@ public WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, String privateCloudName, - String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) { - return updateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) - .block(); + String workloadNetworkName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return beginUpdateDnsZone(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + workloadNetworkDnsZone, context).getFinalResult(); } /** @@ -3773,38 +4704,39 @@ private Mono>> deleteDnsZoneWithResponseAsync(String r * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dnsZoneId ID of the DNS zone. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteDnsZoneWithResponseAsync(String resourceGroupName, String dnsZoneId, - String privateCloudName, Context context) { + private Response deleteDnsZoneWithResponse(String resourceGroupName, String dnsZoneId, + String privateCloudName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (dnsZoneId == null) { - return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteDnsZone(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, dnsZoneId, privateCloudName, accept, context); + return service.deleteDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dnsZoneId, privateCloudName, accept, Context.NONE); } /** @@ -3813,18 +4745,40 @@ private Mono>> deleteDnsZoneWithResponseAsync(String r * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dnsZoneId ID of the DNS zone. * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteDnsZoneAsync(String resourceGroupName, String dnsZoneId, - String privateCloudName) { - Mono>> mono - = deleteDnsZoneWithResponseAsync(resourceGroupName, dnsZoneId, privateCloudName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteDnsZoneWithResponse(String resourceGroupName, String dnsZoneId, + String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dnsZoneId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dnsZoneId, privateCloudName, accept, context); } /** @@ -3833,7 +4787,6 @@ private PollerFlux, Void> beginDeleteDnsZoneAsync(String resour * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dnsZoneId ID of the DNS zone. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -3841,12 +4794,11 @@ private PollerFlux, Void> beginDeleteDnsZoneAsync(String resour */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteDnsZoneAsync(String resourceGroupName, String dnsZoneId, - String privateCloudName, Context context) { - context = this.client.mergeContext(context); + String privateCloudName) { Mono>> mono - = deleteDnsZoneWithResponseAsync(resourceGroupName, dnsZoneId, privateCloudName, context); + = deleteDnsZoneWithResponseAsync(resourceGroupName, dnsZoneId, privateCloudName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -3863,7 +4815,8 @@ private PollerFlux, Void> beginDeleteDnsZoneAsync(String resour @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName) { - return this.beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).getSyncPoller(); + Response response = deleteDnsZoneWithResponse(resourceGroupName, dnsZoneId, privateCloudName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -3881,7 +4834,9 @@ public SyncPoller, Void> beginDeleteDnsZone(String resourceGrou @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { - return this.beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).getSyncPoller(); + Response response + = deleteDnsZoneWithResponse(resourceGroupName, dnsZoneId, privateCloudName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -3901,25 +4856,6 @@ private Mono deleteDnsZoneAsync(String resourceGroupName, String dnsZoneId .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a WorkloadNetworkDnsZone. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param dnsZoneId ID of the DNS zone. - * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deleteDnsZoneAsync(String resourceGroupName, String dnsZoneId, String privateCloudName, - Context context) { - return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a WorkloadNetworkDnsZone. * @@ -3932,7 +4868,7 @@ private Mono deleteDnsZoneAsync(String resourceGroupName, String dnsZoneId */ @ServiceMethod(returns = ReturnType.SINGLE) public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName) { - deleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).block(); + beginDeleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName).getFinalResult(); } /** @@ -3948,7 +4884,7 @@ public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String pri */ @ServiceMethod(returns = ReturnType.SINGLE) public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { - deleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).block(); + beginDeleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName, context).getFinalResult(); } /** @@ -3956,6 +4892,7 @@ public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String pri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -3964,7 +4901,7 @@ public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String pri */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listGatewaysSinglePageAsync(String resourceGroupName, - String privateCloudName) { + String privateCloudName, String workloadNetworkName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3981,10 +4918,15 @@ private Mono> listGatewaysSinglePageA return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listGateways(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, 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())); @@ -3995,39 +4937,18 @@ private Mono> listGatewaysSinglePageA * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkGateway list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listGatewaysSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listGateways(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGatewaysAsync(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { + return new PagedFlux<>( + () -> listGatewaysSinglePageAsync(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listGatewaysNextSinglePageAsync(nextLink)); } /** @@ -4035,16 +4956,43 @@ private Mono> listGatewaysSinglePageA * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkGateway list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listGatewaysAsync(String resourceGroupName, - String privateCloudName) { - return new PagedFlux<>(() -> listGatewaysSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listGatewaysNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listGatewaysSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listGatewaysSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -4052,17 +5000,44 @@ private PagedFlux listGatewaysAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkGateway list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listGatewaysAsync(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedFlux<>(() -> listGatewaysSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listGatewaysNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listGatewaysSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listGatewaysSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -4070,14 +5045,18 @@ private PagedFlux listGatewaysAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listGateways(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listGatewaysAsync(resourceGroupName, privateCloudName)); + public PagedIterable listGateways(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { + return new PagedIterable<>( + () -> listGatewaysSinglePage(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listGatewaysNextSinglePage(nextLink)); } /** @@ -4085,6 +5064,7 @@ public PagedIterable listGateways(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -4093,8 +5073,10 @@ public PagedIterable listGateways(String resourceGr */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listGateways(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedIterable<>(listGatewaysAsync(resourceGroupName, privateCloudName, context)); + String workloadNetworkName, Context context) { + return new PagedIterable<>( + () -> listGatewaysSinglePage(resourceGroupName, privateCloudName, workloadNetworkName, context), + nextLink -> listGatewaysNextSinglePage(nextLink, context)); } /** @@ -4102,6 +5084,7 @@ public PagedIterable listGateways(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param gatewayId The ID of the NSX Gateway. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -4110,7 +5093,7 @@ public PagedIterable listGateways(String resourceGr */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getGatewayWithResponseAsync(String resourceGroupName, - String privateCloudName, String gatewayId) { + String privateCloudName, String workloadNetworkName, String gatewayId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4127,13 +5110,18 @@ private Mono> getGatewayWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (gatewayId == null) { return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getGateway(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, gatewayId, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, gatewayId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -4142,46 +5130,7 @@ private Mono> getGatewayWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param gatewayId The ID of the NSX Gateway. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 WorkloadNetworkGateway along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getGatewayWithResponseAsync(String resourceGroupName, - String privateCloudName, String gatewayId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (gatewayId == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getGateway(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, gatewayId, accept, context); - } - - /** - * Get a WorkloadNetworkGateway. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param gatewayId The ID of the NSX Gateway. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -4190,8 +5139,8 @@ private Mono> getGatewayWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getGatewayAsync(String resourceGroupName, String privateCloudName, - String gatewayId) { - return getGatewayWithResponseAsync(resourceGroupName, privateCloudName, gatewayId) + String workloadNetworkName, String gatewayId) { + return getGatewayWithResponseAsync(resourceGroupName, privateCloudName, workloadNetworkName, gatewayId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -4200,6 +5149,7 @@ private Mono getGatewayAsync(String resourceGroupNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param gatewayId The ID of the NSX Gateway. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4209,8 +5159,37 @@ private Mono getGatewayAsync(String resourceGroupNa */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getGatewayWithResponse(String resourceGroupName, - String privateCloudName, String gatewayId, Context context) { - return getGatewayWithResponseAsync(resourceGroupName, privateCloudName, gatewayId, context).block(); + String privateCloudName, String workloadNetworkName, String gatewayId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (gatewayId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getGatewaySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, gatewayId, + accept, context); } /** @@ -4218,6 +5197,7 @@ public Response getGatewayWithResponse(String resou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param gatewayId The ID of the NSX Gateway. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -4225,8 +5205,10 @@ public Response getGatewayWithResponse(String resou * @return a WorkloadNetworkGateway. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String privateCloudName, String gatewayId) { - return getGatewayWithResponse(resourceGroupName, privateCloudName, gatewayId, Context.NONE).getValue(); + public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String gatewayId) { + return getGatewayWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, gatewayId, Context.NONE) + .getValue(); } /** @@ -4234,6 +5216,7 @@ public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String p * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4241,8 +5224,8 @@ public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String p * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listPortMirroringSinglePageAsync(String resourceGroupName, String privateCloudName) { + private Mono> listPortMirroringSinglePageAsync( + String resourceGroupName, String privateCloudName, String workloadNetworkName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4259,10 +5242,15 @@ public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String p return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, 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())); @@ -4273,39 +5261,19 @@ public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String p * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkPortMirroring list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return the response of a WorkloadNetworkPortMirroring list operation as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listPortMirroringSinglePageAsync(String resourceGroupName, String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPortMirroringAsync(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + return new PagedFlux<>( + () -> listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listPortMirroringNextSinglePageAsync(nextLink)); } /** @@ -4313,17 +5281,43 @@ public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String p * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkPortMirroring list operation as paginated response with - * {@link PagedFlux}. + * @return the response of a WorkloadNetworkPortMirroring list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listPortMirroringAsync(String resourceGroupName, - String privateCloudName) { - return new PagedFlux<>(() -> listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listPortMirroringNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPortMirroringSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listPortMirroringSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -4331,18 +5325,44 @@ private PagedFlux listPortMirroringAsync(Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkPortMirroring list operation as paginated response with - * {@link PagedFlux}. + * @return the response of a WorkloadNetworkPortMirroring list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listPortMirroringAsync(String resourceGroupName, - String privateCloudName, Context context) { - return new PagedFlux<>(() -> listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listPortMirroringNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPortMirroringSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listPortMirroringSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -4350,6 +5370,7 @@ private PagedFlux listPortMirroringAsync(Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4358,8 +5379,10 @@ private PagedFlux listPortMirroringAsync(Stri */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listPortMirroring(String resourceGroupName, - String privateCloudName) { - return new PagedIterable<>(listPortMirroringAsync(resourceGroupName, privateCloudName)); + String privateCloudName, String workloadNetworkName) { + return new PagedIterable<>( + () -> listPortMirroringSinglePage(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listPortMirroringNextSinglePage(nextLink)); } /** @@ -4367,6 +5390,7 @@ public PagedIterable listPortMirroring(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -4376,8 +5400,10 @@ public PagedIterable listPortMirroring(String */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listPortMirroring(String resourceGroupName, - String privateCloudName, Context context) { - return new PagedIterable<>(listPortMirroringAsync(resourceGroupName, privateCloudName, context)); + String privateCloudName, String workloadNetworkName, Context context) { + return new PagedIterable<>( + () -> listPortMirroringSinglePage(resourceGroupName, privateCloudName, workloadNetworkName, context), + nextLink -> listPortMirroringNextSinglePage(nextLink, context)); } /** @@ -4385,6 +5411,7 @@ public PagedIterable listPortMirroring(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -4392,8 +5419,8 @@ public PagedIterable listPortMirroring(String * @return a WorkloadNetworkPortMirroring along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getPortMirroringWithResponseAsync(String resourceGroupName, String privateCloudName, String portMirroringId) { + private Mono> getPortMirroringWithResponseAsync( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String portMirroringId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4410,6 +5437,10 @@ public PagedIterable listPortMirroring(String return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (portMirroringId == null) { return Mono .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); @@ -4417,7 +5448,8 @@ public PagedIterable listPortMirroring(String final String accept = "application/json"; return FluxUtil .withContext(context -> service.getPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, + portMirroringId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -4426,47 +5458,7 @@ public PagedIterable listPortMirroring(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param portMirroringId ID of the NSX port mirroring profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 WorkloadNetworkPortMirroring along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPortMirroringWithResponseAsync( - String resourceGroupName, String privateCloudName, String portMirroringId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (portMirroringId == null) { - return Mono - .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId, accept, context); - } - - /** - * Get a WorkloadNetworkPortMirroring. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -4475,9 +5467,9 @@ private Mono> getPortMirroringWithRe */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getPortMirroringAsync(String resourceGroupName, - String privateCloudName, String portMirroringId) { - return getPortMirroringWithResponseAsync(resourceGroupName, privateCloudName, portMirroringId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + String privateCloudName, String workloadNetworkName, String portMirroringId) { + return getPortMirroringWithResponseAsync(resourceGroupName, privateCloudName, workloadNetworkName, + portMirroringId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -4485,6 +5477,7 @@ private Mono getPortMirroringAsync(String res * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4494,8 +5487,37 @@ private Mono getPortMirroringAsync(String res */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getPortMirroringWithResponse(String resourceGroupName, - String privateCloudName, String portMirroringId, Context context) { - return getPortMirroringWithResponseAsync(resourceGroupName, privateCloudName, portMirroringId, context).block(); + String privateCloudName, String workloadNetworkName, String portMirroringId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (portMirroringId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getPortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + accept, context); } /** @@ -4503,6 +5525,7 @@ public Response getPortMirroringWithResponse( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -4511,9 +5534,9 @@ public Response getPortMirroringWithResponse( */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkPortMirroringInner getPortMirroring(String resourceGroupName, String privateCloudName, - String portMirroringId) { - return getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, Context.NONE) - .getValue(); + String workloadNetworkName, String portMirroringId) { + return getPortMirroringWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + Context.NONE).getValue(); } /** @@ -4521,6 +5544,7 @@ public WorkloadNetworkPortMirroringInner getPortMirroring(String resourceGroupNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4530,7 +5554,7 @@ public WorkloadNetworkPortMirroringInner getPortMirroring(String resourceGroupNa */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createPortMirroringWithResponseAsync(String resourceGroupName, - String privateCloudName, String portMirroringId, + String privateCloudName, String workloadNetworkName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -4548,6 +5572,10 @@ private Mono>> createPortMirroringWithResponseAsync(St return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (portMirroringId == null) { return Mono .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); @@ -4558,11 +5586,12 @@ private Mono>> createPortMirroringWithResponseAsync(St } else { workloadNetworkPortMirroring.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, + portMirroringId, contentType, accept, workloadNetworkPortMirroring, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -4571,49 +5600,56 @@ private Mono>> createPortMirroringWithResponseAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX Port Mirroring along with {@link Response} on successful completion of {@link Mono}. + * @return nSX Port Mirroring along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createPortMirroringWithResponseAsync(String resourceGroupName, - String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, - Context context) { + private Response createPortMirroringWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (portMirroringId == null) { - return Mono - .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); } if (workloadNetworkPortMirroring == null) { - return Mono.error( - new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); } else { workloadNetworkPortMirroring.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring, accept, context); + return service.createPortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + contentType, accept, workloadNetworkPortMirroring, Context.NONE); } /** @@ -4621,22 +5657,57 @@ private Mono>> createPortMirroringWithResponseAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX Port Mirroring. + * @return nSX Port Mirroring along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkPortMirroringInner> - beginCreatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, - WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { - Mono>> mono = createPortMirroringWithResponseAsync(resourceGroupName, - privateCloudName, portMirroringId, workloadNetworkPortMirroring); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkPortMirroringInner.class, - WorkloadNetworkPortMirroringInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createPortMirroringWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (portMirroringId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createPortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + contentType, accept, workloadNetworkPortMirroring, context); } /** @@ -4644,9 +5715,9 @@ private Mono>> createPortMirroringWithResponseAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4654,14 +5725,13 @@ private Mono>> createPortMirroringWithResponseAsync(St */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkloadNetworkPortMirroringInner> - beginCreatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, - WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { - context = this.client.mergeContext(context); + beginCreatePortMirroringAsync(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { Mono>> mono = createPortMirroringWithResponseAsync(resourceGroupName, - privateCloudName, portMirroringId, workloadNetworkPortMirroring, context); + privateCloudName, workloadNetworkName, portMirroringId, workloadNetworkPortMirroring); return this.client.getLroResult(mono, this.client.getHttpPipeline(), WorkloadNetworkPortMirroringInner.class, - WorkloadNetworkPortMirroringInner.class, context); + WorkloadNetworkPortMirroringInner.class, this.client.getContext()); } /** @@ -4669,6 +5739,7 @@ private Mono>> createPortMirroringWithResponseAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4678,12 +5749,12 @@ private Mono>> createPortMirroringWithResponseAsync(St */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkPortMirroringInner> - beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId, - WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { - return this - .beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring) - .getSyncPoller(); + beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + Response response = createPortMirroringWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, portMirroringId, workloadNetworkPortMirroring); + return this.client.getLroResult(response, + WorkloadNetworkPortMirroringInner.class, WorkloadNetworkPortMirroringInner.class, Context.NONE); } /** @@ -4691,6 +5762,7 @@ private Mono>> createPortMirroringWithResponseAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. * @param context The context to associate with this operation. @@ -4701,12 +5773,12 @@ private Mono>> createPortMirroringWithResponseAsync(St */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkPortMirroringInner> - beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId, - WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { - return this - .beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring, context) - .getSyncPoller(); + beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { + Response response = createPortMirroringWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, portMirroringId, workloadNetworkPortMirroring, context); + return this.client.getLroResult(response, + WorkloadNetworkPortMirroringInner.class, WorkloadNetworkPortMirroringInner.class, context); } /** @@ -4714,6 +5786,7 @@ private Mono>> createPortMirroringWithResponseAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4723,9 +5796,9 @@ private Mono>> createPortMirroringWithResponseAsync(St */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createPortMirroringAsync(String resourceGroupName, - String privateCloudName, String portMirroringId, + String privateCloudName, String workloadNetworkName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { - return beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, + return beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, workloadNetworkPortMirroring).last().flatMap(this.client::getLroFinalResultOrError); } @@ -4734,27 +5807,7 @@ private Mono createPortMirroringAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param portMirroringId ID of the NSX port mirroring profile. - * @param workloadNetworkPortMirroring Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX Port Mirroring on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createPortMirroringAsync(String resourceGroupName, - String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, - Context context) { - return beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a WorkloadNetworkPortMirroring. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4764,9 +5817,10 @@ private Mono createPortMirroringAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, String privateCloudName, - String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { - return createPortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring).block(); + String workloadNetworkName, String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginCreatePortMirroring(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + workloadNetworkPortMirroring).getFinalResult(); } /** @@ -4774,6 +5828,7 @@ public WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring Resource create parameters. * @param context The context to associate with this operation. @@ -4784,9 +5839,10 @@ public WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGrou */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, String privateCloudName, - String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { - return createPortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring, context).block(); + String workloadNetworkName, String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { + return beginCreatePortMirroring(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + workloadNetworkPortMirroring, context).getFinalResult(); } /** @@ -4794,6 +5850,7 @@ public WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4803,7 +5860,7 @@ public WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGrou */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updatePortMirroringWithResponseAsync(String resourceGroupName, - String privateCloudName, String portMirroringId, + String privateCloudName, String workloadNetworkName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -4821,6 +5878,10 @@ private Mono>> updatePortMirroringWithResponseAsync(St return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (portMirroringId == null) { return Mono .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); @@ -4831,11 +5892,12 @@ private Mono>> updatePortMirroringWithResponseAsync(St } else { workloadNetworkPortMirroring.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.updatePortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, + portMirroringId, contentType, accept, workloadNetworkPortMirroring, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -4844,49 +5906,56 @@ private Mono>> updatePortMirroringWithResponseAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX Port Mirroring along with {@link Response} on successful completion of {@link Mono}. + * @return nSX Port Mirroring along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updatePortMirroringWithResponseAsync(String resourceGroupName, - String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, - Context context) { + private Response updatePortMirroringWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (portMirroringId == null) { - return Mono - .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); } if (workloadNetworkPortMirroring == null) { - return Mono.error( - new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); } else { workloadNetworkPortMirroring.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updatePortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring, accept, context); + return service.updatePortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + contentType, accept, workloadNetworkPortMirroring, Context.NONE); } /** @@ -4894,22 +5963,57 @@ private Mono>> updatePortMirroringWithResponseAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX Port Mirroring. + * @return nSX Port Mirroring along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkPortMirroringInner> - beginUpdatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, - WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { - Mono>> mono = updatePortMirroringWithResponseAsync(resourceGroupName, - privateCloudName, portMirroringId, workloadNetworkPortMirroring); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkPortMirroringInner.class, - WorkloadNetworkPortMirroringInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updatePortMirroringWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (portMirroringId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updatePortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + contentType, accept, workloadNetworkPortMirroring, context); } /** @@ -4917,9 +6021,9 @@ private Mono>> updatePortMirroringWithResponseAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4927,14 +6031,13 @@ private Mono>> updatePortMirroringWithResponseAsync(St */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkloadNetworkPortMirroringInner> - beginUpdatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, - WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { - context = this.client.mergeContext(context); + beginUpdatePortMirroringAsync(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { Mono>> mono = updatePortMirroringWithResponseAsync(resourceGroupName, - privateCloudName, portMirroringId, workloadNetworkPortMirroring, context); + privateCloudName, workloadNetworkName, portMirroringId, workloadNetworkPortMirroring); return this.client.getLroResult(mono, this.client.getHttpPipeline(), WorkloadNetworkPortMirroringInner.class, - WorkloadNetworkPortMirroringInner.class, context); + WorkloadNetworkPortMirroringInner.class, this.client.getContext()); } /** @@ -4942,6 +6045,7 @@ private Mono>> updatePortMirroringWithResponseAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4951,12 +6055,12 @@ private Mono>> updatePortMirroringWithResponseAsync(St */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkPortMirroringInner> - beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId, - WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { - return this - .beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring) - .getSyncPoller(); + beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + Response response = updatePortMirroringWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, portMirroringId, workloadNetworkPortMirroring); + return this.client.getLroResult(response, + WorkloadNetworkPortMirroringInner.class, WorkloadNetworkPortMirroringInner.class, Context.NONE); } /** @@ -4964,6 +6068,7 @@ private Mono>> updatePortMirroringWithResponseAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. * @param context The context to associate with this operation. @@ -4974,12 +6079,12 @@ private Mono>> updatePortMirroringWithResponseAsync(St */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkPortMirroringInner> - beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId, - WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { - return this - .beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring, context) - .getSyncPoller(); + beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { + Response response = updatePortMirroringWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, portMirroringId, workloadNetworkPortMirroring, context); + return this.client.getLroResult(response, + WorkloadNetworkPortMirroringInner.class, WorkloadNetworkPortMirroringInner.class, context); } /** @@ -4987,6 +6092,7 @@ private Mono>> updatePortMirroringWithResponseAsync(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4996,9 +6102,9 @@ private Mono>> updatePortMirroringWithResponseAsync(St */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updatePortMirroringAsync(String resourceGroupName, - String privateCloudName, String portMirroringId, + String privateCloudName, String workloadNetworkName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { - return beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, + return beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, workloadNetworkPortMirroring).last().flatMap(this.client::getLroFinalResultOrError); } @@ -5007,27 +6113,7 @@ private Mono updatePortMirroringAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param portMirroringId ID of the NSX port mirroring profile. - * @param workloadNetworkPortMirroring The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX Port Mirroring on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updatePortMirroringAsync(String resourceGroupName, - String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, - Context context) { - return beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a WorkloadNetworkPortMirroring. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -5037,9 +6123,10 @@ private Mono updatePortMirroringAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGroupName, String privateCloudName, - String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { - return updatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring).block(); + String workloadNetworkName, String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginUpdatePortMirroring(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + workloadNetworkPortMirroring).getFinalResult(); } /** @@ -5047,6 +6134,7 @@ public WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param workloadNetworkPortMirroring The resource properties to be updated. * @param context The context to associate with this operation. @@ -5057,9 +6145,10 @@ public WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGrou */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGroupName, String privateCloudName, - String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { - return updatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, - workloadNetworkPortMirroring, context).block(); + String workloadNetworkName, String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { + return beginUpdatePortMirroring(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + workloadNetworkPortMirroring, context).getFinalResult(); } /** @@ -5109,39 +6198,40 @@ private Mono>> deletePortMirroringWithResponseAsync(St * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param portMirroringId ID of the NSX port mirroring profile. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deletePortMirroringWithResponseAsync(String resourceGroupName, - String portMirroringId, String privateCloudName, Context context) { + private Response deletePortMirroringWithResponse(String resourceGroupName, String portMirroringId, + String privateCloudName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (portMirroringId == null) { - return Mono - .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deletePortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, portMirroringId, privateCloudName, accept, context); + return service.deletePortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, portMirroringId, privateCloudName, accept, + Context.NONE); } /** @@ -5150,18 +6240,40 @@ private Mono>> deletePortMirroringWithResponseAsync(St * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param portMirroringId ID of the NSX port mirroring profile. * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeletePortMirroringAsync(String resourceGroupName, - String portMirroringId, String privateCloudName) { - Mono>> mono - = deletePortMirroringWithResponseAsync(resourceGroupName, portMirroringId, privateCloudName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deletePortMirroringWithResponse(String resourceGroupName, String portMirroringId, + String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (portMirroringId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deletePortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, portMirroringId, privateCloudName, accept, context); } /** @@ -5170,7 +6282,6 @@ private PollerFlux, Void> beginDeletePortMirroringAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param portMirroringId ID of the NSX port mirroring profile. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -5178,12 +6289,11 @@ private PollerFlux, Void> beginDeletePortMirroringAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeletePortMirroringAsync(String resourceGroupName, - String portMirroringId, String privateCloudName, Context context) { - context = this.client.mergeContext(context); + String portMirroringId, String privateCloudName) { Mono>> mono - = deletePortMirroringWithResponseAsync(resourceGroupName, portMirroringId, privateCloudName, context); + = deletePortMirroringWithResponseAsync(resourceGroupName, portMirroringId, privateCloudName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -5200,7 +6310,9 @@ private PollerFlux, Void> beginDeletePortMirroringAsync(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName) { - return this.beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).getSyncPoller(); + Response response + = deletePortMirroringWithResponse(resourceGroupName, portMirroringId, privateCloudName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -5218,8 +6330,9 @@ public SyncPoller, Void> beginDeletePortMirroring(String resour @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { - return this.beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName, context) - .getSyncPoller(); + Response response + = deletePortMirroringWithResponse(resourceGroupName, portMirroringId, privateCloudName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -5240,25 +6353,6 @@ private Mono deletePortMirroringAsync(String resourceGroupName, String por .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a WorkloadNetworkPortMirroring. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param portMirroringId ID of the NSX port mirroring profile. - * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deletePortMirroringAsync(String resourceGroupName, String portMirroringId, - String privateCloudName, Context context) { - return beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a WorkloadNetworkPortMirroring. * @@ -5271,7 +6365,7 @@ private Mono deletePortMirroringAsync(String resourceGroupName, String por */ @ServiceMethod(returns = ReturnType.SINGLE) public void deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName) { - deletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).block(); + beginDeletePortMirroring(resourceGroupName, portMirroringId, privateCloudName).getFinalResult(); } /** @@ -5288,7 +6382,7 @@ public void deletePortMirroring(String resourceGroupName, String portMirroringId @ServiceMethod(returns = ReturnType.SINGLE) public void deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { - deletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName, context).block(); + beginDeletePortMirroring(resourceGroupName, portMirroringId, privateCloudName, context).getFinalResult(); } /** @@ -5296,6 +6390,7 @@ public void deletePortMirroring(String resourceGroupName, String portMirroringId * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -5304,7 +6399,7 @@ public void deletePortMirroring(String resourceGroupName, String portMirroringId */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listPublicIPsSinglePageAsync(String resourceGroupName, - String privateCloudName) { + String privateCloudName, String workloadNetworkName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -5321,10 +6416,15 @@ private Mono> listPublicIPsSinglePag return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listPublicIPs(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, 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())); @@ -5335,39 +6435,18 @@ private Mono> listPublicIPsSinglePag * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkPublicIP list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkPublicIP list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPublicIPsSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listPublicIPs(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPublicIPsAsync(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + return new PagedFlux<>( + () -> listPublicIPsSinglePageAsync(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listPublicIPsNextSinglePageAsync(nextLink)); } /** @@ -5375,16 +6454,43 @@ private Mono> listPublicIPsSinglePag * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkPublicIP list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkPublicIP list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listPublicIPsAsync(String resourceGroupName, - String privateCloudName) { - return new PagedFlux<>(() -> listPublicIPsSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listPublicIPsNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPublicIPsSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listPublicIPsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -5392,17 +6498,44 @@ private PagedFlux listPublicIPsAsync(String resour * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkPublicIP list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkPublicIP list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listPublicIPsAsync(String resourceGroupName, - String privateCloudName, Context context) { - return new PagedFlux<>(() -> listPublicIPsSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listPublicIPsNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPublicIPsSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listPublicIPsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -5410,6 +6543,7 @@ private PagedFlux listPublicIPsAsync(String resour * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -5417,9 +6551,11 @@ private PagedFlux listPublicIPsAsync(String resour * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPublicIPs(String resourceGroupName, - String privateCloudName) { - return new PagedIterable<>(listPublicIPsAsync(resourceGroupName, privateCloudName)); + public PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { + return new PagedIterable<>( + () -> listPublicIPsSinglePage(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listPublicIPsNextSinglePage(nextLink)); } /** @@ -5427,6 +6563,7 @@ public PagedIterable listPublicIPs(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -5436,8 +6573,10 @@ public PagedIterable listPublicIPs(String resource */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedIterable<>(listPublicIPsAsync(resourceGroupName, privateCloudName, context)); + String workloadNetworkName, Context context) { + return new PagedIterable<>( + () -> listPublicIPsSinglePage(resourceGroupName, privateCloudName, workloadNetworkName, context), + nextLink -> listPublicIPsNextSinglePage(nextLink, context)); } /** @@ -5445,15 +6584,16 @@ public PagedIterable listPublicIPs(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 WorkloadNetworkPublicIP along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPublicIpWithResponseAsync(String resourceGroupName, - String privateCloudName, String publicIpId) { + private Mono> getPublicIPWithResponseAsync(String resourceGroupName, + String privateCloudName, String workloadNetworkName, String publicIPId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -5470,54 +6610,19 @@ private Mono> getPublicIpWithResponseAsyn return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } - if (publicIpId == null) { - return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getPublicIp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, publicIpId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a WorkloadNetworkPublicIP. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 WorkloadNetworkPublicIP along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPublicIpWithResponseAsync(String resourceGroupName, - String privateCloudName, String publicIpId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { + if (workloadNetworkName == null) { return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } - if (publicIpId == null) { - return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + if (publicIPId == null) { + return Mono.error(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getPublicIp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, publicIpId, accept, context); + return FluxUtil + .withContext(context -> service.getPublicIP(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -5525,16 +6630,17 @@ private Mono> getPublicIpWithResponseAsyn * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 WorkloadNetworkPublicIP on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getPublicIpAsync(String resourceGroupName, String privateCloudName, - String publicIpId) { - return getPublicIpWithResponseAsync(resourceGroupName, privateCloudName, publicIpId) + private Mono getPublicIPAsync(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId) { + return getPublicIPWithResponseAsync(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -5543,7 +6649,8 @@ private Mono getPublicIpAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -5551,9 +6658,38 @@ private Mono getPublicIpAsync(String resourceGroup * @return a WorkloadNetworkPublicIP along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPublicIpWithResponse(String resourceGroupName, - String privateCloudName, String publicIpId, Context context) { - return getPublicIpWithResponseAsync(resourceGroupName, privateCloudName, publicIpId, context).block(); + public Response getPublicIPWithResponse(String resourceGroupName, + String privateCloudName, String workloadNetworkName, String publicIPId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (publicIPId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getPublicIPSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, + accept, context); } /** @@ -5561,16 +6697,18 @@ public Response getPublicIpWithResponse(String res * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 WorkloadNetworkPublicIP. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkPublicIpInner getPublicIp(String resourceGroupName, String privateCloudName, - String publicIpId) { - return getPublicIpWithResponse(resourceGroupName, privateCloudName, publicIpId, Context.NONE).getValue(); + public WorkloadNetworkPublicIpInner getPublicIP(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId) { + return getPublicIPWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, + Context.NONE).getValue(); } /** @@ -5578,16 +6716,18 @@ public WorkloadNetworkPublicIpInner getPublicIp(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return nSX Public IP Block along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createPublicIpWithResponseAsync(String resourceGroupName, - String privateCloudName, String publicIpId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp) { + private Mono>> createPublicIPWithResponseAsync(String resourceGroupName, + String privateCloudName, String workloadNetworkName, String publicIPId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIP) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -5604,20 +6744,25 @@ private Mono>> createPublicIpWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } - if (publicIpId == null) { - return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (publicIPId == null) { + return Mono.error(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); } - if (workloadNetworkPublicIp == null) { + if (workloadNetworkPublicIP == null) { return Mono.error( - new IllegalArgumentException("Parameter workloadNetworkPublicIp is required and cannot be null.")); + new IllegalArgumentException("Parameter workloadNetworkPublicIP is required and cannot be null.")); } else { - workloadNetworkPublicIp.validate(); + workloadNetworkPublicIP.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createPublicIp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, publicIpId, - workloadNetworkPublicIp, accept, context)) + .withContext(context -> service.createPublicIP(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, + contentType, accept, workloadNetworkPublicIP, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -5626,48 +6771,54 @@ private Mono>> createPublicIpWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. - * @param context The context to associate with this operation. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX Public IP Block along with {@link Response} on successful completion of {@link Mono}. + * @return nSX Public IP Block along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createPublicIpWithResponseAsync(String resourceGroupName, - String privateCloudName, String publicIpId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp, - Context context) { + private Response createPublicIPWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId, WorkloadNetworkPublicIpInner workloadNetworkPublicIP) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } - if (publicIpId == null) { - return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } - if (workloadNetworkPublicIp == null) { - return Mono.error( - new IllegalArgumentException("Parameter workloadNetworkPublicIp is required and cannot be null.")); + if (publicIPId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); + } + if (workloadNetworkPublicIP == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkPublicIP is required and cannot be null.")); } else { - workloadNetworkPublicIp.validate(); + workloadNetworkPublicIP.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createPublicIp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp, - accept, context); + return service.createPublicIPSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, + contentType, accept, workloadNetworkPublicIP, Context.NONE); } /** @@ -5675,22 +6826,56 @@ private Mono>> createPublicIpWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX Public IP Block. + * @return nSX Public IP Block along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkPublicIpInner> beginCreatePublicIpAsync( - String resourceGroupName, String privateCloudName, String publicIpId, - WorkloadNetworkPublicIpInner workloadNetworkPublicIp) { - Mono>> mono - = createPublicIpWithResponseAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkPublicIpInner.class, WorkloadNetworkPublicIpInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createPublicIPWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId, WorkloadNetworkPublicIpInner workloadNetworkPublicIP, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (publicIPId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); + } + if (workloadNetworkPublicIP == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkPublicIP is required and cannot be null.")); + } else { + workloadNetworkPublicIP.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createPublicIPSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, + contentType, accept, workloadNetworkPublicIP, context); } /** @@ -5698,24 +6883,23 @@ private PollerFlux, WorkloadNetworkPubl * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. - * @param context The context to associate with this operation. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of nSX Public IP Block. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkPublicIpInner> beginCreatePublicIpAsync( - String resourceGroupName, String privateCloudName, String publicIpId, - WorkloadNetworkPublicIpInner workloadNetworkPublicIp, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createPublicIpWithResponseAsync(resourceGroupName, privateCloudName, - publicIpId, workloadNetworkPublicIp, context); + private PollerFlux, WorkloadNetworkPublicIpInner> beginCreatePublicIPAsync( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String publicIPId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIP) { + Mono>> mono = createPublicIPWithResponseAsync(resourceGroupName, privateCloudName, + workloadNetworkName, publicIPId, workloadNetworkPublicIP); return this.client.getLroResult(mono, this.client.getHttpPipeline(), WorkloadNetworkPublicIpInner.class, WorkloadNetworkPublicIpInner.class, - context); + this.client.getContext()); } /** @@ -5723,19 +6907,22 @@ private PollerFlux, WorkloadNetworkPubl * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of nSX Public IP Block. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIp( - String resourceGroupName, String privateCloudName, String publicIpId, - WorkloadNetworkPublicIpInner workloadNetworkPublicIp) { - return this.beginCreatePublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp) - .getSyncPoller(); + public SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIP( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String publicIPId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIP) { + Response response = createPublicIPWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, publicIPId, workloadNetworkPublicIP); + return this.client.getLroResult(response, + WorkloadNetworkPublicIpInner.class, WorkloadNetworkPublicIpInner.class, Context.NONE); } /** @@ -5743,8 +6930,9 @@ public SyncPoller, WorkloadNetworkPubli * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -5752,31 +6940,13 @@ public SyncPoller, WorkloadNetworkPubli * @return the {@link SyncPoller} for polling of nSX Public IP Block. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIp( - String resourceGroupName, String privateCloudName, String publicIpId, - WorkloadNetworkPublicIpInner workloadNetworkPublicIp, Context context) { - return this - .beginCreatePublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp, context) - .getSyncPoller(); - } - - /** - * Create a WorkloadNetworkPublicIP. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX Public IP Block on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createPublicIpAsync(String resourceGroupName, String privateCloudName, - String publicIpId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp) { - return beginCreatePublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp).last() - .flatMap(this.client::getLroFinalResultOrError); + public SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIP( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String publicIPId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIP, Context context) { + Response response = createPublicIPWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, publicIPId, workloadNetworkPublicIP, context); + return this.client.getLroResult(response, + WorkloadNetworkPublicIpInner.class, WorkloadNetworkPublicIpInner.class, context); } /** @@ -5784,19 +6954,19 @@ private Mono createPublicIpAsync(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. - * @param context The context to associate with this operation. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return nSX Public IP Block on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createPublicIpAsync(String resourceGroupName, String privateCloudName, - String publicIpId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp, Context context) { - return beginCreatePublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp, - context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono createPublicIPAsync(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId, WorkloadNetworkPublicIpInner workloadNetworkPublicIP) { + return beginCreatePublicIPAsync(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, + workloadNetworkPublicIP).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -5804,17 +6974,19 @@ private Mono createPublicIpAsync(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return nSX Public IP Block. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkPublicIpInner createPublicIp(String resourceGroupName, String privateCloudName, - String publicIpId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp) { - return createPublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp).block(); + public WorkloadNetworkPublicIpInner createPublicIP(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId, WorkloadNetworkPublicIpInner workloadNetworkPublicIP) { + return beginCreatePublicIP(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, + workloadNetworkPublicIP).getFinalResult(); } /** @@ -5822,8 +6994,9 @@ public WorkloadNetworkPublicIpInner createPublicIp(String resourceGroupName, Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. - * @param workloadNetworkPublicIp Resource create parameters. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. + * @param workloadNetworkPublicIP Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -5831,17 +7004,18 @@ public WorkloadNetworkPublicIpInner createPublicIp(String resourceGroupName, Str * @return nSX Public IP Block. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkPublicIpInner createPublicIp(String resourceGroupName, String privateCloudName, - String publicIpId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp, Context context) { - return createPublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp, context) - .block(); + public WorkloadNetworkPublicIpInner createPublicIP(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId, WorkloadNetworkPublicIpInner workloadNetworkPublicIP, + Context context) { + return beginCreatePublicIP(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, + workloadNetworkPublicIP, context).getFinalResult(); } /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -5849,8 +7023,8 @@ public WorkloadNetworkPublicIpInner createPublicIp(String resourceGroupName, Str * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deletePublicIpWithResponseAsync(String resourceGroupName, - String publicIpId, String privateCloudName) { + private Mono>> deletePublicIPWithResponseAsync(String resourceGroupName, + String publicIPId, String privateCloudName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -5863,8 +7037,8 @@ private Mono>> deletePublicIpWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (publicIpId == null) { - return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + if (publicIPId == null) { + return Mono.error(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); } if (privateCloudName == null) { return Mono @@ -5872,8 +7046,8 @@ private Mono>> deletePublicIpWithResponseAsync(String } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deletePublicIp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, publicIpId, privateCloudName, accept, context)) + .withContext(context -> service.deletePublicIP(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, publicIPId, privateCloudName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -5881,89 +7055,110 @@ private Mono>> deletePublicIpWithResponseAsync(String * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deletePublicIpWithResponseAsync(String resourceGroupName, - String publicIpId, String privateCloudName, Context context) { + private Response deletePublicIPWithResponse(String resourceGroupName, String publicIPId, + String privateCloudName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (publicIpId == null) { - return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + if (publicIPId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deletePublicIp(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, publicIpId, privateCloudName, accept, context); + return service.deletePublicIPSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, publicIPId, privateCloudName, accept, Context.NONE); } /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeletePublicIpAsync(String resourceGroupName, String publicIpId, - String privateCloudName) { - Mono>> mono - = deletePublicIpWithResponseAsync(resourceGroupName, publicIpId, privateCloudName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deletePublicIPWithResponse(String resourceGroupName, String publicIPId, + String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIPId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deletePublicIPSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, publicIPId, privateCloudName, accept, context); } /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginDeletePublicIpAsync(String resourceGroupName, String publicIpId, - String privateCloudName, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, Void> beginDeletePublicIPAsync(String resourceGroupName, String publicIPId, + String privateCloudName) { Mono>> mono - = deletePublicIpWithResponseAsync(resourceGroupName, publicIpId, privateCloudName, context); + = deletePublicIPWithResponseAsync(resourceGroupName, publicIPId, privateCloudName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -5971,16 +7166,17 @@ private PollerFlux, Void> beginDeletePublicIpAsync(String resou * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeletePublicIp(String resourceGroupName, String publicIpId, + public SyncPoller, Void> beginDeletePublicIP(String resourceGroupName, String publicIPId, String privateCloudName) { - return this.beginDeletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName).getSyncPoller(); + Response response = deletePublicIPWithResponse(resourceGroupName, publicIPId, privateCloudName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -5989,44 +7185,27 @@ public SyncPoller, Void> beginDeletePublicIp(String resourceGro * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeletePublicIp(String resourceGroupName, String publicIpId, + public SyncPoller, Void> beginDeletePublicIP(String resourceGroupName, String publicIPId, String privateCloudName, Context context) { - return this.beginDeletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName, context).getSyncPoller(); - } - - /** - * Delete a WorkloadNetworkPublicIP. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. - * @param privateCloudName Name of the private cloud. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deletePublicIpAsync(String resourceGroupName, String publicIpId, String privateCloudName) { - return beginDeletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName).last() - .flatMap(this.client::getLroFinalResultOrError); + Response response + = deletePublicIPWithResponse(resourceGroupName, publicIPId, privateCloudName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deletePublicIpAsync(String resourceGroupName, String publicIpId, String privateCloudName, - Context context) { - return beginDeletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName, context).last() + private Mono deletePublicIPAsync(String resourceGroupName, String publicIPId, String privateCloudName) { + return beginDeletePublicIPAsync(resourceGroupName, publicIPId, privateCloudName).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -6034,22 +7213,22 @@ private Mono deletePublicIpAsync(String resourceGroupName, String publicIp * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName) { - deletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName).block(); + public void deletePublicIP(String resourceGroupName, String publicIPId, String privateCloudName) { + beginDeletePublicIP(resourceGroupName, publicIPId, privateCloudName).getFinalResult(); } /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -6057,8 +7236,8 @@ public void deletePublicIp(String resourceGroupName, String publicIpId, String p * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName, Context context) { - deletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName, context).block(); + public void deletePublicIP(String resourceGroupName, String publicIPId, String privateCloudName, Context context) { + beginDeletePublicIP(resourceGroupName, publicIPId, privateCloudName, context).getFinalResult(); } /** @@ -6066,6 +7245,7 @@ public void deletePublicIp(String resourceGroupName, String publicIpId, String p * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -6074,7 +7254,7 @@ public void deletePublicIp(String resourceGroupName, String publicIpId, String p */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSegmentsSinglePageAsync(String resourceGroupName, - String privateCloudName) { + String privateCloudName, String workloadNetworkName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -6091,10 +7271,15 @@ private Mono> listSegmentsSinglePageA return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listSegments(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, 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())); @@ -6105,39 +7290,18 @@ private Mono> listSegmentsSinglePageA * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkSegment list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkSegment list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSegmentsSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSegments(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSegmentsAsync(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { + return new PagedFlux<>( + () -> listSegmentsSinglePageAsync(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listSegmentsNextSinglePageAsync(nextLink)); } /** @@ -6145,16 +7309,43 @@ private Mono> listSegmentsSinglePageA * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkSegment list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkSegment list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSegmentsAsync(String resourceGroupName, - String privateCloudName) { - return new PagedFlux<>(() -> listSegmentsSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listSegmentsNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSegmentsSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSegmentsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -6162,17 +7353,44 @@ private PagedFlux listSegmentsAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkSegment list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkSegment list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSegmentsAsync(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedFlux<>(() -> listSegmentsSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listSegmentsNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSegmentsSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSegmentsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -6180,14 +7398,18 @@ private PagedFlux listSegmentsAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkSegment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSegments(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listSegmentsAsync(resourceGroupName, privateCloudName)); + public PagedIterable listSegments(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { + return new PagedIterable<>( + () -> listSegmentsSinglePage(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listSegmentsNextSinglePage(nextLink)); } /** @@ -6195,6 +7417,7 @@ public PagedIterable listSegments(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -6203,8 +7426,10 @@ public PagedIterable listSegments(String resourceGr */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listSegments(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedIterable<>(listSegmentsAsync(resourceGroupName, privateCloudName, context)); + String workloadNetworkName, Context context) { + return new PagedIterable<>( + () -> listSegmentsSinglePage(resourceGroupName, privateCloudName, workloadNetworkName, context), + nextLink -> listSegmentsNextSinglePage(nextLink, context)); } /** @@ -6212,6 +7437,7 @@ public PagedIterable listSegments(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -6220,7 +7446,7 @@ public PagedIterable listSegments(String resourceGr */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getSegmentWithResponseAsync(String resourceGroupName, - String privateCloudName, String segmentId) { + String privateCloudName, String workloadNetworkName, String segmentId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -6237,13 +7463,18 @@ private Mono> getSegmentWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (segmentId == null) { return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getSegment(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -6252,46 +7483,7 @@ private Mono> getSegmentWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param segmentId The ID of the NSX Segment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 WorkloadNetworkSegment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSegmentWithResponseAsync(String resourceGroupName, - String privateCloudName, String segmentId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (segmentId == null) { - return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getSegment(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, accept, context); - } - - /** - * Get a WorkloadNetworkSegment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -6300,8 +7492,8 @@ private Mono> getSegmentWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getSegmentAsync(String resourceGroupName, String privateCloudName, - String segmentId) { - return getSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId) + String workloadNetworkName, String segmentId) { + return getSegmentWithResponseAsync(resourceGroupName, privateCloudName, workloadNetworkName, segmentId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -6310,6 +7502,7 @@ private Mono getSegmentAsync(String resourceGroupNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -6319,8 +7512,37 @@ private Mono getSegmentAsync(String resourceGroupNa */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getSegmentWithResponse(String resourceGroupName, - String privateCloudName, String segmentId, Context context) { - return getSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId, context).block(); + String privateCloudName, String workloadNetworkName, String segmentId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (segmentId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSegmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + accept, context); } /** @@ -6328,6 +7550,7 @@ public Response getSegmentWithResponse(String resou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -6335,8 +7558,10 @@ public Response getSegmentWithResponse(String resou * @return a WorkloadNetworkSegment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String privateCloudName, String segmentId) { - return getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, Context.NONE).getValue(); + public WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId) { + return getSegmentWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, Context.NONE) + .getValue(); } /** @@ -6344,6 +7569,7 @@ public WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String p * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -6352,8 +7578,9 @@ public WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String p * @return nSX Segment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createSegmentsWithResponseAsync(String resourceGroupName, - String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + private Mono>> createSegmentWithResponseAsync(String resourceGroupName, + String privateCloudName, String workloadNetworkName, String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -6370,6 +7597,10 @@ private Mono>> createSegmentsWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (segmentId == null) { return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); } @@ -6379,11 +7610,12 @@ private Mono>> createSegmentsWithResponseAsync(String } else { workloadNetworkSegment.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createSegments(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, - accept, context)) + .withContext(context -> service.createSegment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + contentType, accept, workloadNetworkSegment, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -6392,48 +7624,54 @@ private Mono>> createSegmentsWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX Segment along with {@link Response} on successful completion of {@link Mono}. + * @return nSX Segment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createSegmentsWithResponseAsync(String resourceGroupName, - String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, - Context context) { + private Response createSegmentWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (segmentId == null) { - return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); } if (workloadNetworkSegment == null) { - return Mono.error( - new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); } else { workloadNetworkSegment.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createSegments(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, - accept, context); + return service.createSegmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + contentType, accept, workloadNetworkSegment, Context.NONE); } /** @@ -6441,22 +7679,56 @@ private Mono>> createSegmentsWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX Segment. + * @return nSX Segment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkSegmentInner> beginCreateSegmentsAsync( - String resourceGroupName, String privateCloudName, String segmentId, - WorkloadNetworkSegmentInner workloadNetworkSegment) { - Mono>> mono - = createSegmentsWithResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkSegmentInner.class, WorkloadNetworkSegmentInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createSegmentWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (segmentId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSegmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + contentType, accept, workloadNetworkSegment, context); } /** @@ -6464,24 +7736,23 @@ private PollerFlux, WorkloadNetworkSegme * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of nSX Segment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkSegmentInner> beginCreateSegmentsAsync( - String resourceGroupName, String privateCloudName, String segmentId, - WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createSegmentsWithResponseAsync(resourceGroupName, privateCloudName, - segmentId, workloadNetworkSegment, context); + private PollerFlux, WorkloadNetworkSegmentInner> beginCreateSegmentAsync( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + Mono>> mono = createSegmentWithResponseAsync(resourceGroupName, privateCloudName, + workloadNetworkName, segmentId, workloadNetworkSegment); return this.client.getLroResult(mono, this.client.getHttpPipeline(), WorkloadNetworkSegmentInner.class, WorkloadNetworkSegmentInner.class, - context); + this.client.getContext()); } /** @@ -6489,6 +7760,7 @@ private PollerFlux, WorkloadNetworkSegme * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -6497,11 +7769,13 @@ private PollerFlux, WorkloadNetworkSegme * @return the {@link SyncPoller} for polling of nSX Segment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments( - String resourceGroupName, String privateCloudName, String segmentId, + public SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegment( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { - return this.beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment) - .getSyncPoller(); + Response response = createSegmentWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, segmentId, workloadNetworkSegment); + return this.client.getLroResult(response, + WorkloadNetworkSegmentInner.class, WorkloadNetworkSegmentInner.class, Context.NONE); } /** @@ -6509,6 +7783,7 @@ public SyncPoller, WorkloadNetworkSegmen * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. * @param context The context to associate with this operation. @@ -6518,31 +7793,13 @@ public SyncPoller, WorkloadNetworkSegmen * @return the {@link SyncPoller} for polling of nSX Segment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments( - String resourceGroupName, String privateCloudName, String segmentId, + public SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegment( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) { - return this - .beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) - .getSyncPoller(); - } - - /** - * Create a WorkloadNetworkSegment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param segmentId The ID of the NSX Segment. - * @param workloadNetworkSegment Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX Segment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createSegmentsAsync(String resourceGroupName, String privateCloudName, - String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { - return beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).last() - .flatMap(this.client::getLroFinalResultOrError); + Response response = createSegmentWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, segmentId, workloadNetworkSegment, context); + return this.client.getLroResult(response, + WorkloadNetworkSegmentInner.class, WorkloadNetworkSegmentInner.class, context); } /** @@ -6550,20 +7807,19 @@ private Mono createSegmentsAsync(String resourceGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return nSX Segment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createSegmentsAsync(String resourceGroupName, String privateCloudName, - String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) { - return beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono createSegmentAsync(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginCreateSegmentAsync(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + workloadNetworkSegment).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -6571,6 +7827,7 @@ private Mono createSegmentsAsync(String resourceGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -6579,9 +7836,10 @@ private Mono createSegmentsAsync(String resourceGro * @return nSX Segment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkSegmentInner createSegments(String resourceGroupName, String privateCloudName, - String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { - return createSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).block(); + public WorkloadNetworkSegmentInner createSegment(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginCreateSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + workloadNetworkSegment).getFinalResult(); } /** @@ -6589,6 +7847,7 @@ public WorkloadNetworkSegmentInner createSegments(String resourceGroupName, Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment Resource create parameters. * @param context The context to associate with this operation. @@ -6598,10 +7857,11 @@ public WorkloadNetworkSegmentInner createSegments(String resourceGroupName, Stri * @return nSX Segment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkSegmentInner createSegments(String resourceGroupName, String privateCloudName, - String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) { - return createSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) - .block(); + public WorkloadNetworkSegmentInner createSegment(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return beginCreateSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + workloadNetworkSegment, context).getFinalResult(); } /** @@ -6609,6 +7869,7 @@ public WorkloadNetworkSegmentInner createSegments(String resourceGroupName, Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -6617,8 +7878,9 @@ public WorkloadNetworkSegmentInner createSegments(String resourceGroupName, Stri * @return nSX Segment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateSegmentsWithResponseAsync(String resourceGroupName, - String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + private Mono>> updateSegmentWithResponseAsync(String resourceGroupName, + String privateCloudName, String workloadNetworkName, String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -6635,6 +7897,10 @@ private Mono>> updateSegmentsWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (segmentId == null) { return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); } @@ -6644,11 +7910,12 @@ private Mono>> updateSegmentsWithResponseAsync(String } else { workloadNetworkSegment.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateSegments(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, - accept, context)) + .withContext(context -> service.updateSegment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + contentType, accept, workloadNetworkSegment, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -6657,48 +7924,54 @@ private Mono>> updateSegmentsWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX Segment along with {@link Response} on successful completion of {@link Mono}. + * @return nSX Segment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateSegmentsWithResponseAsync(String resourceGroupName, - String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, - Context context) { + private Response updateSegmentWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (segmentId == null) { - return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); } if (workloadNetworkSegment == null) { - return Mono.error( - new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); } else { workloadNetworkSegment.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateSegments(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, - accept, context); + return service.updateSegmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + contentType, accept, workloadNetworkSegment, Context.NONE); } /** @@ -6706,22 +7979,56 @@ private Mono>> updateSegmentsWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX Segment. + * @return nSX Segment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkSegmentInner> beginUpdateSegmentsAsync( - String resourceGroupName, String privateCloudName, String segmentId, - WorkloadNetworkSegmentInner workloadNetworkSegment) { - Mono>> mono - = updateSegmentsWithResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkSegmentInner.class, WorkloadNetworkSegmentInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateSegmentWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (segmentId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSegmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + contentType, accept, workloadNetworkSegment, context); } /** @@ -6729,24 +8036,23 @@ private PollerFlux, WorkloadNetworkSegme * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of nSX Segment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkSegmentInner> beginUpdateSegmentsAsync( - String resourceGroupName, String privateCloudName, String segmentId, - WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateSegmentsWithResponseAsync(resourceGroupName, privateCloudName, - segmentId, workloadNetworkSegment, context); + private PollerFlux, WorkloadNetworkSegmentInner> beginUpdateSegmentAsync( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + Mono>> mono = updateSegmentWithResponseAsync(resourceGroupName, privateCloudName, + workloadNetworkName, segmentId, workloadNetworkSegment); return this.client.getLroResult(mono, this.client.getHttpPipeline(), WorkloadNetworkSegmentInner.class, WorkloadNetworkSegmentInner.class, - context); + this.client.getContext()); } /** @@ -6754,6 +8060,7 @@ private PollerFlux, WorkloadNetworkSegme * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -6762,11 +8069,13 @@ private PollerFlux, WorkloadNetworkSegme * @return the {@link SyncPoller} for polling of nSX Segment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments( - String resourceGroupName, String privateCloudName, String segmentId, + public SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegment( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { - return this.beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment) - .getSyncPoller(); + Response response = updateSegmentWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, segmentId, workloadNetworkSegment); + return this.client.getLroResult(response, + WorkloadNetworkSegmentInner.class, WorkloadNetworkSegmentInner.class, Context.NONE); } /** @@ -6774,6 +8083,7 @@ public SyncPoller, WorkloadNetworkSegmen * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. * @param context The context to associate with this operation. @@ -6783,31 +8093,13 @@ public SyncPoller, WorkloadNetworkSegmen * @return the {@link SyncPoller} for polling of nSX Segment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments( - String resourceGroupName, String privateCloudName, String segmentId, + public SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegment( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) { - return this - .beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) - .getSyncPoller(); - } - - /** - * Update a WorkloadNetworkSegment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param segmentId The ID of the NSX Segment. - * @param workloadNetworkSegment The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX Segment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateSegmentsAsync(String resourceGroupName, String privateCloudName, - String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { - return beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).last() - .flatMap(this.client::getLroFinalResultOrError); + Response response = updateSegmentWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, segmentId, workloadNetworkSegment, context); + return this.client.getLroResult(response, + WorkloadNetworkSegmentInner.class, WorkloadNetworkSegmentInner.class, context); } /** @@ -6815,20 +8107,19 @@ private Mono updateSegmentsAsync(String resourceGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return nSX Segment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateSegmentsAsync(String resourceGroupName, String privateCloudName, - String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) { - return beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono updateSegmentAsync(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginUpdateSegmentAsync(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + workloadNetworkSegment).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -6836,6 +8127,7 @@ private Mono updateSegmentsAsync(String resourceGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -6844,9 +8136,10 @@ private Mono updateSegmentsAsync(String resourceGro * @return nSX Segment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, String privateCloudName, - String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { - return updateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).block(); + public WorkloadNetworkSegmentInner updateSegment(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginUpdateSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + workloadNetworkSegment).getFinalResult(); } /** @@ -6854,6 +8147,7 @@ public WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param workloadNetworkSegment The resource properties to be updated. * @param context The context to associate with this operation. @@ -6863,10 +8157,11 @@ public WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, Stri * @return nSX Segment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, String privateCloudName, - String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) { - return updateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) - .block(); + public WorkloadNetworkSegmentInner updateSegment(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return beginUpdateSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + workloadNetworkSegment, context).getFinalResult(); } /** @@ -6874,6 +8169,7 @@ public WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -6882,7 +8178,7 @@ public WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteSegmentWithResponseAsync(String resourceGroupName, - String privateCloudName, String segmentId) { + String privateCloudName, String workloadNetworkName, String segmentId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -6899,13 +8195,18 @@ private Mono>> deleteSegmentWithResponseAsync(String r return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (segmentId == null) { return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.deleteSegment(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -6914,39 +8215,46 @@ private Mono>> deleteSegmentWithResponseAsync(String r * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteSegmentWithResponseAsync(String resourceGroupName, - String privateCloudName, String segmentId, Context context) { + private Response deleteSegmentWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (segmentId == null) { - return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteSegment(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, accept, context); + return service.deleteSegmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + accept, Context.NONE); } /** @@ -6954,19 +8262,47 @@ private Mono>> deleteSegmentWithResponseAsync(String r * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteSegmentAsync(String resourceGroupName, - String privateCloudName, String segmentId) { - Mono>> mono - = deleteSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteSegmentWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (segmentId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSegmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + accept, context); } /** @@ -6974,8 +8310,8 @@ private PollerFlux, Void> beginDeleteSegmentAsync(String resour * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -6983,12 +8319,11 @@ private PollerFlux, Void> beginDeleteSegmentAsync(String resour */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteSegmentAsync(String resourceGroupName, - String privateCloudName, String segmentId, Context context) { - context = this.client.mergeContext(context); + String privateCloudName, String workloadNetworkName, String segmentId) { Mono>> mono - = deleteSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId, context); + = deleteSegmentWithResponseAsync(resourceGroupName, privateCloudName, workloadNetworkName, segmentId); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -6996,6 +8331,7 @@ private PollerFlux, Void> beginDeleteSegmentAsync(String resour * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7004,8 +8340,10 @@ private PollerFlux, Void> beginDeleteSegmentAsync(String resour */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeleteSegment(String resourceGroupName, String privateCloudName, - String segmentId) { - return this.beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).getSyncPoller(); + String workloadNetworkName, String segmentId) { + Response response + = deleteSegmentWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, segmentId); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -7013,6 +8351,7 @@ public SyncPoller, Void> beginDeleteSegment(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7022,25 +8361,10 @@ public SyncPoller, Void> beginDeleteSegment(String resourceGrou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeleteSegment(String resourceGroupName, String privateCloudName, - String segmentId, Context context) { - return this.beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId, context).getSyncPoller(); - } - - /** - * Delete a WorkloadNetworkSegment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param segmentId The ID of the NSX Segment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deleteSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId) { - return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).last() - .flatMap(this.client::getLroFinalResultOrError); + String workloadNetworkName, String segmentId, Context context) { + Response response + = deleteSegmentWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -7048,17 +8372,17 @@ private Mono deleteSegmentAsync(String resourceGroupName, String privateCl * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deleteSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId, - Context context) { - return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId, context).last() + private Mono deleteSegmentAsync(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String segmentId) { + return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, workloadNetworkName, segmentId).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -7067,14 +8391,16 @@ private Mono deleteSegmentAsync(String resourceGroupName, String privateCl * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 deleteSegment(String resourceGroupName, String privateCloudName, String segmentId) { - deleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).block(); + public void deleteSegment(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String segmentId) { + beginDeleteSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId).getFinalResult(); } /** @@ -7082,6 +8408,7 @@ public void deleteSegment(String resourceGroupName, String privateCloudName, Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7089,8 +8416,10 @@ public void deleteSegment(String resourceGroupName, String privateCloudName, Str * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context) { - deleteSegmentAsync(resourceGroupName, privateCloudName, segmentId, context).block(); + public void deleteSegment(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String segmentId, Context context) { + beginDeleteSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, context) + .getFinalResult(); } /** @@ -7098,6 +8427,7 @@ public void deleteSegment(String resourceGroupName, String privateCloudName, Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -7105,8 +8435,8 @@ public void deleteSegment(String resourceGroupName, String privateCloudName, Str * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listVirtualMachinesSinglePageAsync(String resourceGroupName, String privateCloudName) { + private Mono> listVirtualMachinesSinglePageAsync( + String resourceGroupName, String privateCloudName, String workloadNetworkName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -7123,10 +8453,15 @@ public void deleteSegment(String resourceGroupName, String privateCloudName, Str return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listVirtualMachines(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, 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())); @@ -7137,39 +8472,19 @@ public void deleteSegment(String resourceGroupName, String privateCloudName, Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkVirtualMachine list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return the response of a WorkloadNetworkVirtualMachine list operation as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listVirtualMachinesSinglePageAsync(String resourceGroupName, String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVirtualMachines(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachinesAsync(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + return new PagedFlux<>( + () -> listVirtualMachinesSinglePageAsync(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listVirtualMachinesNextSinglePageAsync(nextLink)); } /** @@ -7177,17 +8492,43 @@ public void deleteSegment(String resourceGroupName, String privateCloudName, Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkVirtualMachine list operation as paginated response with - * {@link PagedFlux}. + * @return the response of a WorkloadNetworkVirtualMachine list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listVirtualMachinesAsync(String resourceGroupName, - String privateCloudName) { - return new PagedFlux<>(() -> listVirtualMachinesSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listVirtualMachinesNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVirtualMachinesSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listVirtualMachinesSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -7195,18 +8536,44 @@ private PagedFlux listVirtualMachinesAsync(S * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkVirtualMachine list operation as paginated response with - * {@link PagedFlux}. + * @return the response of a WorkloadNetworkVirtualMachine list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listVirtualMachinesAsync(String resourceGroupName, - String privateCloudName, Context context) { - return new PagedFlux<>(() -> listVirtualMachinesSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listVirtualMachinesNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVirtualMachinesSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listVirtualMachinesSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -7214,6 +8581,7 @@ private PagedFlux listVirtualMachinesAsync(S * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -7222,8 +8590,10 @@ private PagedFlux listVirtualMachinesAsync(S */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listVirtualMachines(String resourceGroupName, - String privateCloudName) { - return new PagedIterable<>(listVirtualMachinesAsync(resourceGroupName, privateCloudName)); + String privateCloudName, String workloadNetworkName) { + return new PagedIterable<>( + () -> listVirtualMachinesSinglePage(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listVirtualMachinesNextSinglePage(nextLink)); } /** @@ -7231,6 +8601,7 @@ public PagedIterable listVirtualMachines(Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7240,8 +8611,10 @@ public PagedIterable listVirtualMachines(Str */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listVirtualMachines(String resourceGroupName, - String privateCloudName, Context context) { - return new PagedIterable<>(listVirtualMachinesAsync(resourceGroupName, privateCloudName, context)); + String privateCloudName, String workloadNetworkName, Context context) { + return new PagedIterable<>( + () -> listVirtualMachinesSinglePage(resourceGroupName, privateCloudName, workloadNetworkName, context), + nextLink -> listVirtualMachinesNextSinglePage(nextLink, context)); } /** @@ -7249,6 +8622,7 @@ public PagedIterable listVirtualMachines(Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param virtualMachineId ID of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7256,8 +8630,8 @@ public PagedIterable listVirtualMachines(Str * @return a WorkloadNetworkVirtualMachine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getVirtualMachineWithResponseAsync(String resourceGroupName, String privateCloudName, String virtualMachineId) { + private Mono> getVirtualMachineWithResponseAsync( + String resourceGroupName, String privateCloudName, String workloadNetworkName, String virtualMachineId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -7274,6 +8648,10 @@ public PagedIterable listVirtualMachines(Str return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (virtualMachineId == null) { return Mono .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); @@ -7281,8 +8659,8 @@ public PagedIterable listVirtualMachines(Str final String accept = "application/json"; return FluxUtil .withContext(context -> service.getVirtualMachine(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, virtualMachineId, accept, - context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, + virtualMachineId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -7291,47 +8669,7 @@ public PagedIterable listVirtualMachines(Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param virtualMachineId ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 WorkloadNetworkVirtualMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getVirtualMachineWithResponseAsync( - String resourceGroupName, String privateCloudName, String virtualMachineId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (virtualMachineId == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getVirtualMachine(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, virtualMachineId, accept, context); - } - - /** - * Get a WorkloadNetworkVirtualMachine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param virtualMachineId ID of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7340,9 +8678,9 @@ private Mono> getVirtualMachineWith */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getVirtualMachineAsync(String resourceGroupName, - String privateCloudName, String virtualMachineId) { - return getVirtualMachineWithResponseAsync(resourceGroupName, privateCloudName, virtualMachineId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + String privateCloudName, String workloadNetworkName, String virtualMachineId) { + return getVirtualMachineWithResponseAsync(resourceGroupName, privateCloudName, workloadNetworkName, + virtualMachineId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -7350,6 +8688,7 @@ private Mono getVirtualMachineAsync(String r * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param virtualMachineId ID of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7359,9 +8698,37 @@ private Mono getVirtualMachineAsync(String r */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getVirtualMachineWithResponse(String resourceGroupName, - String privateCloudName, String virtualMachineId, Context context) { - return getVirtualMachineWithResponseAsync(resourceGroupName, privateCloudName, virtualMachineId, context) - .block(); + String privateCloudName, String workloadNetworkName, String virtualMachineId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (virtualMachineId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getVirtualMachineSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, virtualMachineId, + accept, context); } /** @@ -7369,6 +8736,7 @@ public Response getVirtualMachineWithRespons * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param virtualMachineId ID of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7377,9 +8745,9 @@ public Response getVirtualMachineWithRespons */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkVirtualMachineInner getVirtualMachine(String resourceGroupName, String privateCloudName, - String virtualMachineId) { - return getVirtualMachineWithResponse(resourceGroupName, privateCloudName, virtualMachineId, Context.NONE) - .getValue(); + String workloadNetworkName, String virtualMachineId) { + return getVirtualMachineWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, virtualMachineId, + Context.NONE).getValue(); } /** @@ -7387,6 +8755,7 @@ public WorkloadNetworkVirtualMachineInner getVirtualMachine(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -7395,7 +8764,7 @@ public WorkloadNetworkVirtualMachineInner getVirtualMachine(String resourceGroup */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVMGroupsSinglePageAsync(String resourceGroupName, - String privateCloudName) { + String privateCloudName, String workloadNetworkName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -7412,10 +8781,15 @@ private Mono> listVMGroupsSinglePageA return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listVMGroups(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, 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())); @@ -7426,39 +8800,18 @@ private Mono> listVMGroupsSinglePageA * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkVMGroup list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkVMGroup list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVMGroupsSinglePageAsync(String resourceGroupName, - String privateCloudName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVMGroups(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, privateCloudName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVMGroupsAsync(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { + return new PagedFlux<>( + () -> listVMGroupsSinglePageAsync(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listVMGroupsNextSinglePageAsync(nextLink)); } /** @@ -7466,16 +8819,43 @@ private Mono> listVMGroupsSinglePageA * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkVMGroup list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkVMGroup list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listVMGroupsAsync(String resourceGroupName, - String privateCloudName) { - return new PagedFlux<>(() -> listVMGroupsSinglePageAsync(resourceGroupName, privateCloudName), - nextLink -> listVMGroupsNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVMGroupsSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listVMGroupsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -7483,17 +8863,44 @@ private PagedFlux listVMGroupsAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkVMGroup list operation as paginated response with {@link PagedFlux}. + * @return the response of a WorkloadNetworkVMGroup list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listVMGroupsAsync(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedFlux<>(() -> listVMGroupsSinglePageAsync(resourceGroupName, privateCloudName, context), - nextLink -> listVMGroupsNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVMGroupsSinglePage(String resourceGroupName, + String privateCloudName, String workloadNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listVMGroupsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, + workloadNetworkName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -7501,14 +8908,18 @@ private PagedFlux listVMGroupsAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkVMGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVMGroups(String resourceGroupName, String privateCloudName) { - return new PagedIterable<>(listVMGroupsAsync(resourceGroupName, privateCloudName)); + public PagedIterable listVMGroups(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { + return new PagedIterable<>( + () -> listVMGroupsSinglePage(resourceGroupName, privateCloudName, workloadNetworkName), + nextLink -> listVMGroupsNextSinglePage(nextLink)); } /** @@ -7516,6 +8927,7 @@ public PagedIterable listVMGroups(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7524,8 +8936,10 @@ public PagedIterable listVMGroups(String resourceGr */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listVMGroups(String resourceGroupName, String privateCloudName, - Context context) { - return new PagedIterable<>(listVMGroupsAsync(resourceGroupName, privateCloudName, context)); + String workloadNetworkName, Context context) { + return new PagedIterable<>( + () -> listVMGroupsSinglePage(resourceGroupName, privateCloudName, workloadNetworkName, context), + nextLink -> listVMGroupsNextSinglePage(nextLink, context)); } /** @@ -7533,6 +8947,7 @@ public PagedIterable listVMGroups(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7541,7 +8956,7 @@ public PagedIterable listVMGroups(String resourceGr */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getVMGroupWithResponseAsync(String resourceGroupName, - String privateCloudName, String vmGroupId) { + String privateCloudName, String workloadNetworkName, String vmGroupId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -7558,13 +8973,18 @@ private Mono> getVMGroupWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (vmGroupId == null) { return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getVMGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -7573,46 +8993,7 @@ private Mono> getVMGroupWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param vmGroupId ID of the VM group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 WorkloadNetworkVMGroup along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getVMGroupWithResponseAsync(String resourceGroupName, - String privateCloudName, String vmGroupId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); - } - if (vmGroupId == null) { - return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getVMGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, accept, context); - } - - /** - * Get a WorkloadNetworkVMGroup. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7621,8 +9002,8 @@ private Mono> getVMGroupWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getVMGroupAsync(String resourceGroupName, String privateCloudName, - String vmGroupId) { - return getVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId) + String workloadNetworkName, String vmGroupId) { + return getVMGroupWithResponseAsync(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -7631,6 +9012,7 @@ private Mono getVMGroupAsync(String resourceGroupNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7640,8 +9022,37 @@ private Mono getVMGroupAsync(String resourceGroupNa */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getVMGroupWithResponse(String resourceGroupName, - String privateCloudName, String vmGroupId, Context context) { - return getVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId, context).block(); + String privateCloudName, String workloadNetworkName, String vmGroupId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (vmGroupId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + accept, context); } /** @@ -7649,6 +9060,7 @@ public Response getVMGroupWithResponse(String resou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7656,8 +9068,10 @@ public Response getVMGroupWithResponse(String resou * @return a WorkloadNetworkVMGroup. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId) { - return getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, Context.NONE).getValue(); + public WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String vmGroupId) { + return getVMGroupWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, Context.NONE) + .getValue(); } /** @@ -7665,6 +9079,7 @@ public WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String p * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7674,7 +9089,8 @@ public WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String p */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createVMGroupWithResponseAsync(String resourceGroupName, - String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + String privateCloudName, String workloadNetworkName, String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -7691,6 +9107,10 @@ private Mono>> createVMGroupWithResponseAsync(String r return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (vmGroupId == null) { return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); } @@ -7700,11 +9120,12 @@ private Mono>> createVMGroupWithResponseAsync(String r } else { workloadNetworkVMGroup.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createVMGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, - accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + contentType, accept, workloadNetworkVMGroup, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -7713,48 +9134,54 @@ private Mono>> createVMGroupWithResponseAsync(String r * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX VM Group along with {@link Response} on successful completion of {@link Mono}. + * @return nSX VM Group along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createVMGroupWithResponseAsync(String resourceGroupName, - String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, - Context context) { + private Response createVMGroupWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (vmGroupId == null) { - return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); } if (workloadNetworkVMGroup == null) { - return Mono.error( - new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); } else { workloadNetworkVMGroup.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createVMGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, - accept, context); + return service.createVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + contentType, accept, workloadNetworkVMGroup, Context.NONE); } /** @@ -7762,22 +9189,56 @@ private Mono>> createVMGroupWithResponseAsync(String r * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX VM Group. + * @return nSX VM Group along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkVMGroupInner> beginCreateVMGroupAsync( - String resourceGroupName, String privateCloudName, String vmGroupId, - WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { - Mono>> mono - = createVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkVMGroupInner.class, WorkloadNetworkVMGroupInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createVMGroupWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (vmGroupId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + contentType, accept, workloadNetworkVMGroup, context); } /** @@ -7785,9 +9246,9 @@ private PollerFlux, WorkloadNetworkVMGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -7795,14 +9256,13 @@ private PollerFlux, WorkloadNetworkVMGro */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkloadNetworkVMGroupInner> beginCreateVMGroupAsync( - String resourceGroupName, String privateCloudName, String vmGroupId, - WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String privateCloudName, String workloadNetworkName, String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { Mono>> mono = createVMGroupWithResponseAsync(resourceGroupName, privateCloudName, - vmGroupId, workloadNetworkVMGroup, context); + workloadNetworkName, vmGroupId, workloadNetworkVMGroup); return this.client.getLroResult(mono, this.client.getHttpPipeline(), WorkloadNetworkVMGroupInner.class, WorkloadNetworkVMGroupInner.class, - context); + this.client.getContext()); } /** @@ -7810,6 +9270,7 @@ private PollerFlux, WorkloadNetworkVMGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7819,10 +9280,12 @@ private PollerFlux, WorkloadNetworkVMGro */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup( - String resourceGroupName, String privateCloudName, String vmGroupId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { - return this.beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup) - .getSyncPoller(); + Response response = createVMGroupWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, vmGroupId, workloadNetworkVMGroup); + return this.client.getLroResult(response, + WorkloadNetworkVMGroupInner.class, WorkloadNetworkVMGroupInner.class, Context.NONE); } /** @@ -7830,6 +9293,7 @@ public SyncPoller, WorkloadNetworkVMGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. * @param context The context to associate with this operation. @@ -7840,30 +9304,12 @@ public SyncPoller, WorkloadNetworkVMGrou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup( - String resourceGroupName, String privateCloudName, String vmGroupId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) { - return this - .beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) - .getSyncPoller(); - } - - /** - * Create a WorkloadNetworkVMGroup. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param vmGroupId ID of the VM group. - * @param workloadNetworkVMGroup Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX VM Group on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createVMGroupAsync(String resourceGroupName, String privateCloudName, - String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { - return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).last() - .flatMap(this.client::getLroFinalResultOrError); + Response response = createVMGroupWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, vmGroupId, workloadNetworkVMGroup, context); + return this.client.getLroResult(response, + WorkloadNetworkVMGroupInner.class, WorkloadNetworkVMGroupInner.class, context); } /** @@ -7871,9 +9317,9 @@ private Mono createVMGroupAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -7881,10 +9327,9 @@ private Mono createVMGroupAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createVMGroupAsync(String resourceGroupName, String privateCloudName, - String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) { - return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + workloadNetworkVMGroup).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -7892,6 +9337,7 @@ private Mono createVMGroupAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7901,8 +9347,9 @@ private Mono createVMGroupAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, String privateCloudName, - String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { - return createVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).block(); + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginCreateVMGroup(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + workloadNetworkVMGroup).getFinalResult(); } /** @@ -7910,6 +9357,7 @@ public WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup Resource create parameters. * @param context The context to associate with this operation. @@ -7920,9 +9368,10 @@ public WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, String privateCloudName, - String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) { - return createVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) - .block(); + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return beginCreateVMGroup(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + workloadNetworkVMGroup, context).getFinalResult(); } /** @@ -7930,6 +9379,7 @@ public WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7939,7 +9389,8 @@ public WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateVMGroupWithResponseAsync(String resourceGroupName, - String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + String privateCloudName, String workloadNetworkName, String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -7956,6 +9407,10 @@ private Mono>> updateVMGroupWithResponseAsync(String r return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } + if (workloadNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } if (vmGroupId == null) { return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); } @@ -7965,11 +9420,12 @@ private Mono>> updateVMGroupWithResponseAsync(String r } else { workloadNetworkVMGroup.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.updateVMGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, - accept, context)) + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + contentType, accept, workloadNetworkVMGroup, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -7978,48 +9434,54 @@ private Mono>> updateVMGroupWithResponseAsync(String r * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX VM Group along with {@link Response} on successful completion of {@link Mono}. + * @return nSX VM Group along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateVMGroupWithResponseAsync(String resourceGroupName, - String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, - Context context) { + private Response updateVMGroupWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); } if (vmGroupId == null) { - return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); } if (workloadNetworkVMGroup == null) { - return Mono.error( - new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); } else { workloadNetworkVMGroup.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateVMGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, - accept, context); + return service.updateVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + contentType, accept, workloadNetworkVMGroup, Context.NONE); } /** @@ -8027,22 +9489,56 @@ private Mono>> updateVMGroupWithResponseAsync(String r * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSX VM Group. + * @return nSX VM Group along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkloadNetworkVMGroupInner> beginUpdateVMGroupAsync( - String resourceGroupName, String privateCloudName, String vmGroupId, - WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { - Mono>> mono - = updateVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WorkloadNetworkVMGroupInner.class, WorkloadNetworkVMGroupInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateVMGroupWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (workloadNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkName is required and cannot be null.")); + } + if (vmGroupId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + contentType, accept, workloadNetworkVMGroup, context); } /** @@ -8050,9 +9546,9 @@ private PollerFlux, WorkloadNetworkVMGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -8060,14 +9556,13 @@ private PollerFlux, WorkloadNetworkVMGro */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkloadNetworkVMGroupInner> beginUpdateVMGroupAsync( - String resourceGroupName, String privateCloudName, String vmGroupId, - WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String privateCloudName, String workloadNetworkName, String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { Mono>> mono = updateVMGroupWithResponseAsync(resourceGroupName, privateCloudName, - vmGroupId, workloadNetworkVMGroup, context); + workloadNetworkName, vmGroupId, workloadNetworkVMGroup); return this.client.getLroResult(mono, this.client.getHttpPipeline(), WorkloadNetworkVMGroupInner.class, WorkloadNetworkVMGroupInner.class, - context); + this.client.getContext()); } /** @@ -8075,6 +9570,7 @@ private PollerFlux, WorkloadNetworkVMGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -8084,10 +9580,12 @@ private PollerFlux, WorkloadNetworkVMGro */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup( - String resourceGroupName, String privateCloudName, String vmGroupId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { - return this.beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup) - .getSyncPoller(); + Response response = updateVMGroupWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, vmGroupId, workloadNetworkVMGroup); + return this.client.getLroResult(response, + WorkloadNetworkVMGroupInner.class, WorkloadNetworkVMGroupInner.class, Context.NONE); } /** @@ -8095,6 +9593,7 @@ public SyncPoller, WorkloadNetworkVMGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. * @param context The context to associate with this operation. @@ -8105,30 +9604,12 @@ public SyncPoller, WorkloadNetworkVMGrou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup( - String resourceGroupName, String privateCloudName, String vmGroupId, + String resourceGroupName, String privateCloudName, String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) { - return this - .beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) - .getSyncPoller(); - } - - /** - * Update a WorkloadNetworkVMGroup. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. - * @param vmGroupId ID of the VM group. - * @param workloadNetworkVMGroup The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSX VM Group on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateVMGroupAsync(String resourceGroupName, String privateCloudName, - String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { - return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).last() - .flatMap(this.client::getLroFinalResultOrError); + Response response = updateVMGroupWithResponse(resourceGroupName, privateCloudName, + workloadNetworkName, vmGroupId, workloadNetworkVMGroup, context); + return this.client.getLroResult(response, + WorkloadNetworkVMGroupInner.class, WorkloadNetworkVMGroupInner.class, context); } /** @@ -8136,9 +9617,9 @@ private Mono updateVMGroupAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -8146,10 +9627,9 @@ private Mono updateVMGroupAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateVMGroupAsync(String resourceGroupName, String privateCloudName, - String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) { - return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + workloadNetworkVMGroup).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -8157,6 +9637,7 @@ private Mono updateVMGroupAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -8166,8 +9647,9 @@ private Mono updateVMGroupAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, String privateCloudName, - String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { - return updateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).block(); + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginUpdateVMGroup(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + workloadNetworkVMGroup).getFinalResult(); } /** @@ -8175,6 +9657,7 @@ public WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param workloadNetworkVMGroup The resource properties to be updated. * @param context The context to associate with this operation. @@ -8185,9 +9668,10 @@ public WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, String privateCloudName, - String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) { - return updateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) - .block(); + String workloadNetworkName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return beginUpdateVMGroup(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + workloadNetworkVMGroup, context).getFinalResult(); } /** @@ -8230,6 +9714,47 @@ private Mono>> deleteVMGroupWithResponseAsync(String r .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Delete a WorkloadNetworkVMGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId ID of the VM group. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteVMGroupWithResponse(String resourceGroupName, String vmGroupId, + String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmGroupId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vmGroupId, privateCloudName, accept, Context.NONE); + } + /** * Delete a WorkloadNetworkVMGroup. * @@ -8240,33 +9765,35 @@ private Mono>> deleteVMGroupWithResponseAsync(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteVMGroupWithResponseAsync(String resourceGroupName, String vmGroupId, + private Response deleteVMGroupWithResponse(String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (vmGroupId == null) { - return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); } if (privateCloudName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteVMGroup(this.client.getEndpoint(), this.client.getApiVersion(), + return service.deleteVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, vmGroupId, privateCloudName, accept, context); } @@ -8290,28 +9817,6 @@ private PollerFlux, Void> beginDeleteVMGroupAsync(String resour this.client.getContext()); } - /** - * Delete a WorkloadNetworkVMGroup. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmGroupId ID of the VM group. - * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is 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> beginDeleteVMGroupAsync(String resourceGroupName, String vmGroupId, - String privateCloudName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteVMGroupWithResponseAsync(resourceGroupName, vmGroupId, privateCloudName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - /** * Delete a WorkloadNetworkVMGroup. * @@ -8326,7 +9831,8 @@ private PollerFlux, Void> beginDeleteVMGroupAsync(String resour @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName) { - return this.beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).getSyncPoller(); + Response response = deleteVMGroupWithResponse(resourceGroupName, vmGroupId, privateCloudName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -8344,7 +9850,9 @@ public SyncPoller, Void> beginDeleteVMGroup(String resourceGrou @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { - return this.beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName, context).getSyncPoller(); + Response response + = deleteVMGroupWithResponse(resourceGroupName, vmGroupId, privateCloudName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -8364,25 +9872,6 @@ private Mono deleteVMGroupAsync(String resourceGroupName, String vmGroupId .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a WorkloadNetworkVMGroup. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmGroupId ID of the VM group. - * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deleteVMGroupAsync(String resourceGroupName, String vmGroupId, String privateCloudName, - Context context) { - return beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a WorkloadNetworkVMGroup. * @@ -8395,7 +9884,7 @@ private Mono deleteVMGroupAsync(String resourceGroupName, String vmGroupId */ @ServiceMethod(returns = ReturnType.SINGLE) public void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName) { - deleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).block(); + beginDeleteVMGroup(resourceGroupName, vmGroupId, privateCloudName).getFinalResult(); } /** @@ -8411,7 +9900,7 @@ public void deleteVMGroup(String resourceGroupName, String vmGroupId, String pri */ @ServiceMethod(returns = ReturnType.SINGLE) public void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { - deleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName, context).block(); + beginDeleteVMGroup(resourceGroupName, vmGroupId, privateCloudName, context).getFinalResult(); } /** @@ -8440,6 +9929,33 @@ private Mono> listNextSinglePageAsync(String .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkloadNetwork list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -8448,23 +9964,23 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetwork list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetwork list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -8494,6 +10010,33 @@ private Mono> listDhcpNextSinglePageAsyn .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkloadNetworkDhcp list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDhcpNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listDhcpNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -8502,24 +10045,24 @@ private Mono> listDhcpNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkDhcp list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkDhcp list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDhcpNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listDhcpNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listDhcpNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listDhcpNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -8533,7 +10076,7 @@ private Mono> listDhcpNextSinglePageAsyn * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDnsServicesNextSinglePageAsync(String nextLink) { + private Mono> listDnsServiceNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -8543,12 +10086,39 @@ private Mono> listDnsServicesNextS } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDnsServicesNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext(context -> service.listDnsServiceNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkloadNetworkDnsService list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDnsServiceNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listDnsServiceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -8557,24 +10127,25 @@ private Mono> listDnsServicesNextS * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkDnsService list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkDnsService list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDnsServicesNextSinglePageAsync(String nextLink, + private PagedResponse listDnsServiceNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listDnsServicesNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listDnsServiceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -8604,6 +10175,33 @@ private Mono> listDnsZonesNextSingleP .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkloadNetworkDnsZone list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDnsZonesNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listDnsZonesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -8612,24 +10210,24 @@ private Mono> listDnsZonesNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkDnsZone list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkDnsZone list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDnsZonesNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listDnsZonesNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listDnsZonesNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listDnsZonesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -8659,6 +10257,33 @@ private Mono> listGatewaysNextSingleP .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkloadNetworkGateway list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listGatewaysNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listGatewaysNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -8667,24 +10292,24 @@ private Mono> listGatewaysNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkGateway list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkGateway list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listGatewaysNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listGatewaysNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listGatewaysNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listGatewaysNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -8715,6 +10340,33 @@ private Mono> listGatewaysNextSingleP .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkloadNetworkPortMirroring list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPortMirroringNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listPortMirroringNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -8723,24 +10375,25 @@ private Mono> listGatewaysNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkPortMirroring list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return the response of a WorkloadNetworkPortMirroring list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPortMirroringNextSinglePageAsync(String nextLink, + private PagedResponse listPortMirroringNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listPortMirroringNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listPortMirroringNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -8770,6 +10423,33 @@ private Mono> listPublicIPsNextSingl .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkloadNetworkPublicIP list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPublicIPsNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listPublicIPsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -8778,24 +10458,24 @@ private Mono> listPublicIPsNextSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkPublicIP list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkPublicIP list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPublicIPsNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listPublicIPsNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listPublicIPsNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listPublicIPsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -8825,6 +10505,33 @@ private Mono> listSegmentsNextSingleP .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkloadNetworkSegment list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSegmentsNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSegmentsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -8833,24 +10540,24 @@ private Mono> listSegmentsNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkSegment list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkSegment list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSegmentsNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listSegmentsNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listSegmentsNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listSegmentsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -8882,6 +10589,33 @@ private Mono> listSegmentsNextSingleP .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkloadNetworkVirtualMachine list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVirtualMachinesNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listVirtualMachinesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -8890,24 +10624,25 @@ private Mono> listSegmentsNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkVirtualMachine list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return the response of a WorkloadNetworkVirtualMachine list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listVirtualMachinesNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listVirtualMachinesNextSinglePage(String nextLink, + Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listVirtualMachinesNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listVirtualMachinesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -8937,6 +10672,33 @@ private Mono> listVMGroupsNextSingleP .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkloadNetworkVMGroup list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVMGroupsNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listVMGroupsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -8945,23 +10707,25 @@ private Mono> listVMGroupsNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a WorkloadNetworkVMGroup list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a WorkloadNetworkVMGroup list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVMGroupsNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listVMGroupsNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listVMGroupsNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listVMGroupsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworksClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksImpl.java index 1a23eb382cd5..5bf8f747aa66 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.implementation; @@ -18,8 +18,8 @@ import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; import com.azure.resourcemanager.avs.models.WorkloadNetwork; import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcp; import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsService; @@ -27,10 +27,10 @@ import com.azure.resourcemanager.avs.models.WorkloadNetworkGateway; import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroring; import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIp; -import com.azure.resourcemanager.avs.models.WorkloadNetworks; import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; -import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachine; import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroup; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachine; +import com.azure.resourcemanager.avs.models.WorkloadNetworks; public final class WorkloadNetworksImpl implements WorkloadNetworks { private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworksImpl.class); @@ -57,9 +57,9 @@ public PagedIterable list(String resourceGroupName, String priv } public Response getWithResponse(String resourceGroupName, String privateCloudName, - Context context) { + String workloadNetworkName, Context context) { Response inner - = this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, context); + = this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkloadNetworkImpl(inner.getValue(), this.manager())); @@ -68,8 +68,8 @@ public Response getWithResponse(String resourceGroupName, Strin } } - public WorkloadNetwork get(String resourceGroupName, String privateCloudName) { - WorkloadNetworkInner inner = this.serviceClient().get(resourceGroupName, privateCloudName); + public WorkloadNetwork get(String resourceGroupName, String privateCloudName, String workloadNetworkName) { + WorkloadNetworkInner inner = this.serviceClient().get(resourceGroupName, privateCloudName, workloadNetworkName); if (inner != null) { return new WorkloadNetworkImpl(inner, this.manager()); } else { @@ -77,16 +77,17 @@ public WorkloadNetwork get(String resourceGroupName, String privateCloudName) { } } - public PagedIterable listDhcp(String resourceGroupName, String privateCloudName) { + public PagedIterable listDhcp(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { PagedIterable inner - = this.serviceClient().listDhcp(resourceGroupName, privateCloudName); + = this.serviceClient().listDhcp(resourceGroupName, privateCloudName, workloadNetworkName); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkDhcpImpl(inner1, this.manager())); } public PagedIterable listDhcp(String resourceGroupName, String privateCloudName, - Context context) { + String workloadNetworkName, Context context) { PagedIterable inner - = this.serviceClient().listDhcp(resourceGroupName, privateCloudName, context); + = this.serviceClient().listDhcp(resourceGroupName, privateCloudName, workloadNetworkName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkDhcpImpl(inner1, this.manager())); } @@ -111,31 +112,34 @@ public WorkloadNetworkDhcp getDhcp(String resourceGroupName, String dhcpId, Stri } } - public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId) { - this.serviceClient().deleteDhcp(resourceGroupName, privateCloudName, dhcpId); + public void deleteDhcp(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String dhcpId) { + this.serviceClient().deleteDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId); } - public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context) { - this.serviceClient().deleteDhcp(resourceGroupName, privateCloudName, dhcpId, context); + public void deleteDhcp(String resourceGroupName, String privateCloudName, String workloadNetworkName, String dhcpId, + Context context) { + this.serviceClient().deleteDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, context); } - public PagedIterable listDnsServices(String resourceGroupName, String privateCloudName) { + public PagedIterable listDnsService(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { PagedIterable inner - = this.serviceClient().listDnsServices(resourceGroupName, privateCloudName); + = this.serviceClient().listDnsService(resourceGroupName, privateCloudName, workloadNetworkName); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkDnsServiceImpl(inner1, this.manager())); } - public PagedIterable listDnsServices(String resourceGroupName, String privateCloudName, - Context context) { + public PagedIterable listDnsService(String resourceGroupName, String privateCloudName, + String workloadNetworkName, Context context) { PagedIterable inner - = this.serviceClient().listDnsServices(resourceGroupName, privateCloudName, context); + = this.serviceClient().listDnsService(resourceGroupName, privateCloudName, workloadNetworkName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkDnsServiceImpl(inner1, this.manager())); } public Response getDnsServiceWithResponse(String resourceGroupName, - String privateCloudName, String dnsServiceId, Context context) { + String privateCloudName, String workloadNetworkName, String dnsServiceId, Context context) { Response inner = this.serviceClient() - .getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, context); + .getDnsServiceWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkloadNetworkDnsServiceImpl(inner.getValue(), this.manager())); @@ -145,9 +149,9 @@ public Response getDnsServiceWithResponse(String reso } public WorkloadNetworkDnsService getDnsService(String resourceGroupName, String privateCloudName, - String dnsServiceId) { - WorkloadNetworkDnsServiceInner inner - = this.serviceClient().getDnsService(resourceGroupName, privateCloudName, dnsServiceId); + String workloadNetworkName, String dnsServiceId) { + WorkloadNetworkDnsServiceInner inner = this.serviceClient() + .getDnsService(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId); if (inner != null) { return new WorkloadNetworkDnsServiceImpl(inner, this.manager()); } else { @@ -164,23 +168,24 @@ public void deleteDnsService(String resourceGroupName, String dnsServiceId, Stri this.serviceClient().deleteDnsService(resourceGroupName, dnsServiceId, privateCloudName, context); } - public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName) { + public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { PagedIterable inner - = this.serviceClient().listDnsZones(resourceGroupName, privateCloudName); + = this.serviceClient().listDnsZones(resourceGroupName, privateCloudName, workloadNetworkName); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkDnsZoneImpl(inner1, this.manager())); } public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName, - Context context) { + String workloadNetworkName, Context context) { PagedIterable inner - = this.serviceClient().listDnsZones(resourceGroupName, privateCloudName, context); + = this.serviceClient().listDnsZones(resourceGroupName, privateCloudName, workloadNetworkName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkDnsZoneImpl(inner1, this.manager())); } public Response getDnsZoneWithResponse(String resourceGroupName, String privateCloudName, - String dnsZoneId, Context context) { - Response inner - = this.serviceClient().getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, context); + String workloadNetworkName, String dnsZoneId, Context context) { + Response inner = this.serviceClient() + .getDnsZoneWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkloadNetworkDnsZoneImpl(inner.getValue(), this.manager())); @@ -189,9 +194,10 @@ public Response getDnsZoneWithResponse(String resourceGr } } - public WorkloadNetworkDnsZone getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId) { + public WorkloadNetworkDnsZone getDnsZone(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsZoneId) { WorkloadNetworkDnsZoneInner inner - = this.serviceClient().getDnsZone(resourceGroupName, privateCloudName, dnsZoneId); + = this.serviceClient().getDnsZone(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId); if (inner != null) { return new WorkloadNetworkDnsZoneImpl(inner, this.manager()); } else { @@ -207,23 +213,24 @@ public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String pri this.serviceClient().deleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName, context); } - public PagedIterable listGateways(String resourceGroupName, String privateCloudName) { + public PagedIterable listGateways(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { PagedIterable inner - = this.serviceClient().listGateways(resourceGroupName, privateCloudName); + = this.serviceClient().listGateways(resourceGroupName, privateCloudName, workloadNetworkName); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkGatewayImpl(inner1, this.manager())); } public PagedIterable listGateways(String resourceGroupName, String privateCloudName, - Context context) { + String workloadNetworkName, Context context) { PagedIterable inner - = this.serviceClient().listGateways(resourceGroupName, privateCloudName, context); + = this.serviceClient().listGateways(resourceGroupName, privateCloudName, workloadNetworkName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkGatewayImpl(inner1, this.manager())); } public Response getGatewayWithResponse(String resourceGroupName, String privateCloudName, - String gatewayId, Context context) { - Response inner - = this.serviceClient().getGatewayWithResponse(resourceGroupName, privateCloudName, gatewayId, context); + String workloadNetworkName, String gatewayId, Context context) { + Response inner = this.serviceClient() + .getGatewayWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, gatewayId, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkloadNetworkGatewayImpl(inner.getValue(), this.manager())); @@ -232,9 +239,10 @@ public Response getGatewayWithResponse(String resourceGr } } - public WorkloadNetworkGateway getGateway(String resourceGroupName, String privateCloudName, String gatewayId) { + public WorkloadNetworkGateway getGateway(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String gatewayId) { WorkloadNetworkGatewayInner inner - = this.serviceClient().getGateway(resourceGroupName, privateCloudName, gatewayId); + = this.serviceClient().getGateway(resourceGroupName, privateCloudName, workloadNetworkName, gatewayId); if (inner != null) { return new WorkloadNetworkGatewayImpl(inner, this.manager()); } else { @@ -243,25 +251,26 @@ public WorkloadNetworkGateway getGateway(String resourceGroupName, String privat } public PagedIterable listPortMirroring(String resourceGroupName, - String privateCloudName) { + String privateCloudName, String workloadNetworkName) { PagedIterable inner - = this.serviceClient().listPortMirroring(resourceGroupName, privateCloudName); + = this.serviceClient().listPortMirroring(resourceGroupName, privateCloudName, workloadNetworkName); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkPortMirroringImpl(inner1, this.manager())); } public PagedIterable listPortMirroring(String resourceGroupName, - String privateCloudName, Context context) { + String privateCloudName, String workloadNetworkName, Context context) { PagedIterable inner - = this.serviceClient().listPortMirroring(resourceGroupName, privateCloudName, context); + = this.serviceClient().listPortMirroring(resourceGroupName, privateCloudName, workloadNetworkName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkPortMirroringImpl(inner1, this.manager())); } public Response getPortMirroringWithResponse(String resourceGroupName, - String privateCloudName, String portMirroringId, Context context) { + String privateCloudName, String workloadNetworkName, String portMirroringId, Context context) { Response inner = this.serviceClient() - .getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, context); + .getPortMirroringWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkloadNetworkPortMirroringImpl(inner.getValue(), this.manager())); @@ -271,9 +280,9 @@ public Response getPortMirroringWithResponse(Strin } public WorkloadNetworkPortMirroring getPortMirroring(String resourceGroupName, String privateCloudName, - String portMirroringId) { - WorkloadNetworkPortMirroringInner inner - = this.serviceClient().getPortMirroring(resourceGroupName, privateCloudName, portMirroringId); + String workloadNetworkName, String portMirroringId) { + WorkloadNetworkPortMirroringInner inner = this.serviceClient() + .getPortMirroring(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId); if (inner != null) { return new WorkloadNetworkPortMirroringImpl(inner, this.manager()); } else { @@ -290,23 +299,24 @@ public void deletePortMirroring(String resourceGroupName, String portMirroringId this.serviceClient().deletePortMirroring(resourceGroupName, portMirroringId, privateCloudName, context); } - public PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName) { + public PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { PagedIterable inner - = this.serviceClient().listPublicIPs(resourceGroupName, privateCloudName); + = this.serviceClient().listPublicIPs(resourceGroupName, privateCloudName, workloadNetworkName); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkPublicIpImpl(inner1, this.manager())); } public PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName, - Context context) { + String workloadNetworkName, Context context) { PagedIterable inner - = this.serviceClient().listPublicIPs(resourceGroupName, privateCloudName, context); + = this.serviceClient().listPublicIPs(resourceGroupName, privateCloudName, workloadNetworkName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkPublicIpImpl(inner1, this.manager())); } - public Response getPublicIpWithResponse(String resourceGroupName, String privateCloudName, - String publicIpId, Context context) { - Response inner - = this.serviceClient().getPublicIpWithResponse(resourceGroupName, privateCloudName, publicIpId, context); + public Response getPublicIPWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId, Context context) { + Response inner = this.serviceClient() + .getPublicIPWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkloadNetworkPublicIpImpl(inner.getValue(), this.manager())); @@ -315,9 +325,10 @@ public Response getPublicIpWithResponse(String resource } } - public WorkloadNetworkPublicIp getPublicIp(String resourceGroupName, String privateCloudName, String publicIpId) { + public WorkloadNetworkPublicIp getPublicIP(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId) { WorkloadNetworkPublicIpInner inner - = this.serviceClient().getPublicIp(resourceGroupName, privateCloudName, publicIpId); + = this.serviceClient().getPublicIP(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId); if (inner != null) { return new WorkloadNetworkPublicIpImpl(inner, this.manager()); } else { @@ -325,31 +336,32 @@ public WorkloadNetworkPublicIp getPublicIp(String resourceGroupName, String priv } } - public void deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName) { - this.serviceClient().deletePublicIp(resourceGroupName, publicIpId, privateCloudName); + public void deletePublicIP(String resourceGroupName, String publicIPId, String privateCloudName) { + this.serviceClient().deletePublicIP(resourceGroupName, publicIPId, privateCloudName); } - public void deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName, Context context) { - this.serviceClient().deletePublicIp(resourceGroupName, publicIpId, privateCloudName, context); + public void deletePublicIP(String resourceGroupName, String publicIPId, String privateCloudName, Context context) { + this.serviceClient().deletePublicIP(resourceGroupName, publicIPId, privateCloudName, context); } - public PagedIterable listSegments(String resourceGroupName, String privateCloudName) { + public PagedIterable listSegments(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { PagedIterable inner - = this.serviceClient().listSegments(resourceGroupName, privateCloudName); + = this.serviceClient().listSegments(resourceGroupName, privateCloudName, workloadNetworkName); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkSegmentImpl(inner1, this.manager())); } public PagedIterable listSegments(String resourceGroupName, String privateCloudName, - Context context) { + String workloadNetworkName, Context context) { PagedIterable inner - = this.serviceClient().listSegments(resourceGroupName, privateCloudName, context); + = this.serviceClient().listSegments(resourceGroupName, privateCloudName, workloadNetworkName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkSegmentImpl(inner1, this.manager())); } public Response getSegmentWithResponse(String resourceGroupName, String privateCloudName, - String segmentId, Context context) { - Response inner - = this.serviceClient().getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, context); + String workloadNetworkName, String segmentId, Context context) { + Response inner = this.serviceClient() + .getSegmentWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkloadNetworkSegmentImpl(inner.getValue(), this.manager())); @@ -358,9 +370,10 @@ public Response getSegmentWithResponse(String resourceGr } } - public WorkloadNetworkSegment getSegment(String resourceGroupName, String privateCloudName, String segmentId) { + public WorkloadNetworkSegment getSegment(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String segmentId) { WorkloadNetworkSegmentInner inner - = this.serviceClient().getSegment(resourceGroupName, privateCloudName, segmentId); + = this.serviceClient().getSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId); if (inner != null) { return new WorkloadNetworkSegmentImpl(inner, this.manager()); } else { @@ -368,34 +381,38 @@ public WorkloadNetworkSegment getSegment(String resourceGroupName, String privat } } - public void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId) { - this.serviceClient().deleteSegment(resourceGroupName, privateCloudName, segmentId); + public void deleteSegment(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String segmentId) { + this.serviceClient().deleteSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId); } - public void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context) { - this.serviceClient().deleteSegment(resourceGroupName, privateCloudName, segmentId, context); + public void deleteSegment(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String segmentId, Context context) { + this.serviceClient() + .deleteSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, context); } public PagedIterable listVirtualMachines(String resourceGroupName, - String privateCloudName) { + String privateCloudName, String workloadNetworkName) { PagedIterable inner - = this.serviceClient().listVirtualMachines(resourceGroupName, privateCloudName); + = this.serviceClient().listVirtualMachines(resourceGroupName, privateCloudName, workloadNetworkName); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkVirtualMachineImpl(inner1, this.manager())); } public PagedIterable listVirtualMachines(String resourceGroupName, - String privateCloudName, Context context) { - PagedIterable inner - = this.serviceClient().listVirtualMachines(resourceGroupName, privateCloudName, context); + String privateCloudName, String workloadNetworkName, Context context) { + PagedIterable inner = this.serviceClient() + .listVirtualMachines(resourceGroupName, privateCloudName, workloadNetworkName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkVirtualMachineImpl(inner1, this.manager())); } public Response getVirtualMachineWithResponse(String resourceGroupName, - String privateCloudName, String virtualMachineId, Context context) { + String privateCloudName, String workloadNetworkName, String virtualMachineId, Context context) { Response inner = this.serviceClient() - .getVirtualMachineWithResponse(resourceGroupName, privateCloudName, virtualMachineId, context); + .getVirtualMachineWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, virtualMachineId, + context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkloadNetworkVirtualMachineImpl(inner.getValue(), this.manager())); @@ -405,9 +422,9 @@ public Response getVirtualMachineWithResponse(Str } public WorkloadNetworkVirtualMachine getVirtualMachine(String resourceGroupName, String privateCloudName, - String virtualMachineId) { - WorkloadNetworkVirtualMachineInner inner - = this.serviceClient().getVirtualMachine(resourceGroupName, privateCloudName, virtualMachineId); + String workloadNetworkName, String virtualMachineId) { + WorkloadNetworkVirtualMachineInner inner = this.serviceClient() + .getVirtualMachine(resourceGroupName, privateCloudName, workloadNetworkName, virtualMachineId); if (inner != null) { return new WorkloadNetworkVirtualMachineImpl(inner, this.manager()); } else { @@ -415,23 +432,24 @@ public WorkloadNetworkVirtualMachine getVirtualMachine(String resourceGroupName, } } - public PagedIterable listVMGroups(String resourceGroupName, String privateCloudName) { + public PagedIterable listVMGroups(String resourceGroupName, String privateCloudName, + String workloadNetworkName) { PagedIterable inner - = this.serviceClient().listVMGroups(resourceGroupName, privateCloudName); + = this.serviceClient().listVMGroups(resourceGroupName, privateCloudName, workloadNetworkName); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkVMGroupImpl(inner1, this.manager())); } public PagedIterable listVMGroups(String resourceGroupName, String privateCloudName, - Context context) { + String workloadNetworkName, Context context) { PagedIterable inner - = this.serviceClient().listVMGroups(resourceGroupName, privateCloudName, context); + = this.serviceClient().listVMGroups(resourceGroupName, privateCloudName, workloadNetworkName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadNetworkVMGroupImpl(inner1, this.manager())); } public Response getVMGroupWithResponse(String resourceGroupName, String privateCloudName, - String vmGroupId, Context context) { - Response inner - = this.serviceClient().getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, context); + String workloadNetworkName, String vmGroupId, Context context) { + Response inner = this.serviceClient() + .getVMGroupWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkloadNetworkVMGroupImpl(inner.getValue(), this.manager())); @@ -440,9 +458,10 @@ public Response getVMGroupWithResponse(String resourceGr } } - public WorkloadNetworkVMGroup getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId) { + public WorkloadNetworkVMGroup getVMGroup(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String vmGroupId) { WorkloadNetworkVMGroupInner inner - = this.serviceClient().getVMGroup(resourceGroupName, privateCloudName, vmGroupId); + = this.serviceClient().getVMGroup(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId); if (inner != null) { return new WorkloadNetworkVMGroupImpl(inner, this.manager()); } else { @@ -458,61 +477,30 @@ public void deleteVMGroup(String resourceGroupName, String vmGroupId, String pri this.serviceClient().deleteVMGroup(resourceGroupName, vmGroupId, privateCloudName, context); } - public WorkloadNetworkDhcp getDhcpById(String id) { - String resourceGroupName = ResourceManagerUtils.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 dhcpId = ResourceManagerUtils.getValueFromIdByName(id, "dhcpConfigurations"); - if (dhcpId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); - } - String privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); - if (privateCloudName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); - } - return this.getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, Context.NONE).getValue(); - } - - public Response getDhcpByIdWithResponse(String id, Context context) { + public WorkloadNetworkDnsService getDnsServiceById(String id) { String resourceGroupName = ResourceManagerUtils.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 dhcpId = ResourceManagerUtils.getValueFromIdByName(id, "dhcpConfigurations"); - if (dhcpId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); - } String privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); if (privateCloudName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } - return this.getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, context); - } - - public WorkloadNetworkDnsService getDnsServiceById(String id) { - String resourceGroupName = ResourceManagerUtils.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 privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); - if (privateCloudName == null) { + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); } String dnsServiceId = ResourceManagerUtils.getValueFromIdByName(id, "dnsServices"); if (dnsServiceId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'dnsServices'.", id))); } - return this.getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, Context.NONE) + return this + .getDnsServiceWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + Context.NONE) .getValue(); } @@ -527,12 +515,18 @@ public Response getDnsServiceByIdWithResponse(String throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); + } String dnsServiceId = ResourceManagerUtils.getValueFromIdByName(id, "dnsServices"); if (dnsServiceId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'dnsServices'.", id))); } - return this.getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, context); + return this.getDnsServiceWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dnsServiceId, + context); } public WorkloadNetworkDnsZone getDnsZoneById(String id) { @@ -546,12 +540,19 @@ public WorkloadNetworkDnsZone getDnsZoneById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); + } String dnsZoneId = ResourceManagerUtils.getValueFromIdByName(id, "dnsZones"); if (dnsZoneId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); } - return this.getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, Context.NONE).getValue(); + return this + .getDnsZoneWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, Context.NONE) + .getValue(); } public Response getDnsZoneByIdWithResponse(String id, Context context) { @@ -565,12 +566,18 @@ public Response getDnsZoneByIdWithResponse(String id, Co throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); + } String dnsZoneId = ResourceManagerUtils.getValueFromIdByName(id, "dnsZones"); if (dnsZoneId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); } - return this.getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, context); + return this.getDnsZoneWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, dnsZoneId, + context); } public WorkloadNetworkPortMirroring getPortMirroringById(String id) { @@ -584,12 +591,19 @@ public WorkloadNetworkPortMirroring getPortMirroringById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); + } String portMirroringId = ResourceManagerUtils.getValueFromIdByName(id, "portMirroringProfiles"); if (portMirroringId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'portMirroringProfiles'.", id))); } - return this.getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, Context.NONE) + return this + .getPortMirroringWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, portMirroringId, + Context.NONE) .getValue(); } @@ -604,15 +618,21 @@ public Response getPortMirroringByIdWithResponse(S throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); + } String portMirroringId = ResourceManagerUtils.getValueFromIdByName(id, "portMirroringProfiles"); if (portMirroringId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'portMirroringProfiles'.", id))); } - return this.getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, context); + return this.getPortMirroringWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, + portMirroringId, context); } - public WorkloadNetworkPublicIp getPublicIpById(String id) { + public WorkloadNetworkPublicIp getPublicIPById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -623,15 +643,22 @@ public WorkloadNetworkPublicIp getPublicIpById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } - String publicIpId = ResourceManagerUtils.getValueFromIdByName(id, "publicIPs"); - if (publicIpId == null) { + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); + } + String publicIPId = ResourceManagerUtils.getValueFromIdByName(id, "publicIPs"); + if (publicIPId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'publicIPs'.", id))); } - return this.getPublicIpWithResponse(resourceGroupName, privateCloudName, publicIpId, Context.NONE).getValue(); + return this + .getPublicIPWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, Context.NONE) + .getValue(); } - public Response getPublicIpByIdWithResponse(String id, Context context) { + public Response getPublicIPByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -642,12 +669,18 @@ public Response getPublicIpByIdWithResponse(String id, throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } - String publicIpId = ResourceManagerUtils.getValueFromIdByName(id, "publicIPs"); - if (publicIpId == null) { + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); + } + String publicIPId = ResourceManagerUtils.getValueFromIdByName(id, "publicIPs"); + if (publicIPId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'publicIPs'.", id))); } - return this.getPublicIpWithResponse(resourceGroupName, privateCloudName, publicIpId, context); + return this.getPublicIPWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, publicIPId, + context); } public WorkloadNetworkSegment getSegmentById(String id) { @@ -661,12 +694,19 @@ public WorkloadNetworkSegment getSegmentById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); + } String segmentId = ResourceManagerUtils.getValueFromIdByName(id, "segments"); if (segmentId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'segments'.", id))); } - return this.getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, Context.NONE).getValue(); + return this + .getSegmentWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, Context.NONE) + .getValue(); } public Response getSegmentByIdWithResponse(String id, Context context) { @@ -680,12 +720,18 @@ public Response getSegmentByIdWithResponse(String id, Co throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); + } String segmentId = ResourceManagerUtils.getValueFromIdByName(id, "segments"); if (segmentId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'segments'.", id))); } - return this.getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, context); + return this.getSegmentWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, + context); } public WorkloadNetworkVMGroup getVMGroupById(String id) { @@ -699,12 +745,19 @@ public WorkloadNetworkVMGroup getVMGroupById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); + } String vmGroupId = ResourceManagerUtils.getValueFromIdByName(id, "vmGroups"); if (vmGroupId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'vmGroups'.", id))); } - return this.getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, Context.NONE).getValue(); + return this + .getVMGroupWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, Context.NONE) + .getValue(); } public Response getVMGroupByIdWithResponse(String id, Context context) { @@ -718,12 +771,18 @@ public Response getVMGroupByIdWithResponse(String id, Co throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); + } String vmGroupId = ResourceManagerUtils.getValueFromIdByName(id, "vmGroups"); if (vmGroupId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'vmGroups'.", id))); } - return this.getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, context); + return this.getVMGroupWithResponse(resourceGroupName, privateCloudName, workloadNetworkName, vmGroupId, + context); } public void deleteDhcpById(String id) { @@ -737,202 +796,65 @@ public void deleteDhcpById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } - String dhcpId = ResourceManagerUtils.getValueFromIdByName(id, "dhcpConfigurations"); - if (dhcpId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); - } - this.deleteDhcp(resourceGroupName, privateCloudName, dhcpId, Context.NONE); - } - - public void deleteDhcpByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.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 privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); - if (privateCloudName == null) { + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); } String dhcpId = ResourceManagerUtils.getValueFromIdByName(id, "dhcpConfigurations"); if (dhcpId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); } - this.deleteDhcp(resourceGroupName, privateCloudName, dhcpId, context); - } - - public void deleteDnsServiceById(String id) { - String resourceGroupName = ResourceManagerUtils.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 dnsServiceId = ResourceManagerUtils.getValueFromIdByName(id, "dnsServices"); - if (dnsServiceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'dnsServices'.", id))); - } - String privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); - if (privateCloudName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); - } - this.deleteDnsService(resourceGroupName, dnsServiceId, privateCloudName, Context.NONE); - } - - public void deleteDnsServiceByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.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 dnsServiceId = ResourceManagerUtils.getValueFromIdByName(id, "dnsServices"); - if (dnsServiceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'dnsServices'.", id))); - } - String privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); - if (privateCloudName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); - } - this.deleteDnsService(resourceGroupName, dnsServiceId, privateCloudName, context); + this.deleteDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, Context.NONE); } - public void deleteDnsZoneById(String id) { - String resourceGroupName = ResourceManagerUtils.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 dnsZoneId = ResourceManagerUtils.getValueFromIdByName(id, "dnsZones"); - if (dnsZoneId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); - } - String privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); - if (privateCloudName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); - } - this.deleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName, Context.NONE); - } - - public void deleteDnsZoneByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.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 dnsZoneId = ResourceManagerUtils.getValueFromIdByName(id, "dnsZones"); - if (dnsZoneId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); - } - String privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); - if (privateCloudName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); - } - this.deleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName, context); - } - - public void deletePortMirroringById(String id) { + public void deleteDhcpByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.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 portMirroringId = ResourceManagerUtils.getValueFromIdByName(id, "portMirroringProfiles"); - if (portMirroringId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'portMirroringProfiles'.", id))); - } String privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); if (privateCloudName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } - this.deletePortMirroring(resourceGroupName, portMirroringId, privateCloudName, Context.NONE); - } - - public void deletePortMirroringByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.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 portMirroringId = ResourceManagerUtils.getValueFromIdByName(id, "portMirroringProfiles"); - if (portMirroringId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'portMirroringProfiles'.", id))); - } - String privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); - if (privateCloudName == null) { + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); } - this.deletePortMirroring(resourceGroupName, portMirroringId, privateCloudName, context); - } - - public void deletePublicIpById(String id) { - String resourceGroupName = ResourceManagerUtils.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 publicIpId = ResourceManagerUtils.getValueFromIdByName(id, "publicIPs"); - if (publicIpId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'publicIPs'.", id))); - } - String privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); - if (privateCloudName == null) { + String dhcpId = ResourceManagerUtils.getValueFromIdByName(id, "dhcpConfigurations"); + if (dhcpId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); } - this.deletePublicIp(resourceGroupName, publicIpId, privateCloudName, Context.NONE); + this.deleteDhcp(resourceGroupName, privateCloudName, workloadNetworkName, dhcpId, context); } - public void deletePublicIpByIdWithResponse(String id, Context context) { + public void deleteSegmentById(String id) { String resourceGroupName = ResourceManagerUtils.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 publicIpId = ResourceManagerUtils.getValueFromIdByName(id, "publicIPs"); - if (publicIpId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'publicIPs'.", id))); - } String privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); if (privateCloudName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } - this.deletePublicIp(resourceGroupName, publicIpId, privateCloudName, context); - } - - public void deleteSegmentById(String id) { - String resourceGroupName = ResourceManagerUtils.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 privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); - if (privateCloudName == null) { + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); } String segmentId = ResourceManagerUtils.getValueFromIdByName(id, "segments"); if (segmentId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'segments'.", id))); } - this.deleteSegment(resourceGroupName, privateCloudName, segmentId, Context.NONE); + this.deleteSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, Context.NONE); } public void deleteSegmentByIdWithResponse(String id, Context context) { @@ -946,50 +868,17 @@ public void deleteSegmentByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); } + String workloadNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "workloadNetworks"); + if (workloadNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workloadNetworks'.", id))); + } String segmentId = ResourceManagerUtils.getValueFromIdByName(id, "segments"); if (segmentId == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'segments'.", id))); } - this.deleteSegment(resourceGroupName, privateCloudName, segmentId, context); - } - - public void deleteVMGroupById(String id) { - String resourceGroupName = ResourceManagerUtils.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 vmGroupId = ResourceManagerUtils.getValueFromIdByName(id, "vmGroups"); - if (vmGroupId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vmGroups'.", id))); - } - String privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); - if (privateCloudName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); - } - this.deleteVMGroup(resourceGroupName, vmGroupId, privateCloudName, Context.NONE); - } - - public void deleteVMGroupByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.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 vmGroupId = ResourceManagerUtils.getValueFromIdByName(id, "vmGroups"); - if (vmGroupId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vmGroups'.", id))); - } - String privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); - if (privateCloudName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); - } - this.deleteVMGroup(resourceGroupName, vmGroupId, privateCloudName, context); + this.deleteSegment(resourceGroupName, privateCloudName, workloadNetworkName, segmentId, context); } private WorkloadNetworksClient serviceClient() { @@ -1016,11 +905,11 @@ public WorkloadNetworkPortMirroringImpl definePortMirroring(String name) { return new WorkloadNetworkPortMirroringImpl(name, this.manager()); } - public WorkloadNetworkPublicIpImpl definePublicIp(String name) { + public WorkloadNetworkPublicIpImpl definePublicIP(String name) { return new WorkloadNetworkPublicIpImpl(name, this.manager()); } - public WorkloadNetworkSegmentImpl defineSegments(String name) { + public WorkloadNetworkSegmentImpl defineSegment(String name) { return new WorkloadNetworkSegmentImpl(name, this.manager()); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/AddonList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/AddonList.java index 664ccfb68dfa..34ae80e952df 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/AddonList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a Addon list operation. */ -@Fluent +@Immutable public final class AddonList implements JsonSerializable { /* * The Addon items on this page @@ -32,7 +32,7 @@ public final class AddonList implements JsonSerializable { /** * Creates an instance of AddonList class. */ - public AddonList() { + private AddonList() { } /** @@ -44,17 +44,6 @@ public List value() { return this.value; } - /** - * Set the value property: The Addon items on this page. - * - * @param value the value value to set. - * @return the AddonList object itself. - */ - public AddonList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the AddonList object itself. - */ - public AddonList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/CloudLinkList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/CloudLinkList.java index 5758b9565f79..d2bdeceb5fbc 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/CloudLinkList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a CloudLink list operation. */ -@Fluent +@Immutable public final class CloudLinkList implements JsonSerializable { /* * The CloudLink items on this page @@ -32,7 +32,7 @@ public final class CloudLinkList implements JsonSerializable { /** * Creates an instance of CloudLinkList class. */ - public CloudLinkList() { + private CloudLinkList() { } /** @@ -44,17 +44,6 @@ public List value() { return this.value; } - /** - * Set the value property: The CloudLink items on this page. - * - * @param value the value value to set. - * @return the CloudLinkList object itself. - */ - public CloudLinkList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the CloudLinkList object itself. - */ - public CloudLinkList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ClusterList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ClusterList.java index c596ae22f3c5..c58f69412216 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ClusterList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a Cluster list operation. */ -@Fluent +@Immutable public final class ClusterList implements JsonSerializable { /* * The Cluster items on this page @@ -32,7 +32,7 @@ public final class ClusterList implements JsonSerializable { /** * Creates an instance of ClusterList class. */ - public ClusterList() { + private ClusterList() { } /** @@ -44,17 +44,6 @@ public List value() { return this.value; } - /** - * Set the value property: The Cluster items on this page. - * - * @param value the value value to set. - * @return the ClusterList object itself. - */ - public ClusterList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the ClusterList object itself. - */ - public ClusterList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/DatastoreList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/DatastoreList.java index 6ba8a2510db6..e0878d6f1b61 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/DatastoreList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a Datastore list operation. */ -@Fluent +@Immutable public final class DatastoreList implements JsonSerializable { /* * The Datastore items on this page @@ -32,7 +32,7 @@ public final class DatastoreList implements JsonSerializable { /** * Creates an instance of DatastoreList class. */ - public DatastoreList() { + private DatastoreList() { } /** @@ -44,17 +44,6 @@ public List value() { return this.value; } - /** - * Set the value property: The Datastore items on this page. - * - * @param value the value value to set. - * @return the DatastoreList object itself. - */ - public DatastoreList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the DatastoreList object itself. - */ - public DatastoreList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ExpressRouteAuthorizationList.java similarity index 80% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ExpressRouteAuthorizationList.java index 0bdaba9f8198..e88d80801ea5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ExpressRouteAuthorizationList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a ExpressRouteAuthorization list operation. */ -@Fluent +@Immutable public final class ExpressRouteAuthorizationList implements JsonSerializable { /* * The ExpressRouteAuthorization items on this page @@ -32,7 +32,7 @@ public final class ExpressRouteAuthorizationList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The ExpressRouteAuthorization items on this page. - * - * @param value the value value to set. - * @return the ExpressRouteAuthorizationList object itself. - */ - public ExpressRouteAuthorizationList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the ExpressRouteAuthorizationList object itself. - */ - public ExpressRouteAuthorizationList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/GlobalReachConnectionList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/GlobalReachConnectionList.java index c46a1064b490..b0a04317d7a1 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/GlobalReachConnectionList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a GlobalReachConnection list operation. */ -@Fluent +@Immutable public final class GlobalReachConnectionList implements JsonSerializable { /* * The GlobalReachConnection items on this page @@ -32,7 +32,7 @@ public final class GlobalReachConnectionList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The GlobalReachConnection items on this page. - * - * @param value the value value to set. - * @return the GlobalReachConnectionList object itself. - */ - public GlobalReachConnectionList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the GlobalReachConnectionList object itself. - */ - public GlobalReachConnectionList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HcxEnterpriseSiteList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HcxEnterpriseSiteList.java index cc15c75060da..de7232d25a29 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HcxEnterpriseSiteList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a HcxEnterpriseSite list operation. */ -@Fluent +@Immutable public final class HcxEnterpriseSiteList implements JsonSerializable { /* * The HcxEnterpriseSite items on this page @@ -32,7 +32,7 @@ public final class HcxEnterpriseSiteList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The HcxEnterpriseSite items on this page. - * - * @param value the value value to set. - * @return the HcxEnterpriseSiteList object itself. - */ - public HcxEnterpriseSiteList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the HcxEnterpriseSiteList object itself. - */ - public HcxEnterpriseSiteList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HostListResult.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HostListResult.java new file mode 100644 index 000000000000..4de1ec2a8217 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HostListResult.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.avs.fluent.models.HostModelInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Host list operation. + */ +@Immutable +public final class HostListResult implements JsonSerializable { + /* + * The Host items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HostListResult class. + */ + private HostListResult() { + } + + /** + * Get the value property: The Host items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @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) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model HostListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HostListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HostListResult. + */ + public static HostListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostListResult deserializedHostListResult = new HostListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> HostModelInner.fromJson(reader1)); + deserializedHostListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHostListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHostListResult; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPathListResult.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/IscsiPathListResult.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPathListResult.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/IscsiPathListResult.java index c404b450ab5d..a321ab85959f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPathListResult.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/IscsiPathListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a IscsiPath list operation. */ -@Fluent +@Immutable public final class IscsiPathListResult implements JsonSerializable { /* * The IscsiPath items on this page @@ -32,7 +32,7 @@ public final class IscsiPathListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The IscsiPath items on this page. - * - * @param value the value value to set. - * @return the IscsiPathListResult object itself. - */ - public IscsiPathListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the IscsiPathListResult object itself. - */ - public IscsiPathListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationListResult.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/OperationListResult.java similarity index 74% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationListResult.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/OperationListResult.java index bc3307e45e4b..2b1d16cf79ab 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationListResult.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/OperationListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -20,23 +21,23 @@ @Immutable public final class OperationListResult implements JsonSerializable { /* - * List of operations supported by the resource provider + * The Operation items on this page */ private List value; /* - * URL to get the next set of operation list results (if there are any). + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OperationListResult class. */ - public OperationListResult() { + private OperationListResult() { } /** - * Get the value property: List of operations supported by the resource provider. + * Get the value property: The Operation items on this page. * * @return the value value. */ @@ -45,7 +46,7 @@ public List value() { } /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -59,17 +60,24 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model OperationListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -79,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OperationListResult. */ public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PagedResourceSku.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PagedResourceSku.java new file mode 100644 index 000000000000..1ccee54075e2 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PagedResourceSku.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.avs.fluent.models.ResourceSkuInner; +import java.io.IOException; +import java.util.List; + +/** + * Paged collection of ResourceSku items. + */ +@Immutable +public final class PagedResourceSku implements JsonSerializable { + /* + * The ResourceSku items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PagedResourceSku class. + */ + private PagedResourceSku() { + } + + /** + * Get the value property: The ResourceSku items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @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) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model PagedResourceSku")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PagedResourceSku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PagedResourceSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PagedResourceSku if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PagedResourceSku. + */ + public static PagedResourceSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PagedResourceSku deserializedPagedResourceSku = new PagedResourceSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ResourceSkuInner.fromJson(reader1)); + deserializedPagedResourceSku.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPagedResourceSku.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPagedResourceSku; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPoliciesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PlacementPoliciesList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPoliciesList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PlacementPoliciesList.java index dad43d0f936b..bc967e4fcaeb 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPoliciesList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PlacementPoliciesList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a PlacementPolicy list operation. */ -@Fluent +@Immutable public final class PlacementPoliciesList implements JsonSerializable { /* * The PlacementPolicy items on this page @@ -32,7 +32,7 @@ public final class PlacementPoliciesList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The PlacementPolicy items on this page. - * - * @param value the value value to set. - * @return the PlacementPoliciesList object itself. - */ - public PlacementPoliciesList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the PlacementPoliciesList object itself. - */ - public PlacementPoliciesList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PrivateCloudList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PrivateCloudList.java index 593200bf1f3d..5c2d798b7957 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PrivateCloudList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a PrivateCloud list operation. */ -@Fluent +@Immutable public final class PrivateCloudList implements JsonSerializable { /* * The PrivateCloud items on this page @@ -32,7 +32,7 @@ public final class PrivateCloudList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The PrivateCloud items on this page. - * - * @param value the value value to set. - * @return the PrivateCloudList object itself. - */ - public PrivateCloudList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the PrivateCloudList object itself. - */ - public PrivateCloudList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ProvisionedNetworkListResult.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ProvisionedNetworkListResult.java new file mode 100644 index 000000000000..7a930e31805f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ProvisionedNetworkListResult.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.avs.fluent.models.ProvisionedNetworkInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ProvisionedNetwork list operation. + */ +@Immutable +public final class ProvisionedNetworkListResult implements JsonSerializable { + /* + * The ProvisionedNetwork items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ProvisionedNetworkListResult class. + */ + private ProvisionedNetworkListResult() { + } + + /** + * Get the value property: The ProvisionedNetwork items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @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) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ProvisionedNetworkListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProvisionedNetworkListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisionedNetworkListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisionedNetworkListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProvisionedNetworkListResult. + */ + public static ProvisionedNetworkListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisionedNetworkListResult deserializedProvisionedNetworkListResult = new ProvisionedNetworkListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ProvisionedNetworkInner.fromJson(reader1)); + deserializedProvisionedNetworkListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedProvisionedNetworkListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProvisionedNetworkListResult; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptCmdletsList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletsList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptCmdletsList.java index 29a79e836cd4..df760524584c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletsList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptCmdletsList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a ScriptCmdlet list operation. */ -@Fluent +@Immutable public final class ScriptCmdletsList implements JsonSerializable { /* * The ScriptCmdlet items on this page @@ -32,7 +32,7 @@ public final class ScriptCmdletsList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The ScriptCmdlet items on this page. - * - * @param value the value value to set. - * @return the ScriptCmdletsList object itself. - */ - public ScriptCmdletsList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the ScriptCmdletsList object itself. - */ - public ScriptCmdletsList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptExecutionsList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionsList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptExecutionsList.java index 0751c5b94cc3..221a2d7d4c1b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionsList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptExecutionsList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a ScriptExecution list operation. */ -@Fluent +@Immutable public final class ScriptExecutionsList implements JsonSerializable { /* * The ScriptExecution items on this page @@ -32,7 +32,7 @@ public final class ScriptExecutionsList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The ScriptExecution items on this page. - * - * @param value the value value to set. - * @return the ScriptExecutionsList object itself. - */ - public ScriptExecutionsList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the ScriptExecutionsList object itself. - */ - public ScriptExecutionsList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackagesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptPackagesList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackagesList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptPackagesList.java index 6cc1e86a6d66..4b6b8b48c29f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackagesList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptPackagesList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a ScriptPackage list operation. */ -@Fluent +@Immutable public final class ScriptPackagesList implements JsonSerializable { /* * The ScriptPackage items on this page @@ -32,7 +32,7 @@ public final class ScriptPackagesList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The ScriptPackage items on this page. - * - * @param value the value value to set. - * @return the ScriptPackagesList object itself. - */ - public ScriptPackagesList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the ScriptPackagesList object itself. - */ - public ScriptPackagesList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachinesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/VirtualMachinesList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachinesList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/VirtualMachinesList.java index 5a49cbbd58aa..db88c30ef7c8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachinesList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/VirtualMachinesList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a VirtualMachine list operation. */ -@Fluent +@Immutable public final class VirtualMachinesList implements JsonSerializable { /* * The VirtualMachine items on this page @@ -32,7 +32,7 @@ public final class VirtualMachinesList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The VirtualMachine items on this page. - * - * @param value the value value to set. - * @return the VirtualMachinesList object itself. - */ - public VirtualMachinesList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the VirtualMachinesList object itself. - */ - public VirtualMachinesList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDhcpList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDhcpList.java index f46b706dce34..fef946cd0a77 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDhcpList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a WorkloadNetworkDhcp list operation. */ -@Fluent +@Immutable public final class WorkloadNetworkDhcpList implements JsonSerializable { /* * The WorkloadNetworkDhcp items on this page @@ -32,7 +32,7 @@ public final class WorkloadNetworkDhcpList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The WorkloadNetworkDhcp items on this page. - * - * @param value the value value to set. - * @return the WorkloadNetworkDhcpList object itself. - */ - public WorkloadNetworkDhcpList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the WorkloadNetworkDhcpList object itself. - */ - public WorkloadNetworkDhcpList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServicesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsServicesList.java similarity index 80% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServicesList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsServicesList.java index 76d2e07988e0..292d21034031 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServicesList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsServicesList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a WorkloadNetworkDnsService list operation. */ -@Fluent +@Immutable public final class WorkloadNetworkDnsServicesList implements JsonSerializable { /* * The WorkloadNetworkDnsService items on this page @@ -32,7 +32,7 @@ public final class WorkloadNetworkDnsServicesList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The WorkloadNetworkDnsService items on this page. - * - * @param value the value value to set. - * @return the WorkloadNetworkDnsServicesList object itself. - */ - public WorkloadNetworkDnsServicesList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the WorkloadNetworkDnsServicesList object itself. - */ - public WorkloadNetworkDnsServicesList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZonesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsZonesList.java similarity index 80% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZonesList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsZonesList.java index c930e295bb71..930c54561a18 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZonesList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsZonesList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a WorkloadNetworkDnsZone list operation. */ -@Fluent +@Immutable public final class WorkloadNetworkDnsZonesList implements JsonSerializable { /* * The WorkloadNetworkDnsZone items on this page @@ -32,7 +32,7 @@ public final class WorkloadNetworkDnsZonesList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The WorkloadNetworkDnsZone items on this page. - * - * @param value the value value to set. - * @return the WorkloadNetworkDnsZonesList object itself. - */ - public WorkloadNetworkDnsZonesList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the WorkloadNetworkDnsZonesList object itself. - */ - public WorkloadNetworkDnsZonesList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkGatewayList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkGatewayList.java index e9ab6559ca7c..770af19950ac 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkGatewayList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a WorkloadNetworkGateway list operation. */ -@Fluent +@Immutable public final class WorkloadNetworkGatewayList implements JsonSerializable { /* * The WorkloadNetworkGateway items on this page @@ -32,7 +32,7 @@ public final class WorkloadNetworkGatewayList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The WorkloadNetworkGateway items on this page. - * - * @param value the value value to set. - * @return the WorkloadNetworkGatewayList object itself. - */ - public WorkloadNetworkGatewayList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the WorkloadNetworkGatewayList object itself. - */ - public WorkloadNetworkGatewayList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkList.java similarity index 81% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkList.java index 15fca9048b20..655ce3573c94 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a WorkloadNetwork list operation. */ -@Fluent +@Immutable public final class WorkloadNetworkList implements JsonSerializable { /* * The WorkloadNetwork items on this page @@ -32,7 +32,7 @@ public final class WorkloadNetworkList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The WorkloadNetwork items on this page. - * - * @param value the value value to set. - * @return the WorkloadNetworkList object itself. - */ - public WorkloadNetworkList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the WorkloadNetworkList object itself. - */ - public WorkloadNetworkList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPortMirroringList.java similarity index 80% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPortMirroringList.java index 4c8386b42953..8bee83c796c6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPortMirroringList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a WorkloadNetworkPortMirroring list operation. */ -@Fluent +@Immutable public final class WorkloadNetworkPortMirroringList implements JsonSerializable { /* * The WorkloadNetworkPortMirroring items on this page @@ -32,7 +32,7 @@ public final class WorkloadNetworkPortMirroringList implements JsonSerializable< /** * Creates an instance of WorkloadNetworkPortMirroringList class. */ - public WorkloadNetworkPortMirroringList() { + private WorkloadNetworkPortMirroringList() { } /** @@ -44,17 +44,6 @@ public List value() { return this.value; } - /** - * Set the value property: The WorkloadNetworkPortMirroring items on this page. - * - * @param value the value value to set. - * @return the WorkloadNetworkPortMirroringList object itself. - */ - public WorkloadNetworkPortMirroringList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the WorkloadNetworkPortMirroringList object itself. - */ - public WorkloadNetworkPortMirroringList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIPsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPublicIPsList.java similarity index 80% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIPsList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPublicIPsList.java index db09fea2cf4f..79339df90f44 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIPsList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPublicIPsList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a WorkloadNetworkPublicIP list operation. */ -@Fluent +@Immutable public final class WorkloadNetworkPublicIPsList implements JsonSerializable { /* * The WorkloadNetworkPublicIP items on this page @@ -32,7 +32,7 @@ public final class WorkloadNetworkPublicIPsList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The WorkloadNetworkPublicIP items on this page. - * - * @param value the value value to set. - * @return the WorkloadNetworkPublicIPsList object itself. - */ - public WorkloadNetworkPublicIPsList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the WorkloadNetworkPublicIPsList object itself. - */ - public WorkloadNetworkPublicIPsList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkSegmentsList.java similarity index 80% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentsList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkSegmentsList.java index 46a9b41e5875..e066949e7b83 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentsList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkSegmentsList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a WorkloadNetworkSegment list operation. */ -@Fluent +@Immutable public final class WorkloadNetworkSegmentsList implements JsonSerializable { /* * The WorkloadNetworkSegment items on this page @@ -32,7 +32,7 @@ public final class WorkloadNetworkSegmentsList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The WorkloadNetworkSegment items on this page. - * - * @param value the value value to set. - * @return the WorkloadNetworkSegmentsList object itself. - */ - public WorkloadNetworkSegmentsList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the WorkloadNetworkSegmentsList object itself. - */ - public WorkloadNetworkSegmentsList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVMGroupsList.java similarity index 80% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupsList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVMGroupsList.java index 41ecea0e666a..529bacfa504a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupsList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVMGroupsList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a WorkloadNetworkVMGroup list operation. */ -@Fluent +@Immutable public final class WorkloadNetworkVMGroupsList implements JsonSerializable { /* * The WorkloadNetworkVMGroup items on this page @@ -32,7 +32,7 @@ public final class WorkloadNetworkVMGroupsList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The WorkloadNetworkVMGroup items on this page. - * - * @param value the value value to set. - * @return the WorkloadNetworkVMGroupsList object itself. - */ - public WorkloadNetworkVMGroupsList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the WorkloadNetworkVMGroupsList object itself. - */ - public WorkloadNetworkVMGroupsList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachinesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVirtualMachinesList.java similarity index 80% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachinesList.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVirtualMachinesList.java index e1640e396d99..573d4ffa5d70 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachinesList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVirtualMachinesList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.models; +package com.azure.resourcemanager.avs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a WorkloadNetworkVirtualMachine list operation. */ -@Fluent +@Immutable public final class WorkloadNetworkVirtualMachinesList implements JsonSerializable { /* * The WorkloadNetworkVirtualMachine items on this page @@ -32,7 +32,7 @@ public final class WorkloadNetworkVirtualMachinesList implements JsonSerializabl /** * Creates an instance of WorkloadNetworkVirtualMachinesList class. */ - public WorkloadNetworkVirtualMachinesList() { + private WorkloadNetworkVirtualMachinesList() { } /** @@ -44,17 +44,6 @@ public List value() { return this.value; } - /** - * Set the value property: The WorkloadNetworkVirtualMachine items on this page. - * - * @param value the value value to set. - * @return the WorkloadNetworkVirtualMachinesList object itself. - */ - public WorkloadNetworkVirtualMachinesList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the WorkloadNetworkVirtualMachinesList object itself. - */ - public WorkloadNetworkVirtualMachinesList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/package-info.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/package-info.java index f4a0631101b9..6b06533a637d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/package-info.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for AvsClient. + * Package containing the implementations for Avs. * Azure VMware Solution API. */ package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ActionType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ActionType.java index c50b3f136050..feeb9978fd4d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ActionType.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ActionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -8,11 +8,11 @@ import java.util.Collection; /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible 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. + * Actions are for internal-only APIs. */ public static final ActionType INTERNAL = fromString("Internal"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addon.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addon.java index 21fad4eca030..22ecde52de54 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addon.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addon.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonArcProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonArcProperties.java index 48f86ecfd961..1c6933802089 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonArcProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonArcProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -25,11 +25,6 @@ public final class AddonArcProperties extends AddonProperties { */ private String vCenter; - /* - * The state of the addon provisioning - */ - private AddonProvisioningState provisioningState; - /** * Creates an instance of AddonArcProperties class. */ @@ -66,16 +61,6 @@ public AddonArcProperties withVCenter(String vCenter) { return this; } - /** - * Get the provisioningState property: The state of the addon provisioning. - * - * @return the provisioningState value. - */ - @Override - public AddonProvisioningState provisioningState() { - return this.provisioningState; - } - /** * Validates the instance. * @@ -112,8 +97,8 @@ public static AddonArcProperties fromJson(JsonReader jsonReader) throws IOExcept reader.nextToken(); if ("provisioningState".equals(fieldName)) { - deserializedAddonArcProperties.provisioningState - = AddonProvisioningState.fromString(reader.getString()); + deserializedAddonArcProperties + .withProvisioningState(AddonProvisioningState.fromString(reader.getString())); } else if ("addonType".equals(fieldName)) { deserializedAddonArcProperties.addonType = AddonType.fromString(reader.getString()); } else if ("vCenter".equals(fieldName)) { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonHcxProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonHcxProperties.java index bae6a536c8e6..091a997c44e1 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonHcxProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonHcxProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -27,9 +27,14 @@ public final class AddonHcxProperties extends AddonProperties { private String offer; /* - * The state of the addon provisioning + * HCX management network. */ - private AddonProvisioningState provisioningState; + private String managementNetwork; + + /* + * HCX uplink network + */ + private String uplinkNetwork; /** * Creates an instance of AddonHcxProperties class. @@ -68,13 +73,43 @@ public AddonHcxProperties withOffer(String offer) { } /** - * Get the provisioningState property: The state of the addon provisioning. + * Get the managementNetwork property: HCX management network. * - * @return the provisioningState value. + * @return the managementNetwork value. */ - @Override - public AddonProvisioningState provisioningState() { - return this.provisioningState; + public String managementNetwork() { + return this.managementNetwork; + } + + /** + * Set the managementNetwork property: HCX management network. + * + * @param managementNetwork the managementNetwork value to set. + * @return the AddonHcxProperties object itself. + */ + public AddonHcxProperties withManagementNetwork(String managementNetwork) { + this.managementNetwork = managementNetwork; + return this; + } + + /** + * Get the uplinkNetwork property: HCX uplink network. + * + * @return the uplinkNetwork value. + */ + public String uplinkNetwork() { + return this.uplinkNetwork; + } + + /** + * Set the uplinkNetwork property: HCX uplink network. + * + * @param uplinkNetwork the uplinkNetwork value to set. + * @return the AddonHcxProperties object itself. + */ + public AddonHcxProperties withUplinkNetwork(String uplinkNetwork) { + this.uplinkNetwork = uplinkNetwork; + return this; } /** @@ -100,6 +135,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("offer", this.offer); jsonWriter.writeStringField("addonType", this.addonType == null ? null : this.addonType.toString()); + jsonWriter.writeStringField("managementNetwork", this.managementNetwork); + jsonWriter.writeStringField("uplinkNetwork", this.uplinkNetwork); return jsonWriter.writeEndObject(); } @@ -120,12 +157,16 @@ public static AddonHcxProperties fromJson(JsonReader jsonReader) throws IOExcept reader.nextToken(); if ("provisioningState".equals(fieldName)) { - deserializedAddonHcxProperties.provisioningState - = AddonProvisioningState.fromString(reader.getString()); + deserializedAddonHcxProperties + .withProvisioningState(AddonProvisioningState.fromString(reader.getString())); } else if ("offer".equals(fieldName)) { deserializedAddonHcxProperties.offer = reader.getString(); } else if ("addonType".equals(fieldName)) { deserializedAddonHcxProperties.addonType = AddonType.fromString(reader.getString()); + } else if ("managementNetwork".equals(fieldName)) { + deserializedAddonHcxProperties.managementNetwork = reader.getString(); + } else if ("uplinkNetwork".equals(fieldName)) { + deserializedAddonHcxProperties.uplinkNetwork = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java index 2664de5116cb..67e3aaa9b2ff 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -103,14 +103,14 @@ public static AddonProperties fromJson(JsonReader jsonReader) throws IOException } } // Use the discriminator value to determine which subtype should be deserialized. - if ("Arc".equals(discriminatorValue)) { - return AddonArcProperties.fromJson(readerToUse.reset()); - } else if ("HCX".equals(discriminatorValue)) { - return AddonHcxProperties.fromJson(readerToUse.reset()); - } else if ("SRM".equals(discriminatorValue)) { + if ("SRM".equals(discriminatorValue)) { return AddonSrmProperties.fromJson(readerToUse.reset()); } else if ("VR".equals(discriminatorValue)) { return AddonVrProperties.fromJson(readerToUse.reset()); + } else if ("HCX".equals(discriminatorValue)) { + return AddonHcxProperties.fromJson(readerToUse.reset()); + } else if ("Arc".equals(discriminatorValue)) { + return AddonArcProperties.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProvisioningState.java index a2eca422d988..54ab88e669f8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,37 +12,37 @@ */ public final class AddonProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for AddonProvisioningState. + * Resource has been created. */ public static final AddonProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for AddonProvisioningState. + * Resource creation failed. */ public static final AddonProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for AddonProvisioningState. + * Resource creation was canceled. */ public static final AddonProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Cancelled for AddonProvisioningState. + * is cancelled. */ public static final AddonProvisioningState CANCELLED = fromString("Cancelled"); /** - * Static value Building for AddonProvisioningState. + * is building. */ public static final AddonProvisioningState BUILDING = fromString("Building"); /** - * Static value Deleting for AddonProvisioningState. + * is deleting. */ public static final AddonProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for AddonProvisioningState. + * is updating. */ public static final AddonProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java index 0fac82ebd100..2cda7ce07dbf 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -25,11 +25,6 @@ public final class AddonSrmProperties extends AddonProperties { */ private String licenseKey; - /* - * The state of the addon provisioning - */ - private AddonProvisioningState provisioningState; - /** * Creates an instance of AddonSrmProperties class. */ @@ -66,16 +61,6 @@ public AddonSrmProperties withLicenseKey(String licenseKey) { return this; } - /** - * Get the provisioningState property: The state of the addon provisioning. - * - * @return the provisioningState value. - */ - @Override - public AddonProvisioningState provisioningState() { - return this.provisioningState; - } - /** * Validates the instance. * @@ -112,8 +97,8 @@ public static AddonSrmProperties fromJson(JsonReader jsonReader) throws IOExcept reader.nextToken(); if ("provisioningState".equals(fieldName)) { - deserializedAddonSrmProperties.provisioningState - = AddonProvisioningState.fromString(reader.getString()); + deserializedAddonSrmProperties + .withProvisioningState(AddonProvisioningState.fromString(reader.getString())); } else if ("addonType".equals(fieldName)) { deserializedAddonSrmProperties.addonType = AddonType.fromString(reader.getString()); } else if ("licenseKey".equals(fieldName)) { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonType.java index 784a393692c5..57b25f50ac57 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonType.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonVrProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonVrProperties.java index 5d23f53f7ff4..3e925779a273 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonVrProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonVrProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -25,11 +25,6 @@ public final class AddonVrProperties extends AddonProperties { */ private int vrsCount; - /* - * The state of the addon provisioning - */ - private AddonProvisioningState provisioningState; - /** * Creates an instance of AddonVrProperties class. */ @@ -66,16 +61,6 @@ public AddonVrProperties withVrsCount(int vrsCount) { return this; } - /** - * Get the provisioningState property: The state of the addon provisioning. - * - * @return the provisioningState value. - */ - @Override - public AddonProvisioningState provisioningState() { - return this.provisioningState; - } - /** * Validates the instance. * @@ -113,8 +98,8 @@ public static AddonVrProperties fromJson(JsonReader jsonReader) throws IOExcepti reader.nextToken(); if ("provisioningState".equals(fieldName)) { - deserializedAddonVrProperties.provisioningState - = AddonProvisioningState.fromString(reader.getString()); + deserializedAddonVrProperties + .withProvisioningState(AddonProvisioningState.fromString(reader.getString())); } else if ("vrsCount".equals(fieldName)) { deserializedAddonVrProperties.vrsCount = reader.getInt(); } else if ("addonType".equals(fieldName)) { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addons.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addons.java index a0b40291f2e8..dc501f68a62f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addons.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addons.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AdminCredentials.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AdminCredentials.java index 7abe7069e343..265d685b159a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AdminCredentials.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AdminCredentials.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AffinityStrength.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AffinityStrength.java index 40d4de828602..32e6334dd97b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AffinityStrength.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AffinityStrength.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class AffinityStrength extends ExpandableStringEnum { /** - * Static value Should for AffinityStrength. + * is should. */ public static final AffinityStrength SHOULD = fromString("Should"); /** - * Static value Must for AffinityStrength. + * is must. */ public static final AffinityStrength MUST = fromString("Must"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AffinityType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AffinityType.java index 4f7b2466f097..2186c3f1a6eb 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AffinityType.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AffinityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class AffinityType extends ExpandableStringEnum { /** - * Static value Affinity for AffinityType. + * is affinity. */ public static final AffinityType AFFINITY = fromString("Affinity"); /** - * Static value AntiAffinity for AffinityType. + * is anti-affinity. */ public static final AffinityType ANTI_AFFINITY = fromString("AntiAffinity"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Authorizations.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Authorizations.java index 94608027c3b7..715c100724cb 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Authorizations.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Authorizations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailabilityProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailabilityProperties.java index d75426481193..3bab7b0d484d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailabilityProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailabilityProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailabilityStrategy.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailabilityStrategy.java index d5066977f255..a8e8152a7de9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailabilityStrategy.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailabilityStrategy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class AvailabilityStrategy extends ExpandableStringEnum { /** - * Static value SingleZone for AvailabilityStrategy. + * in single zone. */ public static final AvailabilityStrategy SINGLE_ZONE = fromString("SingleZone"); /** - * Static value DualZone for AvailabilityStrategy. + * in two zones. */ public static final AvailabilityStrategy DUAL_ZONE = fromString("DualZone"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AzureHybridBenefitType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AzureHybridBenefitType.java index 4c81c8e93053..4145c3c7ddd6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AzureHybridBenefitType.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AzureHybridBenefitType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class AzureHybridBenefitType extends ExpandableStringEnum { /** - * Static value SqlHost for AzureHybridBenefitType. + * is SqlHost. */ public static final AzureHybridBenefitType SQL_HOST = fromString("SqlHost"); /** - * Static value None for AzureHybridBenefitType. + * is None. */ public static final AzureHybridBenefitType NONE = fromString("None"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Circuit.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Circuit.java index 517d52a6c6d7..42484381f02e 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Circuit.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Circuit.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLink.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLink.java index 13eae37964b9..962401b88be9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLink.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLink.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -34,32 +34,18 @@ public interface CloudLink { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the resource. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the provisioningState value. + * @return the properties value. */ - CloudLinkProvisioningState provisioningState(); + CloudLinkProperties properties(); /** - * Gets the status property: The state of the cloud link. - * - * @return the status value. - */ - CloudLinkStatus status(); - - /** - * Gets the linkedCloud property: Identifier of the other private cloud participating in the link. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the linkedCloud value. + * @return the systemData value. */ - String linkedCloud(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -110,7 +96,7 @@ interface WithParentResource { * The stage of the CloudLink 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.WithLinkedCloud { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -128,16 +114,16 @@ interface WithCreate extends DefinitionStages.WithLinkedCloud { } /** - * The stage of the CloudLink definition allowing to specify linkedCloud. + * The stage of the CloudLink definition allowing to specify properties. */ - interface WithLinkedCloud { + interface WithProperties { /** - * Specifies the linkedCloud property: Identifier of the other private cloud participating in the link.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param linkedCloud Identifier of the other private cloud participating in the link. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withLinkedCloud(String linkedCloud); + WithCreate withProperties(CloudLinkProperties properties); } } @@ -151,7 +137,7 @@ interface WithLinkedCloud { /** * The template for CloudLink update. */ - interface Update extends UpdateStages.WithLinkedCloud { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -173,16 +159,16 @@ interface Update extends UpdateStages.WithLinkedCloud { */ interface UpdateStages { /** - * The stage of the CloudLink update allowing to specify linkedCloud. + * The stage of the CloudLink update allowing to specify properties. */ - interface WithLinkedCloud { + interface WithProperties { /** - * Specifies the linkedCloud property: Identifier of the other private cloud participating in the link.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param linkedCloud Identifier of the other private cloud participating in the link. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - Update withLinkedCloud(String linkedCloud); + Update withProperties(CloudLinkProperties properties); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkProperties.java similarity index 94% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkProperties.java index 3334166af051..5150943fd251 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkProperties.java @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.CloudLinkProvisioningState; -import com.azure.resourcemanager.avs.models.CloudLinkStatus; import java.io.IOException; /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkProvisioningState.java index 92557e85729e..12e178c46863 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,17 +12,17 @@ */ public final class CloudLinkProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for CloudLinkProvisioningState. + * Resource has been created. */ public static final CloudLinkProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for CloudLinkProvisioningState. + * Resource creation failed. */ public static final CloudLinkProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for CloudLinkProvisioningState. + * Resource creation was canceled. */ public static final CloudLinkProvisioningState CANCELED = fromString("Canceled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkStatus.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkStatus.java index a04e1c6765b2..3eeb9f8abbd2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkStatus.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,27 +12,27 @@ */ public final class CloudLinkStatus extends ExpandableStringEnum { /** - * Static value Active for CloudLinkStatus. + * is active. */ public static final CloudLinkStatus ACTIVE = fromString("Active"); /** - * Static value Building for CloudLinkStatus. + * is building. */ public static final CloudLinkStatus BUILDING = fromString("Building"); /** - * Static value Deleting for CloudLinkStatus. + * is deleting. */ public static final CloudLinkStatus DELETING = fromString("Deleting"); /** - * Static value Failed for CloudLinkStatus. + * is failed. */ public static final CloudLinkStatus FAILED = fromString("Failed"); /** - * Static value Disconnected for CloudLinkStatus. + * is disconnected. */ public static final CloudLinkStatus DISCONNECTED = fromString("Disconnected"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinks.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinks.java index 6f5c96ad6b27..f7a0d33b5543 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinks.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinks.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Cluster.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Cluster.java index a925e2ab724f..b8faa598c743 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Cluster.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Cluster.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -35,6 +35,13 @@ public interface Cluster { */ String type(); + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ClusterProperties properties(); + /** * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * @@ -49,41 +56,6 @@ public interface Cluster { */ SystemData systemData(); - /** - * Gets the clusterSize property: The cluster size. - * - * @return the clusterSize value. - */ - Integer clusterSize(); - - /** - * Gets the provisioningState property: The state of the cluster provisioning. - * - * @return the provisioningState value. - */ - ClusterProvisioningState provisioningState(); - - /** - * Gets the clusterId property: The identity. - * - * @return the clusterId value. - */ - Integer clusterId(); - - /** - * Gets the hosts property: The hosts. - * - * @return the hosts value. - */ - List hosts(); - - /** - * Gets the vsanDatastoreName property: Name of the vsan datastore associated with the cluster. - * - * @return the vsanDatastoreName value. - */ - String vsanDatastoreName(); - /** * Gets the name of the resource group. * @@ -146,8 +118,7 @@ interface WithSku { * The stage of the Cluster 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.WithClusterSize, DefinitionStages.WithHosts, - DefinitionStages.WithVsanDatastoreName { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -165,42 +136,16 @@ interface WithCreate extends DefinitionStages.WithClusterSize, DefinitionStages. } /** - * The stage of the Cluster definition allowing to specify clusterSize. - */ - interface WithClusterSize { - /** - * Specifies the clusterSize property: The cluster size. - * - * @param clusterSize The cluster size. - * @return the next definition stage. - */ - WithCreate withClusterSize(Integer clusterSize); - } - - /** - * The stage of the Cluster definition allowing to specify hosts. - */ - interface WithHosts { - /** - * Specifies the hosts property: The hosts. - * - * @param hosts The hosts. - * @return the next definition stage. - */ - WithCreate withHosts(List hosts); - } - - /** - * The stage of the Cluster definition allowing to specify vsanDatastoreName. + * The stage of the Cluster definition allowing to specify properties. */ - interface WithVsanDatastoreName { + interface WithProperties { /** - * Specifies the vsanDatastoreName property: Name of the vsan datastore associated with the cluster. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param vsanDatastoreName Name of the vsan datastore associated with the cluster. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withVsanDatastoreName(String vsanDatastoreName); + WithCreate withProperties(ClusterProperties properties); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProperties.java similarity index 96% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProperties.java index 5ce8d1f79480..a814dc0916d9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProperties.java @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.ClusterProvisioningState; import java.io.IOException; import java.util.List; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProvisioningState.java index d532ca0623bd..4a5af3ea6a00 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,32 +12,32 @@ */ public final class ClusterProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for ClusterProvisioningState. + * Resource has been created. */ public static final ClusterProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ClusterProvisioningState. + * Resource creation failed. */ public static final ClusterProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ClusterProvisioningState. + * Resource creation was canceled. */ public static final ClusterProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Cancelled for ClusterProvisioningState. + * is cancelled. */ public static final ClusterProvisioningState CANCELLED = fromString("Cancelled"); /** - * Static value Deleting for ClusterProvisioningState. + * is deleting. */ public static final ClusterProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for ClusterProvisioningState. + * is updating. */ public static final ClusterProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdate.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdate.java index fa53aa374903..f770db686fd9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdate.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterZone.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterZone.java index dc971cba1ac1..70605586268b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterZone.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterZone.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -30,7 +30,7 @@ public final class ClusterZone implements JsonSerializable { /** * Creates an instance of ClusterZone class. */ - public ClusterZone() { + private ClusterZone() { } /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterZoneList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterZoneList.java index 350233c2ef30..ee23460ef211 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterZoneList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterZoneList.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Clusters.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Clusters.java index aa02399e9eb4..43a52f8d6d0a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Clusters.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Clusters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastore.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastore.java index b98856d88579..a01da824ff06 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastore.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastore.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -34,46 +34,18 @@ public interface Datastore { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The state of the datastore provisioning. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the provisioningState value. + * @return the properties value. */ - DatastoreProvisioningState provisioningState(); + DatastoreProperties properties(); /** - * Gets the netAppVolume property: An Azure NetApp Files volume. - * - * @return the netAppVolume value. - */ - NetAppVolume netAppVolume(); - - /** - * Gets the diskPoolVolume property: An iSCSI volume. - * - * @return the diskPoolVolume value. - */ - DiskPoolVolume diskPoolVolume(); - - /** - * Gets the elasticSanVolume property: An Elastic SAN volume. - * - * @return the elasticSanVolume value. - */ - ElasticSanVolume elasticSanVolume(); - - /** - * Gets the status property: The operational status of the datastore. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the status value. + * @return the systemData value. */ - DatastoreStatus status(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -125,8 +97,7 @@ interface WithParentResource { * The stage of the Datastore 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.WithNetAppVolume, DefinitionStages.WithDiskPoolVolume, - DefinitionStages.WithElasticSanVolume { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -144,42 +115,16 @@ interface WithCreate extends DefinitionStages.WithNetAppVolume, DefinitionStages } /** - * The stage of the Datastore definition allowing to specify netAppVolume. - */ - interface WithNetAppVolume { - /** - * Specifies the netAppVolume property: An Azure NetApp Files volume. - * - * @param netAppVolume An Azure NetApp Files volume. - * @return the next definition stage. - */ - WithCreate withNetAppVolume(NetAppVolume netAppVolume); - } - - /** - * The stage of the Datastore definition allowing to specify diskPoolVolume. - */ - interface WithDiskPoolVolume { - /** - * Specifies the diskPoolVolume property: An iSCSI volume. - * - * @param diskPoolVolume An iSCSI volume. - * @return the next definition stage. - */ - WithCreate withDiskPoolVolume(DiskPoolVolume diskPoolVolume); - } - - /** - * The stage of the Datastore definition allowing to specify elasticSanVolume. + * The stage of the Datastore definition allowing to specify properties. */ - interface WithElasticSanVolume { + interface WithProperties { /** - * Specifies the elasticSanVolume property: An Elastic SAN volume. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param elasticSanVolume An Elastic SAN volume. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withElasticSanVolume(ElasticSanVolume elasticSanVolume); + WithCreate withProperties(DatastoreProperties properties); } } @@ -193,8 +138,7 @@ interface WithElasticSanVolume { /** * The template for Datastore update. */ - interface Update - extends UpdateStages.WithNetAppVolume, UpdateStages.WithDiskPoolVolume, UpdateStages.WithElasticSanVolume { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -216,42 +160,16 @@ interface Update */ interface UpdateStages { /** - * The stage of the Datastore update allowing to specify netAppVolume. - */ - interface WithNetAppVolume { - /** - * Specifies the netAppVolume property: An Azure NetApp Files volume. - * - * @param netAppVolume An Azure NetApp Files volume. - * @return the next definition stage. - */ - Update withNetAppVolume(NetAppVolume netAppVolume); - } - - /** - * The stage of the Datastore update allowing to specify diskPoolVolume. - */ - interface WithDiskPoolVolume { - /** - * Specifies the diskPoolVolume property: An iSCSI volume. - * - * @param diskPoolVolume An iSCSI volume. - * @return the next definition stage. - */ - Update withDiskPoolVolume(DiskPoolVolume diskPoolVolume); - } - - /** - * The stage of the Datastore update allowing to specify elasticSanVolume. + * The stage of the Datastore update allowing to specify properties. */ - interface WithElasticSanVolume { + interface WithProperties { /** - * Specifies the elasticSanVolume property: An Elastic SAN volume. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param elasticSanVolume An Elastic SAN volume. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - Update withElasticSanVolume(ElasticSanVolume elasticSanVolume); + Update withProperties(DatastoreProperties properties); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreProperties.java similarity index 83% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreProperties.java index 09cb698a3b50..b4005084d5ac 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreProperties.java @@ -1,19 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.DatastoreProvisioningState; -import com.azure.resourcemanager.avs.models.DatastoreStatus; -import com.azure.resourcemanager.avs.models.DiskPoolVolume; -import com.azure.resourcemanager.avs.models.ElasticSanVolume; -import com.azure.resourcemanager.avs.models.NetAppVolume; import java.io.IOException; /** @@ -41,6 +36,11 @@ public final class DatastoreProperties implements JsonSerializable { /** - * Static value Succeeded for DatastoreProvisioningState. + * Resource has been created. */ public static final DatastoreProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for DatastoreProvisioningState. + * Resource creation failed. */ public static final DatastoreProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for DatastoreProvisioningState. + * Resource creation was canceled. */ public static final DatastoreProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Cancelled for DatastoreProvisioningState. + * is cancelled. */ public static final DatastoreProvisioningState CANCELLED = fromString("Cancelled"); /** - * Static value Pending for DatastoreProvisioningState. + * is pending. */ public static final DatastoreProvisioningState PENDING = fromString("Pending"); /** - * Static value Creating for DatastoreProvisioningState. + * is creating. */ public static final DatastoreProvisioningState CREATING = fromString("Creating"); /** - * Static value Updating for DatastoreProvisioningState. + * is updating. */ public static final DatastoreProvisioningState UPDATING = fromString("Updating"); /** - * Static value Deleting for DatastoreProvisioningState. + * is deleting. */ public static final DatastoreProvisioningState DELETING = fromString("Deleting"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreStatus.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreStatus.java index 847e414bb9fb..3e8c4653f742 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreStatus.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,37 +12,37 @@ */ public final class DatastoreStatus extends ExpandableStringEnum { /** - * Static value Unknown for DatastoreStatus. + * is unknown. */ public static final DatastoreStatus UNKNOWN = fromString("Unknown"); /** - * Static value Accessible for DatastoreStatus. + * is accessible. */ public static final DatastoreStatus ACCESSIBLE = fromString("Accessible"); /** - * Static value Inaccessible for DatastoreStatus. + * is inaccessible. */ public static final DatastoreStatus INACCESSIBLE = fromString("Inaccessible"); /** - * Static value Attached for DatastoreStatus. + * is attached. */ public static final DatastoreStatus ATTACHED = fromString("Attached"); /** - * Static value Detached for DatastoreStatus. + * is detached. */ public static final DatastoreStatus DETACHED = fromString("Detached"); /** - * Static value LostCommunication for DatastoreStatus. + * is lost communication. */ public static final DatastoreStatus LOST_COMMUNICATION = fromString("LostCommunication"); /** - * Static value DeadOrError for DatastoreStatus. + * is dead or error. */ public static final DatastoreStatus DEAD_OR_ERROR = fromString("DeadOrError"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastores.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastores.java index b0670e79c727..cf0dad4336d8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastores.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastores.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DhcpTypeEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DhcpTypeEnum.java index 8cb238579180..1874d6e10800 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DhcpTypeEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DhcpTypeEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java index 71df8e977bd8..3036ea8f8890 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceLogLevelEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceLogLevelEnum.java index 5d348be233b8..51e8627eba26 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceLogLevelEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceLogLevelEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,27 +12,27 @@ */ public final class DnsServiceLogLevelEnum extends ExpandableStringEnum { /** - * Static value DEBUG for DnsServiceLogLevelEnum. + * is debug. */ public static final DnsServiceLogLevelEnum DEBUG = fromString("DEBUG"); /** - * Static value INFO for DnsServiceLogLevelEnum. + * is info. */ public static final DnsServiceLogLevelEnum INFO = fromString("INFO"); /** - * Static value WARNING for DnsServiceLogLevelEnum. + * is warning. */ public static final DnsServiceLogLevelEnum WARNING = fromString("WARNING"); /** - * Static value ERROR for DnsServiceLogLevelEnum. + * is error. */ public static final DnsServiceLogLevelEnum ERROR = fromString("ERROR"); /** - * Static value FATAL for DnsServiceLogLevelEnum. + * is fatal. */ public static final DnsServiceLogLevelEnum FATAL = fromString("FATAL"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceStatusEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceStatusEnum.java index 1bb83421c398..7c904a3eb234 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceStatusEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceStatusEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class DnsServiceStatusEnum extends ExpandableStringEnum { /** - * Static value SUCCESS for DnsServiceStatusEnum. + * is success. */ public static final DnsServiceStatusEnum SUCCESS = fromString("SUCCESS"); /** - * Static value FAILURE for DnsServiceStatusEnum. + * is failure. */ public static final DnsServiceStatusEnum FAILURE = fromString("FAILURE"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsZoneType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsZoneType.java index 58ca5b042bd0..99e55ee69dc2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsZoneType.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsZoneType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class DnsZoneType extends ExpandableStringEnum { /** - * Static value Public for DnsZoneType. + * Primary DNS zone. */ public static final DnsZoneType PUBLIC = fromString("Public"); /** - * Static value Private for DnsZoneType. + * Private DNS zone. */ public static final DnsZoneType PRIVATE = fromString("Private"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ElasticSanVolume.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ElasticSanVolume.java index d91ad9f8b36e..ecf6eef6c96a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ElasticSanVolume.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ElasticSanVolume.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Encryption.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Encryption.java index 8e2b1d391500..2485edf71ae5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Encryption.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Encryption.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionKeyStatus.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionKeyStatus.java index bdda450e865e..2a264606fa3e 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionKeyStatus.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionKeyStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class EncryptionKeyStatus extends ExpandableStringEnum { /** - * Static value Connected for EncryptionKeyStatus. + * is connected. */ public static final EncryptionKeyStatus CONNECTED = fromString("Connected"); /** - * Static value AccessDenied for EncryptionKeyStatus. + * is access denied. */ public static final EncryptionKeyStatus ACCESS_DENIED = fromString("AccessDenied"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionKeyVaultProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionKeyVaultProperties.java index cc23a75c3a83..b6279d7d0007 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionKeyVaultProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionKeyVaultProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionState.java index 2474d4779731..22e6cdaeda96 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class EncryptionState extends ExpandableStringEnum { /** - * Static value Enabled for EncryptionState. + * is enabled. */ public static final EncryptionState ENABLED = fromString("Enabled"); /** - * Static value Disabled for EncryptionState. + * is disabled. */ public static final EncryptionState DISABLED = fromString("Disabled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionVersionType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionVersionType.java index b3248fcfb900..b02dc6d72cb7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionVersionType.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionVersionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class EncryptionVersionType extends ExpandableStringEnum { /** - * Static value Fixed for EncryptionVersionType. + * is fixed. */ public static final EncryptionVersionType FIXED = fromString("Fixed"); /** - * Static value AutoDetected for EncryptionVersionType. + * is auto-detected. */ public static final EncryptionVersionType AUTO_DETECTED = fromString("AutoDetected"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Endpoints.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Endpoints.java index c766d2d35c69..1ec6012f38fa 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Endpoints.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Endpoints.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -49,7 +49,7 @@ public final class Endpoints implements JsonSerializable { /** * Creates an instance of Endpoints class. */ - public Endpoints() { + private Endpoints() { } /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorization.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorization.java index 04c550c0e92a..bade3dd4accf 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorization.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorization.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -34,39 +34,18 @@ public interface ExpressRouteAuthorization { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The state of the ExpressRoute Circuit Authorization provisioning. - * - * @return the provisioningState value. - */ - ExpressRouteAuthorizationProvisioningState provisioningState(); - - /** - * Gets the expressRouteAuthorizationId property: The ID of the ExpressRoute Circuit Authorization. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the expressRouteAuthorizationId value. + * @return the properties value. */ - String expressRouteAuthorizationId(); + ExpressRouteAuthorizationProperties properties(); /** - * Gets the expressRouteAuthorizationKey property: The key of the ExpressRoute Circuit Authorization. - * - * @return the expressRouteAuthorizationKey value. - */ - String expressRouteAuthorizationKey(); - - /** - * Gets the expressRouteId property: The ID of the ExpressRoute Circuit. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the expressRouteId value. + * @return the systemData value. */ - String expressRouteId(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -117,7 +96,7 @@ interface WithParentResource { * The stage of the ExpressRouteAuthorization 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.WithExpressRouteId { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -135,16 +114,16 @@ interface WithCreate extends DefinitionStages.WithExpressRouteId { } /** - * The stage of the ExpressRouteAuthorization definition allowing to specify expressRouteId. + * The stage of the ExpressRouteAuthorization definition allowing to specify properties. */ - interface WithExpressRouteId { + interface WithProperties { /** - * Specifies the expressRouteId property: The ID of the ExpressRoute Circuit. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param expressRouteId The ID of the ExpressRoute Circuit. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withExpressRouteId(String expressRouteId); + WithCreate withProperties(ExpressRouteAuthorizationProperties properties); } } @@ -158,7 +137,7 @@ interface WithExpressRouteId { /** * The template for ExpressRouteAuthorization update. */ - interface Update extends UpdateStages.WithExpressRouteId { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -180,16 +159,16 @@ interface Update extends UpdateStages.WithExpressRouteId { */ interface UpdateStages { /** - * The stage of the ExpressRouteAuthorization update allowing to specify expressRouteId. + * The stage of the ExpressRouteAuthorization update allowing to specify properties. */ - interface WithExpressRouteId { + interface WithProperties { /** - * Specifies the expressRouteId property: The ID of the ExpressRoute Circuit. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param expressRouteId The ID of the ExpressRoute Circuit. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - Update withExpressRouteId(String expressRouteId); + Update withProperties(ExpressRouteAuthorizationProperties properties); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationProperties.java similarity index 96% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationProperties.java index 54d2511d9088..f2aeb486a9a9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationProperties.java @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.ExpressRouteAuthorizationProvisioningState; import java.io.IOException; /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationProvisioningState.java index 7cff83c66b16..4ababdf7a25d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -13,22 +13,22 @@ public final class ExpressRouteAuthorizationProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for ExpressRouteAuthorizationProvisioningState. + * Resource has been created. */ public static final ExpressRouteAuthorizationProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ExpressRouteAuthorizationProvisioningState. + * Resource creation failed. */ public static final ExpressRouteAuthorizationProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ExpressRouteAuthorizationProvisioningState. + * Resource creation was canceled. */ public static final ExpressRouteAuthorizationProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Updating for ExpressRouteAuthorizationProvisioningState. + * is updating. */ public static final ExpressRouteAuthorizationProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GeneralHostProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GeneralHostProperties.java new file mode 100644 index 000000000000..09d97501e8a6 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GeneralHostProperties.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of a general host. + */ +@Immutable +public final class GeneralHostProperties extends HostProperties { + /* + * The kind of host + */ + private HostKind kind = HostKind.GENERAL; + + /** + * Creates an instance of GeneralHostProperties class. + */ + private GeneralHostProperties() { + } + + /** + * Get the kind property: The kind of host. + * + * @return the kind value. + */ + @Override + public HostKind kind() { + return this.kind; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeStringField("maintenance", maintenance() == null ? null : maintenance().toString()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GeneralHostProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GeneralHostProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GeneralHostProperties. + */ + public static GeneralHostProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GeneralHostProperties deserializedGeneralHostProperties = new GeneralHostProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedGeneralHostProperties + .withProvisioningState(HostProvisioningState.fromString(reader.getString())); + } else if ("displayName".equals(fieldName)) { + deserializedGeneralHostProperties.withDisplayName(reader.getString()); + } else if ("moRefId".equals(fieldName)) { + deserializedGeneralHostProperties.withMoRefId(reader.getString()); + } else if ("fqdn".equals(fieldName)) { + deserializedGeneralHostProperties.withFqdn(reader.getString()); + } else if ("maintenance".equals(fieldName)) { + deserializedGeneralHostProperties.withMaintenance(HostMaintenance.fromString(reader.getString())); + } else if ("faultDomain".equals(fieldName)) { + deserializedGeneralHostProperties.withFaultDomain(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedGeneralHostProperties.kind = HostKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGeneralHostProperties; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnection.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnection.java index 12d6133eecad..acd88cb02c10 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnection.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -34,58 +34,18 @@ public interface GlobalReachConnection { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The state of the ExpressRoute Circuit Authorization provisioning. - * - * @return the provisioningState value. - */ - GlobalReachConnectionProvisioningState provisioningState(); - - /** - * Gets the addressPrefix property: The network used for global reach carved out from the original network block - * provided for the private cloud. - * - * @return the addressPrefix value. - */ - String addressPrefix(); - - /** - * Gets the authorizationKey property: Authorization key from the peer express route used for the global reach - * connection. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the authorizationKey value. + * @return the properties value. */ - String authorizationKey(); + GlobalReachConnectionProperties properties(); /** - * Gets the circuitConnectionStatus property: The connection status of the global reach connection. - * - * @return the circuitConnectionStatus value. - */ - GlobalReachConnectionStatus circuitConnectionStatus(); - - /** - * Gets the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in the global - * reach - * connection. - * - * @return the peerExpressRouteCircuit value. - */ - String peerExpressRouteCircuit(); - - /** - * Gets the expressRouteId property: The ID of the Private Cloud's ExpressRoute Circuit that is participating in the - * global reach connection. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the expressRouteId value. + * @return the systemData value. */ - String expressRouteId(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -136,8 +96,7 @@ interface WithParentResource { * The stage of the GlobalReachConnection 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.WithAuthorizationKey, - DefinitionStages.WithPeerExpressRouteCircuit, DefinitionStages.WithExpressRouteId { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -155,51 +114,16 @@ interface WithCreate extends DefinitionStages.WithAuthorizationKey, } /** - * The stage of the GlobalReachConnection definition allowing to specify authorizationKey. - */ - interface WithAuthorizationKey { - /** - * Specifies the authorizationKey property: Authorization key from the peer express route used for the - * global reach - * connection. - * - * @param authorizationKey Authorization key from the peer express route used for the global reach - * connection. - * @return the next definition stage. - */ - WithCreate withAuthorizationKey(String authorizationKey); - } - - /** - * The stage of the GlobalReachConnection definition allowing to specify peerExpressRouteCircuit. + * The stage of the GlobalReachConnection definition allowing to specify properties. */ - interface WithPeerExpressRouteCircuit { + interface WithProperties { /** - * Specifies the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in - * the global reach - * connection. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param peerExpressRouteCircuit Identifier of the ExpressRoute Circuit to peer with in the global reach - * connection. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withPeerExpressRouteCircuit(String peerExpressRouteCircuit); - } - - /** - * The stage of the GlobalReachConnection definition allowing to specify expressRouteId. - */ - interface WithExpressRouteId { - /** - * Specifies the expressRouteId property: The ID of the Private Cloud's ExpressRoute Circuit that is - * participating in the - * global reach connection. - * - * @param expressRouteId The ID of the Private Cloud's ExpressRoute Circuit that is participating in the - * global reach connection. - * @return the next definition stage. - */ - WithCreate withExpressRouteId(String expressRouteId); + WithCreate withProperties(GlobalReachConnectionProperties properties); } } @@ -213,8 +137,7 @@ interface WithExpressRouteId { /** * The template for GlobalReachConnection update. */ - interface Update extends UpdateStages.WithAuthorizationKey, UpdateStages.WithPeerExpressRouteCircuit, - UpdateStages.WithExpressRouteId { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -236,51 +159,16 @@ interface Update extends UpdateStages.WithAuthorizationKey, UpdateStages.WithPee */ interface UpdateStages { /** - * The stage of the GlobalReachConnection update allowing to specify authorizationKey. - */ - interface WithAuthorizationKey { - /** - * Specifies the authorizationKey property: Authorization key from the peer express route used for the - * global reach - * connection. - * - * @param authorizationKey Authorization key from the peer express route used for the global reach - * connection. - * @return the next definition stage. - */ - Update withAuthorizationKey(String authorizationKey); - } - - /** - * The stage of the GlobalReachConnection update allowing to specify peerExpressRouteCircuit. - */ - interface WithPeerExpressRouteCircuit { - /** - * Specifies the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in - * the global reach - * connection. - * - * @param peerExpressRouteCircuit Identifier of the ExpressRoute Circuit to peer with in the global reach - * connection. - * @return the next definition stage. - */ - Update withPeerExpressRouteCircuit(String peerExpressRouteCircuit); - } - - /** - * The stage of the GlobalReachConnection update allowing to specify expressRouteId. + * The stage of the GlobalReachConnection update allowing to specify properties. */ - interface WithExpressRouteId { + interface WithProperties { /** - * Specifies the expressRouteId property: The ID of the Private Cloud's ExpressRoute Circuit that is - * participating in the - * global reach connection. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param expressRouteId The ID of the Private Cloud's ExpressRoute Circuit that is participating in the - * global reach connection. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - Update withExpressRouteId(String expressRouteId); + Update withProperties(GlobalReachConnectionProperties properties); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProperties.java similarity index 96% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProperties.java index 4949f7dc282a..16e141cdea34 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProperties.java @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.GlobalReachConnectionProvisioningState; -import com.azure.resourcemanager.avs.models.GlobalReachConnectionStatus; import java.io.IOException; /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProvisioningState.java index c89e5d04333c..2824b7a6acae 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -13,22 +13,22 @@ public final class GlobalReachConnectionProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for GlobalReachConnectionProvisioningState. + * Resource has been created. */ public static final GlobalReachConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for GlobalReachConnectionProvisioningState. + * Resource creation failed. */ public static final GlobalReachConnectionProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for GlobalReachConnectionProvisioningState. + * Resource creation was canceled. */ public static final GlobalReachConnectionProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Updating for GlobalReachConnectionProvisioningState. + * is updating. */ public static final GlobalReachConnectionProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionStatus.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionStatus.java index 197a290c4323..01fc70edcf1f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionStatus.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,17 +12,17 @@ */ public final class GlobalReachConnectionStatus extends ExpandableStringEnum { /** - * Static value Connected for GlobalReachConnectionStatus. + * is connected. */ public static final GlobalReachConnectionStatus CONNECTED = fromString("Connected"); /** - * Static value Connecting for GlobalReachConnectionStatus. + * is connecting. */ public static final GlobalReachConnectionStatus CONNECTING = fromString("Connecting"); /** - * Static value Disconnected for GlobalReachConnectionStatus. + * is disconnected. */ public static final GlobalReachConnectionStatus DISCONNECTED = fromString("Disconnected"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnections.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnections.java index aff4eaf20196..239a15c3bfd2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnections.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnections.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSite.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSite.java index d215efe368cc..61fa8367099a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSite.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSite.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -34,32 +34,18 @@ public interface HcxEnterpriseSite { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the resource. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the provisioningState value. + * @return the properties value. */ - HcxEnterpriseSiteProvisioningState provisioningState(); + HcxEnterpriseSiteProperties properties(); /** - * Gets the activationKey property: The activation key. - * - * @return the activationKey value. - */ - String activationKey(); - - /** - * Gets the status property: The status of the HCX Enterprise Site. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the status value. + * @return the systemData value. */ - HcxEnterpriseSiteStatus status(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -110,7 +96,7 @@ interface WithParentResource { * The stage of the HcxEnterpriseSite 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 { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -126,6 +112,19 @@ interface WithCreate { */ HcxEnterpriseSite create(Context context); } + + /** + * The stage of the HcxEnterpriseSite definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(HcxEnterpriseSiteProperties properties); + } } /** @@ -138,7 +137,7 @@ interface WithCreate { /** * The template for HcxEnterpriseSite update. */ - interface Update { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -159,6 +158,18 @@ interface Update { * The HcxEnterpriseSite update stages. */ interface UpdateStages { + /** + * The stage of the HcxEnterpriseSite update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(HcxEnterpriseSiteProperties properties); + } } /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteProperties.java similarity index 93% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteProperties.java index 38bc426d6b6d..0340a9c80305 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteProperties.java @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.HcxEnterpriseSiteProvisioningState; -import com.azure.resourcemanager.avs.models.HcxEnterpriseSiteStatus; import java.io.IOException; /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteProvisioningState.java index 5ee517a3ecce..e66ff5dfb8f0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,17 +12,17 @@ */ public final class HcxEnterpriseSiteProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for HcxEnterpriseSiteProvisioningState. + * Resource has been created. */ public static final HcxEnterpriseSiteProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for HcxEnterpriseSiteProvisioningState. + * Resource creation failed. */ public static final HcxEnterpriseSiteProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for HcxEnterpriseSiteProvisioningState. + * Resource creation was canceled. */ public static final HcxEnterpriseSiteProvisioningState CANCELED = fromString("Canceled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteStatus.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteStatus.java index fe37c6d9d69c..c05f9620f689 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteStatus.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,22 +12,22 @@ */ public final class HcxEnterpriseSiteStatus extends ExpandableStringEnum { /** - * Static value Available for HcxEnterpriseSiteStatus. + * is available. */ public static final HcxEnterpriseSiteStatus AVAILABLE = fromString("Available"); /** - * Static value Consumed for HcxEnterpriseSiteStatus. + * is consumed. */ public static final HcxEnterpriseSiteStatus CONSUMED = fromString("Consumed"); /** - * Static value Deactivated for HcxEnterpriseSiteStatus. + * is deactivated. */ public static final HcxEnterpriseSiteStatus DEACTIVATED = fromString("Deactivated"); /** - * Static value Deleted for HcxEnterpriseSiteStatus. + * is deleted. */ public static final HcxEnterpriseSiteStatus DELETED = fromString("Deleted"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSites.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSites.java index 4b7f89f923ac..6ef2570b0d28 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSites.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSites.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostKind.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostKind.java new file mode 100644 index 000000000000..c0ba0f6e1d77 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostKind.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of host. + */ +public final class HostKind extends ExpandableStringEnum { + /** + * Static value General for HostKind. + */ + public static final HostKind GENERAL = fromString("General"); + + /** + * Static value Specialized for HostKind. + */ + public static final HostKind SPECIALIZED = fromString("Specialized"); + + /** + * Creates a new instance of HostKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HostKind() { + } + + /** + * Creates or finds a HostKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding HostKind. + */ + public static HostKind fromString(String name) { + return fromString(name, HostKind.class); + } + + /** + * Gets known HostKind values. + * + * @return known HostKind values. + */ + public static Collection values() { + return values(HostKind.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostMaintenance.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostMaintenance.java new file mode 100644 index 000000000000..25576689997d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostMaintenance.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The reason for host maintenance. + */ +public final class HostMaintenance extends ExpandableStringEnum { + /** + * The host is a replacement host. + */ + public static final HostMaintenance REPLACEMENT = fromString("Replacement"); + + /** + * The host is for an upgrade, such as an upgrade to ESXi, NSX-T, or other component. + */ + public static final HostMaintenance UPGRADE = fromString("Upgrade"); + + /** + * Creates a new instance of HostMaintenance value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HostMaintenance() { + } + + /** + * Creates or finds a HostMaintenance from its string representation. + * + * @param name a name to look for. + * @return the corresponding HostMaintenance. + */ + public static HostMaintenance fromString(String name) { + return fromString(name, HostMaintenance.class); + } + + /** + * Gets known HostMaintenance values. + * + * @return known HostMaintenance values. + */ + public static Collection values() { + return values(HostMaintenance.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostModel.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostModel.java new file mode 100644 index 000000000000..75cc8ff252dd --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostModel.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.avs.fluent.models.HostModelInner; +import java.util.List; + +/** + * An immutable client-side representation of HostModel. + */ +public interface HostModel { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + HostProperties properties(); + + /** + * Gets the zones property: The availability zones. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.HostModelInner object. + * + * @return the inner object. + */ + HostModelInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostProperties.java new file mode 100644 index 000000000000..9174337d2d96 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostProperties.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of a host. + */ +@Immutable +public class HostProperties implements JsonSerializable { + /* + * The kind of host + */ + private HostKind kind = HostKind.fromString("HostProperties"); + + /* + * The state of the host provisioning. + */ + private HostProvisioningState provisioningState; + + /* + * Display name of the host in VMware vCenter. + */ + private String displayName; + + /* + * vCenter managed object reference ID of the host. + */ + private String moRefId; + + /* + * Fully qualified domain name of the host. + */ + private String fqdn; + + /* + * If provided, the host is in maintenance. The value is the reason for maintenance. + */ + private HostMaintenance maintenance; + + /* + * The faultDomain property. + */ + private String faultDomain; + + /** + * Creates an instance of HostProperties class. + */ + protected HostProperties() { + } + + /** + * Get the kind property: The kind of host. + * + * @return the kind value. + */ + public HostKind kind() { + return this.kind; + } + + /** + * Get the provisioningState property: The state of the host provisioning. + * + * @return the provisioningState value. + */ + public HostProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The state of the host provisioning. + * + * @param provisioningState the provisioningState value to set. + * @return the HostProperties object itself. + */ + HostProperties withProvisioningState(HostProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the displayName property: Display name of the host in VMware vCenter. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the host in VMware vCenter. + * + * @param displayName the displayName value to set. + * @return the HostProperties object itself. + */ + HostProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the moRefId property: vCenter managed object reference ID of the host. + * + * @return the moRefId value. + */ + public String moRefId() { + return this.moRefId; + } + + /** + * Set the moRefId property: vCenter managed object reference ID of the host. + * + * @param moRefId the moRefId value to set. + * @return the HostProperties object itself. + */ + HostProperties withMoRefId(String moRefId) { + this.moRefId = moRefId; + return this; + } + + /** + * Get the fqdn property: Fully qualified domain name of the host. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: Fully qualified domain name of the host. + * + * @param fqdn the fqdn value to set. + * @return the HostProperties object itself. + */ + HostProperties withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the maintenance property: If provided, the host is in maintenance. The value is the reason for maintenance. + * + * @return the maintenance value. + */ + public HostMaintenance maintenance() { + return this.maintenance; + } + + /** + * Set the maintenance property: If provided, the host is in maintenance. The value is the reason for maintenance. + * + * @param maintenance the maintenance value to set. + * @return the HostProperties object itself. + */ + HostProperties withMaintenance(HostMaintenance maintenance) { + this.maintenance = maintenance; + return this; + } + + /** + * Get the faultDomain property: The faultDomain property. + * + * @return the faultDomain value. + */ + public String faultDomain() { + return this.faultDomain; + } + + /** + * Set the faultDomain property: The faultDomain property. + * + * @param faultDomain the faultDomain value to set. + * @return the HostProperties object itself. + */ + HostProperties withFaultDomain(String faultDomain) { + this.faultDomain = faultDomain; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("maintenance", this.maintenance == null ? null : this.maintenance.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HostProperties. + */ + public static HostProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("General".equals(discriminatorValue)) { + return GeneralHostProperties.fromJson(readerToUse.reset()); + } else if ("Specialized".equals(discriminatorValue)) { + return SpecializedHostProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static HostProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostProperties deserializedHostProperties = new HostProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedHostProperties.kind = HostKind.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedHostProperties.provisioningState = HostProvisioningState.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedHostProperties.displayName = reader.getString(); + } else if ("moRefId".equals(fieldName)) { + deserializedHostProperties.moRefId = reader.getString(); + } else if ("fqdn".equals(fieldName)) { + deserializedHostProperties.fqdn = reader.getString(); + } else if ("maintenance".equals(fieldName)) { + deserializedHostProperties.maintenance = HostMaintenance.fromString(reader.getString()); + } else if ("faultDomain".equals(fieldName)) { + deserializedHostProperties.faultDomain = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHostProperties; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostProvisioningState.java new file mode 100644 index 000000000000..9c6807591020 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * provisioning state of the host. + */ +public final class HostProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final HostProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final HostProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final HostProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of HostProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HostProvisioningState() { + } + + /** + * Creates or finds a HostProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding HostProvisioningState. + */ + public static HostProvisioningState fromString(String name) { + return fromString(name, HostProvisioningState.class); + } + + /** + * Gets known HostProvisioningState values. + * + * @return known HostProvisioningState values. + */ + public static Collection values() { + return values(HostProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Hosts.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Hosts.java new file mode 100644 index 000000000000..bffb1de579fe --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Hosts.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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 Hosts. + */ +public interface Hosts { + /** + * List Host resources by Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName); + + /** + * List Host resources by Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Host list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName, + Context context); + + /** + * Get a Host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @param hostId The host identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Host along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String privateCloudName, String clusterName, + String hostId, Context context); + + /** + * Get a Host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster. + * @param hostId The host identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Host. + */ + HostModel get(String resourceGroupName, String privateCloudName, String clusterName, String hostId); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java index 234c6af94168..e5bcdc6c737f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -27,7 +27,7 @@ public final class IdentitySource implements JsonSerializable { private String alias; /* - * The domain's dns name + * The domain's DNS name */ private String domain; @@ -115,7 +115,7 @@ public IdentitySource withAlias(String alias) { } /** - * Get the domain property: The domain's dns name. + * Get the domain property: The domain's DNS name. * * @return the domain value. */ @@ -124,7 +124,7 @@ public String domain() { } /** - * Set the domain property: The domain's dns name. + * Set the domain property: The domain's DNS name. * * @param domain the domain value to set. * @return the IdentitySource object itself. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/InternetEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/InternetEnum.java index 76d4420f91d0..609f324752f2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/InternetEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/InternetEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class InternetEnum extends ExpandableStringEnum { /** - * Static value Enabled for InternetEnum. + * is enabled. */ public static final InternetEnum ENABLED = fromString("Enabled"); /** - * Static value Disabled for InternetEnum. + * is disabled. */ public static final InternetEnum DISABLED = fromString("Disabled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPath.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPath.java index dbaa6e5efb25..706f1e380353 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPath.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPath.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; import com.azure.core.management.SystemData; +import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.IscsiPathInner; /** @@ -33,25 +34,25 @@ public interface IscsiPath { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the systemData value. + * @return the properties value. */ - SystemData systemData(); + IscsiPathProperties properties(); /** - * Gets the provisioningState property: The state of the iSCSI path provisioning. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the provisioningState value. + * @return the systemData value. */ - IscsiPathProvisioningState provisioningState(); + SystemData systemData(); /** - * Gets the networkBlock property: CIDR Block for iSCSI path. + * Gets the name of the resource group. * - * @return the networkBlock value. + * @return the name of the resource group. */ - String networkBlock(); + String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.avs.fluent.models.IscsiPathInner object. @@ -59,4 +60,130 @@ public interface IscsiPath { * @return the inner object. */ IscsiPathInner innerModel(); + + /** + * The entirety of the IscsiPath definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The IscsiPath definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the IscsiPath definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the IscsiPath definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + + /** + * The stage of the IscsiPath 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + IscsiPath create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IscsiPath create(Context context); + } + + /** + * The stage of the IscsiPath definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(IscsiPathProperties properties); + } + } + + /** + * Begins update for the IscsiPath resource. + * + * @return the stage of resource update. + */ + IscsiPath.Update update(); + + /** + * The template for IscsiPath update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IscsiPath apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IscsiPath apply(Context context); + } + + /** + * The IscsiPath update stages. + */ + interface UpdateStages { + /** + * The stage of the IscsiPath update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(IscsiPathProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IscsiPath refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IscsiPath refresh(Context context); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPathProperties.java similarity index 95% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPathProperties.java index 5d0f1edd87bb..a49abef6857a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPathProperties.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; @@ -10,7 +10,6 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.IscsiPathProvisioningState; import java.io.IOException; /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPathProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPathProvisioningState.java index 85e5901ae8ca..4a130bae3a87 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPathProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPathProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,37 +12,37 @@ */ public final class IscsiPathProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for IscsiPathProvisioningState. + * Resource has been created. */ public static final IscsiPathProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for IscsiPathProvisioningState. + * Resource creation failed. */ public static final IscsiPathProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for IscsiPathProvisioningState. + * Resource creation was canceled. */ public static final IscsiPathProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Pending for IscsiPathProvisioningState. + * is pending. */ public static final IscsiPathProvisioningState PENDING = fromString("Pending"); /** - * Static value Building for IscsiPathProvisioningState. + * is building. */ public static final IscsiPathProvisioningState BUILDING = fromString("Building"); /** - * Static value Deleting for IscsiPathProvisioningState. + * is deleting. */ public static final IscsiPathProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for IscsiPathProvisioningState. + * is updating. */ public static final IscsiPathProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPaths.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPaths.java index c4cb34ba241c..99731a7191ff 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPaths.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IscsiPaths.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.avs.fluent.models.IscsiPathInner; /** * Resource collection API of IscsiPaths. @@ -43,74 +42,103 @@ public interface IscsiPaths { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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 a IscsiPath along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String privateCloudName, Context context); + Response getWithResponse(String resourceGroupName, String privateCloudName, String iscsiPathName, + Context context); /** * Get a IscsiPath. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param iscsiPathName Name of the iSCSI path 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 a IscsiPath. */ - IscsiPath get(String resourceGroupName, String privateCloudName); + IscsiPath get(String resourceGroupName, String privateCloudName, String iscsiPathName); /** - * Create a IscsiPath. + * Delete a IscsiPath. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param resource Resource create parameters. + * @param iscsiPathName Name of the iSCSI path 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 an iSCSI path resource. */ - IscsiPath createOrUpdate(String resourceGroupName, String privateCloudName, IscsiPathInner resource); + void delete(String resourceGroupName, String privateCloudName, String iscsiPathName); /** - * Create a IscsiPath. + * Delete a IscsiPath. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param resource Resource create parameters. + * @param iscsiPathName Name of the iSCSI path 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 an iSCSI path resource. */ - IscsiPath createOrUpdate(String resourceGroupName, String privateCloudName, IscsiPathInner resource, - Context context); + void delete(String resourceGroupName, String privateCloudName, String iscsiPathName, Context context); + + /** + * Get a IscsiPath. + * + * @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 IscsiPath along with {@link Response}. + */ + IscsiPath getById(String id); + + /** + * Get a IscsiPath. + * + * @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 IscsiPath along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); /** * Delete a IscsiPath. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. + * @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 deleteByResourceGroup(String resourceGroupName, String privateCloudName); + void deleteById(String id); /** * Delete a IscsiPath. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateCloudName Name of the private cloud. + * @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 delete(String resourceGroupName, String privateCloudName, Context context); + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IscsiPath resource. + * + * @param name resource name. + * @return the first stage of the new IscsiPath definition. + */ + IscsiPath.DefinitionStages.Blank define(String name); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Locations.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Locations.java index 1fdd347f62d2..c3a58e0e221d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Locations.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Locations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,49 +12,49 @@ */ public interface Locations { /** - * Return quota for subscription by region. + * Return trial status for subscription by region. * - * @param location The name of the Azure region. + * @param location A location in a subscription. + * @param sku Optionally, check for a specific 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 subscription quotas along with {@link Response}. + * @return subscription trial availability along with {@link Response}. */ - Response checkQuotaAvailabilityWithResponse(String location, Context context); + Response checkTrialAvailabilityWithResponse(String location, Sku sku, Context context); /** - * Return quota for subscription by region. + * Return trial status for subscription by region. * - * @param location The name of the Azure region. + * @param location A location in a subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription quotas. + * @return subscription trial availability. */ - Quota checkQuotaAvailability(String location); + Trial checkTrialAvailability(String location); /** - * Return trial status for subscription by region. + * Return quota for subscription by region. * - * @param location The name of the Azure region. - * @param sku Optionally, check for a specific SKU. + * @param location A location in a subscription. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription trial availability along with {@link Response}. + * @return subscription quotas along with {@link Response}. */ - Response checkTrialAvailabilityWithResponse(String location, Sku sku, Context context); + Response checkQuotaAvailabilityWithResponse(String location, Context context); /** - * Return trial status for subscription by region. + * Return quota for subscription by region. * - * @param location The name of the Azure region. + * @param location A location in a subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription trial availability. + * @return subscription quotas. */ - Trial checkTrialAvailability(String location); + Quota checkQuotaAvailability(String location); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ManagementCluster.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ManagementCluster.java index bd7ec5e775ad..b0e733323159 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ManagementCluster.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ManagementCluster.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MountOptionEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MountOptionEnum.java index 3e70266ef897..fa020a1ca462 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MountOptionEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MountOptionEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -8,17 +8,16 @@ import java.util.Collection; /** - * Mode that describes whether the LUN has to be mounted as a datastore or - * attached as a LUN. + * mount option. */ public final class MountOptionEnum extends ExpandableStringEnum { /** - * Static value MOUNT for MountOptionEnum. + * is mount. */ public static final MountOptionEnum MOUNT = fromString("MOUNT"); /** - * Static value ATTACH for MountOptionEnum. + * is attach. */ public static final MountOptionEnum ATTACH = fromString("ATTACH"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NetAppVolume.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NetAppVolume.java index 5c95e4bc5a16..7565084f5305 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NetAppVolume.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NetAppVolume.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NsxPublicIpQuotaRaisedEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NsxPublicIpQuotaRaisedEnum.java index b78ba037eee1..03b306dd15cf 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NsxPublicIpQuotaRaisedEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NsxPublicIpQuotaRaisedEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class NsxPublicIpQuotaRaisedEnum extends ExpandableStringEnum { /** - * Static value Enabled for NsxPublicIpQuotaRaisedEnum. + * is enabled. */ public static final NsxPublicIpQuotaRaisedEnum ENABLED = fromString("Enabled"); /** - * Static value Disabled for NsxPublicIpQuotaRaisedEnum. + * is disabled. */ public static final NsxPublicIpQuotaRaisedEnum DISABLED = fromString("Disabled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Operation.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Operation.java index 2fc37eedfbca..31958ed9fe51 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Operation.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -20,7 +20,7 @@ public interface Operation { /** * 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. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -42,8 +42,8 @@ public interface Operation { Origin origin(); /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationDisplay.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationDisplay.java index 5ca4a2fb5397..26a189b906e4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationDisplay.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationDisplay.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,7 +12,7 @@ import java.io.IOException; /** - * Localized display information for this particular operation. + * Localized display information for and operation. */ @Immutable public final class OperationDisplay implements JsonSerializable { @@ -42,7 +42,7 @@ public final class OperationDisplay implements JsonSerializable { /** - * Static value Optional for OptionalParamEnum. + * is optional. */ public static final OptionalParamEnum OPTIONAL = fromString("Optional"); /** - * Static value Required for OptionalParamEnum. + * is required. */ public static final OptionalParamEnum REQUIRED = fromString("Required"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Origin.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Origin.java index 17cf52b98dc2..2e1c97d11992 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Origin.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Origin.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -13,17 +13,17 @@ */ public final class Origin extends ExpandableStringEnum { /** - * Static value user for Origin. + * Indicates the operation is initiated by a user. */ public static final Origin USER = fromString("user"); /** - * Static value system for Origin. + * Indicates the operation is initiated by a system. */ public static final Origin SYSTEM = fromString("system"); /** - * Static value user,system for Origin. + * Indicates the operation is initiated by a user or system. */ public static final Origin USER_SYSTEM = fromString("user,system"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PSCredentialExecutionParameter.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PSCredentialExecutionParameter.java index aa7accf73a10..e247a66552c7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PSCredentialExecutionParameter.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PSCredentialExecutionParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicies.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicies.java index feb1138cf5df..e21ed3848ed0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicies.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicies.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicy.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicy.java index 917a680a50de..835f15a34754 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicy.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyProperties.java index 2fe347e6e411..f932a1ea692a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -155,10 +155,10 @@ public static PlacementPolicyProperties fromJson(JsonReader jsonReader) throws I } } // Use the discriminator value to determine which subtype should be deserialized. - if ("VmHost".equals(discriminatorValue)) { - return VmHostPlacementPolicyProperties.fromJson(readerToUse.reset()); - } else if ("VmVm".equals(discriminatorValue)) { + if ("VmVm".equals(discriminatorValue)) { return VmPlacementPolicyProperties.fromJson(readerToUse.reset()); + } else if ("VmHost".equals(discriminatorValue)) { + return VmHostPlacementPolicyProperties.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyProvisioningState.java index 4f226ef469a5..716e64eae96c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,32 +12,32 @@ */ public final class PlacementPolicyProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for PlacementPolicyProvisioningState. + * Resource has been created. */ public static final PlacementPolicyProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for PlacementPolicyProvisioningState. + * Resource creation failed. */ public static final PlacementPolicyProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for PlacementPolicyProvisioningState. + * Resource creation was canceled. */ public static final PlacementPolicyProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Building for PlacementPolicyProvisioningState. + * is building. */ public static final PlacementPolicyProvisioningState BUILDING = fromString("Building"); /** - * Static value Deleting for PlacementPolicyProvisioningState. + * is deleting. */ public static final PlacementPolicyProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for PlacementPolicyProvisioningState. + * is updating. */ public static final PlacementPolicyProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyState.java index 25a0b4a98087..29bc6eb3a6fc 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class PlacementPolicyState extends ExpandableStringEnum { /** - * Static value Enabled for PlacementPolicyState. + * is enabled. */ public static final PlacementPolicyState ENABLED = fromString("Enabled"); /** - * Static value Disabled for PlacementPolicyState. + * is disabled. */ public static final PlacementPolicyState DISABLED = fromString("Disabled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyType.java index 9c6ae52e26e6..6ea8a21eeb35 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyType.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyUpdate.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyUpdate.java index 4f8cea6f431c..bc1dbaf142f9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyUpdate.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PlacementPolicyUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringDirectionEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringDirectionEnum.java index d94640d2cc2a..4f6a8baee2f1 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringDirectionEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringDirectionEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,17 +12,17 @@ */ public final class PortMirroringDirectionEnum extends ExpandableStringEnum { /** - * Static value INGRESS for PortMirroringDirectionEnum. + * is ingress. */ public static final PortMirroringDirectionEnum INGRESS = fromString("INGRESS"); /** - * Static value EGRESS for PortMirroringDirectionEnum. + * is egress. */ public static final PortMirroringDirectionEnum EGRESS = fromString("EGRESS"); /** - * Static value BIDIRECTIONAL for PortMirroringDirectionEnum. + * is bidirectional. */ public static final PortMirroringDirectionEnum BIDIRECTIONAL = fromString("BIDIRECTIONAL"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringStatusEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringStatusEnum.java index a3008c41d883..2c67ca05a7cf 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringStatusEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringStatusEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class PortMirroringStatusEnum extends ExpandableStringEnum { /** - * Static value SUCCESS for PortMirroringStatusEnum. + * is success. */ public static final PortMirroringStatusEnum SUCCESS = fromString("SUCCESS"); /** - * Static value FAILURE for PortMirroringStatusEnum. + * is failure. */ public static final PortMirroringStatusEnum FAILURE = fromString("FAILURE"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java index 39ac04103874..fd79ffe7e9da 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -51,6 +51,13 @@ public interface PrivateCloud { */ Map tags(); + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + PrivateCloudProperties properties(); + /** * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * @@ -66,174 +73,18 @@ public interface PrivateCloud { PrivateCloudIdentity identity(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the managementCluster property: The default cluster used for management. - * - * @return the managementCluster value. - */ - ManagementCluster managementCluster(); - - /** - * Gets the internet property: Connectivity to internet is enabled or disabled. - * - * @return the internet value. - */ - InternetEnum internet(); - - /** - * Gets the identitySources property: vCenter Single Sign On Identity Sources. - * - * @return the identitySources value. - */ - List identitySources(); - - /** - * Gets the availability property: Properties describing how the cloud is distributed across availability zones. - * - * @return the availability value. - */ - AvailabilityProperties availability(); - - /** - * Gets the encryption property: Customer managed key encryption, can be enabled or disabled. - * - * @return the encryption value. - */ - Encryption encryption(); - - /** - * Gets the extendedNetworkBlocks property: Array of additional networks noncontiguous with networkBlock. Networks - * must be - * unique and non-overlapping across VNet in your subscription, on-premise, and - * this privateCloud networkBlock attribute. Make sure the CIDR format conforms to - * (A.B.C.D/X). + * Gets the zones property: The availability zones. * - * @return the extendedNetworkBlocks value. + * @return the zones value. */ - List extendedNetworkBlocks(); + List zones(); /** - * Gets the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - PrivateCloudProvisioningState provisioningState(); - - /** - * Gets the circuit property: An ExpressRoute Circuit. - * - * @return the circuit value. - */ - Circuit circuit(); - - /** - * Gets the endpoints property: The endpoints. - * - * @return the endpoints value. - */ - Endpoints endpoints(); - - /** - * Gets the networkBlock property: The block of addresses should be unique across VNet in your subscription as - * well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where - * A,B,C,D are between 0 and 255, and X is between 0 and 22. - * - * @return the networkBlock value. - */ - String networkBlock(); - - /** - * Gets the managementNetwork property: Network used to access vCenter Server and NSX-T Manager. - * - * @return the managementNetwork value. - */ - String managementNetwork(); - - /** - * Gets the provisioningNetwork property: Used for virtual machine cold migration, cloning, and snapshot migration. - * - * @return the provisioningNetwork value. - */ - String provisioningNetwork(); - - /** - * Gets the vmotionNetwork property: Used for live migration of virtual machines. - * - * @return the vmotionNetwork value. - */ - String vmotionNetwork(); - - /** - * Gets the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud is created. - * - * @return the vcenterPassword value. - */ - String vcenterPassword(); - - /** - * Gets the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is created. - * - * @return the nsxtPassword value. - */ - String nsxtPassword(); - - /** - * Gets the vcenterCertificateThumbprint property: Thumbprint of the vCenter Server SSL certificate. - * - * @return the vcenterCertificateThumbprint value. - */ - String vcenterCertificateThumbprint(); - - /** - * Gets the nsxtCertificateThumbprint property: Thumbprint of the NSX-T Manager SSL certificate. - * - * @return the nsxtCertificateThumbprint value. - */ - String nsxtCertificateThumbprint(); - - /** - * Gets the externalCloudLinks property: Array of cloud link IDs from other clouds that connect to this one. - * - * @return the externalCloudLinks value. - */ - List externalCloudLinks(); - - /** - * Gets the secondaryCircuit property: A secondary expressRoute circuit from a separate AZ. Only present in a - * stretched private cloud. - * - * @return the secondaryCircuit value. - */ - Circuit secondaryCircuit(); - - /** - * Gets the nsxPublicIpQuotaRaised property: Flag to indicate whether the private cloud has the quota for - * provisioned NSX - * Public IP count raised from 64 to 1024. - * - * @return the nsxPublicIpQuotaRaised value. - */ - NsxPublicIpQuotaRaisedEnum nsxPublicIpQuotaRaised(); - - /** - * Gets the virtualNetworkId property: Azure resource ID of the virtual network. - * - * @return the virtualNetworkId value. - */ - String virtualNetworkId(); - - /** - * Gets the dnsZoneType property: The type of DNS zone to use. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the dnsZoneType value. + * @return the systemData value. */ - DnsZoneType dnsZoneType(); + SystemData systemData(); /** * Gets the region of the resource. @@ -331,13 +182,8 @@ interface WithSku { * The stage of the PrivateCloud 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.WithIdentity, DefinitionStages.WithManagementCluster, - DefinitionStages.WithInternet, DefinitionStages.WithIdentitySources, DefinitionStages.WithAvailability, - DefinitionStages.WithEncryption, DefinitionStages.WithExtendedNetworkBlocks, DefinitionStages.WithCircuit, - DefinitionStages.WithNetworkBlock, DefinitionStages.WithVcenterPassword, DefinitionStages.WithNsxtPassword, - DefinitionStages.WithSecondaryCircuit, DefinitionStages.WithVirtualNetworkId, - DefinitionStages.WithDnsZoneType { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties, + DefinitionStages.WithIdentity, DefinitionStages.WithZones { /** * Executes the create request. * @@ -368,204 +214,42 @@ interface WithTags { } /** - * The stage of the PrivateCloud definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The managed service identities assigned to this resource.. - * - * @param identity The managed service identities assigned to this resource. - * @return the next definition stage. - */ - WithCreate withIdentity(PrivateCloudIdentity identity); - } - - /** - * The stage of the PrivateCloud definition allowing to specify managementCluster. - */ - interface WithManagementCluster { - /** - * Specifies the managementCluster property: The default cluster used for management. - * - * @param managementCluster The default cluster used for management. - * @return the next definition stage. - */ - WithCreate withManagementCluster(ManagementCluster managementCluster); - } - - /** - * The stage of the PrivateCloud definition allowing to specify internet. - */ - interface WithInternet { - /** - * Specifies the internet property: Connectivity to internet is enabled or disabled. - * - * @param internet Connectivity to internet is enabled or disabled. - * @return the next definition stage. - */ - WithCreate withInternet(InternetEnum internet); - } - - /** - * The stage of the PrivateCloud definition allowing to specify identitySources. - */ - interface WithIdentitySources { - /** - * Specifies the identitySources property: vCenter Single Sign On Identity Sources. - * - * @param identitySources vCenter Single Sign On Identity Sources. - * @return the next definition stage. - */ - WithCreate withIdentitySources(List identitySources); - } - - /** - * The stage of the PrivateCloud definition allowing to specify availability. - */ - interface WithAvailability { - /** - * Specifies the availability property: Properties describing how the cloud is distributed across - * availability zones. - * - * @param availability Properties describing how the cloud is distributed across availability zones. - * @return the next definition stage. - */ - WithCreate withAvailability(AvailabilityProperties availability); - } - - /** - * The stage of the PrivateCloud definition allowing to specify encryption. - */ - interface WithEncryption { - /** - * Specifies the encryption property: Customer managed key encryption, can be enabled or disabled. - * - * @param encryption Customer managed key encryption, can be enabled or disabled. - * @return the next definition stage. - */ - WithCreate withEncryption(Encryption encryption); - } - - /** - * The stage of the PrivateCloud definition allowing to specify extendedNetworkBlocks. + * The stage of the PrivateCloud definition allowing to specify properties. */ - interface WithExtendedNetworkBlocks { + interface WithProperties { /** - * Specifies the extendedNetworkBlocks property: Array of additional networks noncontiguous with - * networkBlock. Networks must be - * unique and non-overlapping across VNet in your subscription, on-premise, and - * this privateCloud networkBlock attribute. Make sure the CIDR format conforms to - * (A.B.C.D/X).. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param extendedNetworkBlocks Array of additional networks noncontiguous with networkBlock. Networks must - * be - * unique and non-overlapping across VNet in your subscription, on-premise, and - * this privateCloud networkBlock attribute. Make sure the CIDR format conforms to - * (A.B.C.D/X). + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withExtendedNetworkBlocks(List extendedNetworkBlocks); + WithCreate withProperties(PrivateCloudProperties properties); } /** - * The stage of the PrivateCloud definition allowing to specify circuit. - */ - interface WithCircuit { - /** - * Specifies the circuit property: An ExpressRoute Circuit. - * - * @param circuit An ExpressRoute Circuit. - * @return the next definition stage. - */ - WithCreate withCircuit(Circuit circuit); - } - - /** - * The stage of the PrivateCloud definition allowing to specify networkBlock. - */ - interface WithNetworkBlock { - /** - * Specifies the networkBlock property: The block of addresses should be unique across VNet in your - * subscription as - * well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where - * A,B,C,D are between 0 and 255, and X is between 0 and 22. - * - * @param networkBlock The block of addresses should be unique across VNet in your subscription as - * well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where - * A,B,C,D are between 0 and 255, and X is between 0 and 22. - * @return the next definition stage. - */ - WithCreate withNetworkBlock(String networkBlock); - } - - /** - * The stage of the PrivateCloud definition allowing to specify vcenterPassword. - */ - interface WithVcenterPassword { - /** - * Specifies the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud - * is created. - * - * @param vcenterPassword Optionally, set the vCenter admin password when the private cloud is created. - * @return the next definition stage. - */ - WithCreate withVcenterPassword(String vcenterPassword); - } - - /** - * The stage of the PrivateCloud definition allowing to specify nsxtPassword. - */ - interface WithNsxtPassword { - /** - * Specifies the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is - * created. - * - * @param nsxtPassword Optionally, set the NSX-T Manager password when the private cloud is created. - * @return the next definition stage. - */ - WithCreate withNsxtPassword(String nsxtPassword); - } - - /** - * The stage of the PrivateCloud definition allowing to specify secondaryCircuit. + * The stage of the PrivateCloud definition allowing to specify identity. */ - interface WithSecondaryCircuit { + interface WithIdentity { /** - * Specifies the secondaryCircuit property: A secondary expressRoute circuit from a separate AZ. Only - * present in a - * stretched private cloud. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param secondaryCircuit A secondary expressRoute circuit from a separate AZ. Only present in a - * stretched private cloud. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ - WithCreate withSecondaryCircuit(Circuit secondaryCircuit); + WithCreate withIdentity(PrivateCloudIdentity identity); } /** - * The stage of the PrivateCloud definition allowing to specify virtualNetworkId. + * The stage of the PrivateCloud definition allowing to specify zones. */ - interface WithVirtualNetworkId { + interface WithZones { /** - * Specifies the virtualNetworkId property: Azure resource ID of the virtual network. + * Specifies the zones property: The availability zones.. * - * @param virtualNetworkId Azure resource ID of the virtual network. + * @param zones The availability zones. * @return the next definition stage. */ - WithCreate withVirtualNetworkId(String virtualNetworkId); - } - - /** - * The stage of the PrivateCloud definition allowing to specify dnsZoneType. - */ - interface WithDnsZoneType { - /** - * Specifies the dnsZoneType property: The type of DNS zone to use.. - * - * @param dnsZoneType The type of DNS zone to use. - * @return the next definition stage. - */ - WithCreate withDnsZoneType(DnsZoneType dnsZoneType); + WithCreate withZones(List zones); } } @@ -744,24 +428,22 @@ interface WithDnsZoneType { PrivateCloud refresh(Context context); /** - * List the admin credentials for the private cloud. + * Rotate the vCenter password. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return administrative credentials for accessing vCenter and NSX-T along with {@link Response}. */ - Response listAdminCredentialsWithResponse(Context context); + void rotateVcenterPassword(); /** - * List the admin credentials for the private cloud. + * Rotate the vCenter password. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return administrative credentials for accessing vCenter and NSX-T. */ - AdminCredentials listAdminCredentials(); + void rotateVcenterPassword(Context context); /** * Rotate the NSX-T Manager password. @@ -782,20 +464,22 @@ interface WithDnsZoneType { void rotateNsxtPassword(Context context); /** - * Rotate the vCenter password. + * List the admin credentials for the private cloud. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T along with {@link Response}. */ - void rotateVcenterPassword(); + Response listAdminCredentialsWithResponse(Context context); /** - * Rotate the vCenter password. + * List the admin credentials for the private cloud. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. */ - void rotateVcenterPassword(Context context); + AdminCredentials listAdminCredentials(); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudIdentity.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudIdentity.java index 465e1fc66bb5..ee11984302f2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudIdentity.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -30,9 +30,9 @@ public final class PrivateCloudIdentity implements JsonSerializable { /** - * Static value Succeeded for PrivateCloudProvisioningState. + * Resource has been created. */ public static final PrivateCloudProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for PrivateCloudProvisioningState. + * Resource creation failed. */ public static final PrivateCloudProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for PrivateCloudProvisioningState. + * Resource creation was canceled. */ public static final PrivateCloudProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Cancelled for PrivateCloudProvisioningState. + * is cancelled. */ public static final PrivateCloudProvisioningState CANCELLED = fromString("Cancelled"); /** - * Static value Pending for PrivateCloudProvisioningState. + * is pending. */ public static final PrivateCloudProvisioningState PENDING = fromString("Pending"); /** - * Static value Building for PrivateCloudProvisioningState. + * is building. */ public static final PrivateCloudProvisioningState BUILDING = fromString("Building"); /** - * Static value Deleting for PrivateCloudProvisioningState. + * is deleting. */ public static final PrivateCloudProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for PrivateCloudProvisioningState. + * is updating. */ public static final PrivateCloudProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdate.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdate.java index c5565dde830a..7c9642789be9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdate.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateClouds.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateClouds.java index 154f89ed1c4a..f0030b9ca740 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateClouds.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateClouds.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -13,47 +13,47 @@ */ public interface PrivateClouds { /** - * List PrivateCloud resources by subscription ID. + * List PrivateCloud resources by 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 the response of a PrivateCloud list operation as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * List PrivateCloud resources by subscription ID. + * List PrivateCloud resources by 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 the response of a PrivateCloud list operation as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * List PrivateCloud resources by resource group. + * List PrivateCloud resources by subscription ID. * - * @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 the response of a PrivateCloud list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable list(); /** - * List PrivateCloud resources by resource group. + * List PrivateCloud resources by subscription ID. * - * @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 the response of a PrivateCloud list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable list(Context context); /** * Get a PrivateCloud. @@ -105,30 +105,27 @@ Response getByResourceGroupWithResponse(String resourceGroupName, void delete(String resourceGroupName, String privateCloudName, Context context); /** - * List the admin credentials for the private cloud. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return administrative credentials for accessing vCenter and NSX-T along with {@link Response}. */ - Response listAdminCredentialsWithResponse(String resourceGroupName, String privateCloudName, - Context context); + void rotateVcenterPassword(String resourceGroupName, String privateCloudName); /** - * List the admin credentials for the private cloud. + * Rotate the vCenter password. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return administrative credentials for accessing vCenter and NSX-T. */ - AdminCredentials listAdminCredentials(String resourceGroupName, String privateCloudName); + void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context); /** * Rotate the NSX-T Manager password. @@ -154,27 +151,30 @@ Response listAdminCredentialsWithResponse(String resourceGroup void rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context); /** - * Rotate the vCenter password. + * List the admin credentials for the private cloud. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T along with {@link Response}. */ - void rotateVcenterPassword(String resourceGroupName, String privateCloudName); + Response listAdminCredentialsWithResponse(String resourceGroupName, String privateCloudName, + Context context); /** - * Rotate the vCenter password. + * List the admin credentials for the private cloud. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. */ - void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context); + AdminCredentials listAdminCredentials(String resourceGroupName, String privateCloudName); /** * Get a PrivateCloud. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetwork.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetwork.java new file mode 100644 index 000000000000..62124b6145d8 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetwork.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.avs.fluent.models.ProvisionedNetworkInner; + +/** + * An immutable client-side representation of ProvisionedNetwork. + */ +public interface ProvisionedNetwork { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ProvisionedNetworkProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.ProvisionedNetworkInner object. + * + * @return the inner object. + */ + ProvisionedNetworkInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworkProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworkProperties.java new file mode 100644 index 000000000000..1bbf70a3612c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworkProperties.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of a provisioned network. + */ +@Immutable +public final class ProvisionedNetworkProperties implements JsonSerializable { + /* + * The provisioning state of the resource. + */ + private ProvisionedNetworkProvisioningState provisioningState; + + /* + * The address prefixes of the provisioned network in CIDR notation. + */ + private String addressPrefix; + + /* + * The type of network provisioned. + */ + private ProvisionedNetworkTypes networkType; + + /** + * Creates an instance of ProvisionedNetworkProperties class. + */ + private ProvisionedNetworkProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisionedNetworkProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the addressPrefix property: The address prefixes of the provisioned network in CIDR notation. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Get the networkType property: The type of network provisioned. + * + * @return the networkType value. + */ + public ProvisionedNetworkTypes networkType() { + return this.networkType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisionedNetworkProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisionedNetworkProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProvisionedNetworkProperties. + */ + public static ProvisionedNetworkProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisionedNetworkProperties deserializedProvisionedNetworkProperties = new ProvisionedNetworkProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedProvisionedNetworkProperties.provisioningState + = ProvisionedNetworkProvisioningState.fromString(reader.getString()); + } else if ("addressPrefix".equals(fieldName)) { + deserializedProvisionedNetworkProperties.addressPrefix = reader.getString(); + } else if ("networkType".equals(fieldName)) { + deserializedProvisionedNetworkProperties.networkType + = ProvisionedNetworkTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedProvisionedNetworkProperties; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworkProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworkProvisioningState.java new file mode 100644 index 000000000000..d59a98f16637 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworkProvisioningState.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * provisioned network provisioning state. + */ +public final class ProvisionedNetworkProvisioningState + extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ProvisionedNetworkProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ProvisionedNetworkProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ProvisionedNetworkProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ProvisionedNetworkProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisionedNetworkProvisioningState() { + } + + /** + * Creates or finds a ProvisionedNetworkProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisionedNetworkProvisioningState. + */ + public static ProvisionedNetworkProvisioningState fromString(String name) { + return fromString(name, ProvisionedNetworkProvisioningState.class); + } + + /** + * Gets known ProvisionedNetworkProvisioningState values. + * + * @return known ProvisionedNetworkProvisioningState values. + */ + public static Collection values() { + return values(ProvisionedNetworkProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworkTypes.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworkTypes.java new file mode 100644 index 000000000000..a603ec16d6c4 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworkTypes.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of network provisioned. + */ +public final class ProvisionedNetworkTypes extends ExpandableStringEnum { + /** + * network for ESX management. + */ + public static final ProvisionedNetworkTypes ESX_MANAGEMENT = fromString("esxManagement"); + + /** + * network for ESX replication. + */ + public static final ProvisionedNetworkTypes ESX_REPLICATION = fromString("esxReplication"); + + /** + * network for HCX management. + */ + public static final ProvisionedNetworkTypes HCX_MANAGEMENT = fromString("hcxManagement"); + + /** + * network for HCX uplink. + */ + public static final ProvisionedNetworkTypes HCX_UPLINK = fromString("hcxUplink"); + + /** + * network for vCenter management. + */ + public static final ProvisionedNetworkTypes VCENTER_MANAGEMENT = fromString("vcenterManagement"); + + /** + * network for vmotion. + */ + public static final ProvisionedNetworkTypes VMOTION = fromString("vmotion"); + + /** + * network for vsan. + */ + public static final ProvisionedNetworkTypes VSAN = fromString("vsan"); + + /** + * Creates a new instance of ProvisionedNetworkTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisionedNetworkTypes() { + } + + /** + * Creates or finds a ProvisionedNetworkTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisionedNetworkTypes. + */ + public static ProvisionedNetworkTypes fromString(String name) { + return fromString(name, ProvisionedNetworkTypes.class); + } + + /** + * Gets known ProvisionedNetworkTypes values. + * + * @return known ProvisionedNetworkTypes values. + */ + public static Collection values() { + return values(ProvisionedNetworkTypes.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworks.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworks.java new file mode 100644 index 000000000000..d35b9976359b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ProvisionedNetworks.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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 ProvisionedNetworks. + */ +public interface ProvisionedNetworks { + /** + * List ProvisionedNetwork resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List ProvisionedNetwork resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ProvisionedNetwork list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a ProvisionedNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param provisionedNetworkName Name of the cloud link. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 ProvisionedNetwork along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String privateCloudName, + String provisionedNetworkName, Context context); + + /** + * Get a ProvisionedNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param provisionedNetworkName Name of the cloud link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 ProvisionedNetwork. + */ + ProvisionedNetwork get(String resourceGroupName, String privateCloudName, String provisionedNetworkName); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PureStorageVolume.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PureStorageVolume.java new file mode 100644 index 000000000000..a76e05c6b9f9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PureStorageVolume.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A Pure Storage volume from PureStorage.Block provider. + */ +@Fluent +public final class PureStorageVolume implements JsonSerializable { + /* + * Azure resource ID of the Pure Storage Pool + */ + private String storagePoolId; + + /* + * Volume size to be used to create a Virtual Volumes (vVols) datastore + */ + private int sizeGb; + + /** + * Creates an instance of PureStorageVolume class. + */ + public PureStorageVolume() { + } + + /** + * Get the storagePoolId property: Azure resource ID of the Pure Storage Pool. + * + * @return the storagePoolId value. + */ + public String storagePoolId() { + return this.storagePoolId; + } + + /** + * Set the storagePoolId property: Azure resource ID of the Pure Storage Pool. + * + * @param storagePoolId the storagePoolId value to set. + * @return the PureStorageVolume object itself. + */ + public PureStorageVolume withStoragePoolId(String storagePoolId) { + this.storagePoolId = storagePoolId; + return this; + } + + /** + * Get the sizeGb property: Volume size to be used to create a Virtual Volumes (vVols) datastore. + * + * @return the sizeGb value. + */ + public int sizeGb() { + return this.sizeGb; + } + + /** + * Set the sizeGb property: Volume size to be used to create a Virtual Volumes (vVols) datastore. + * + * @param sizeGb the sizeGb value to set. + * @return the PureStorageVolume object itself. + */ + public PureStorageVolume withSizeGb(int sizeGb) { + this.sizeGb = sizeGb; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storagePoolId() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property storagePoolId in model PureStorageVolume")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PureStorageVolume.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storagePoolId", this.storagePoolId); + jsonWriter.writeIntField("sizeGb", this.sizeGb); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PureStorageVolume from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PureStorageVolume if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PureStorageVolume. + */ + public static PureStorageVolume fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PureStorageVolume deserializedPureStorageVolume = new PureStorageVolume(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storagePoolId".equals(fieldName)) { + deserializedPureStorageVolume.storagePoolId = reader.getString(); + } else if ("sizeGb".equals(fieldName)) { + deserializedPureStorageVolume.sizeGb = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedPureStorageVolume; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Quota.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Quota.java index 94130208877f..af821a066aff 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Quota.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Quota.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/QuotaEnabled.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/QuotaEnabled.java index a042b39d46fa..5812a83762b0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/QuotaEnabled.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/QuotaEnabled.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class QuotaEnabled extends ExpandableStringEnum { /** - * Static value Enabled for QuotaEnabled. + * is enabled. */ public static final QuotaEnabled ENABLED = fromString("Enabled"); /** - * Static value Disabled for QuotaEnabled. + * is disabled. */ public static final QuotaEnabled DISABLED = fromString("Disabled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceIdentityType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceIdentityType.java deleted file mode 100644 index 2d09e96f51e4..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceIdentityType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of managed service identity (either system assigned, or none). - */ -public final class ResourceIdentityType extends ExpandableStringEnum { - /** - * Static value None for ResourceIdentityType. - */ - public static final ResourceIdentityType NONE = fromString("None"); - - /** - * Static value SystemAssigned for ResourceIdentityType. - */ - public static final ResourceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - - /** - * Creates a new instance of ResourceIdentityType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ResourceIdentityType() { - } - - /** - * Creates or finds a ResourceIdentityType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ResourceIdentityType. - */ - public static ResourceIdentityType fromString(String name) { - return fromString(name, ResourceIdentityType.class); - } - - /** - * Gets known ResourceIdentityType values. - * - * @return known ResourceIdentityType values. - */ - public static Collection values() { - return values(ResourceIdentityType.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSku.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSku.java new file mode 100644 index 000000000000..c491b4f40e28 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSku.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.resourcemanager.avs.fluent.models.ResourceSkuInner; +import java.util.List; + +/** + * An immutable client-side representation of ResourceSku. + */ +public interface ResourceSku { + /** + * Gets the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + ResourceSkuResourceType resourceType(); + + /** + * Gets the name property: The name of the SKU. + * + * @return the name value. + */ + String name(); + + /** + * Gets the tier property: The tier of virtual machines in a scale set. + * + * @return the tier value. + */ + String tier(); + + /** + * Gets the size property: The size of the SKU. + * + * @return the size value. + */ + String size(); + + /** + * Gets the family property: The family of the SKU. + * + * @return the family value. + */ + String family(); + + /** + * Gets the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the locationInfo property: A list of locations and availability zones in those locations where the SKU is + * available. + * + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * Gets the capabilities property: Name value pairs to describe the capability. + * + * @return the capabilities value. + */ + List capabilities(); + + /** + * Gets the restrictions property: The restrictions of the SKU. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.ResourceSkuInner object. + * + * @return the inner object. + */ + ResourceSkuInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuCapabilities.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuCapabilities.java new file mode 100644 index 000000000000..7e269a67c6fd --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuCapabilities.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes The SKU capabilities object. + */ +@Immutable +public final class ResourceSkuCapabilities implements JsonSerializable { + /* + * The name of the SKU capability. + */ + private String name; + + /* + * The value of the SKU capability. + */ + private String value; + + /** + * Creates an instance of ResourceSkuCapabilities class. + */ + private ResourceSkuCapabilities() { + } + + /** + * Get the name property: The name of the SKU capability. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: The value of the SKU capability. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model ResourceSkuCapabilities")); + } + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ResourceSkuCapabilities")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceSkuCapabilities.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSkuCapabilities from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSkuCapabilities if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceSkuCapabilities. + */ + public static ResourceSkuCapabilities fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSkuCapabilities deserializedResourceSkuCapabilities = new ResourceSkuCapabilities(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedResourceSkuCapabilities.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedResourceSkuCapabilities.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSkuCapabilities; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuLocationInfo.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuLocationInfo.java new file mode 100644 index 000000000000..3fedb0d2af82 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuLocationInfo.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes an available Compute SKU Location Information. + */ +@Immutable +public final class ResourceSkuLocationInfo implements JsonSerializable { + /* + * Location of the SKU + */ + private String location; + + /* + * List of availability zones where the SKU is supported. + */ + private List zones; + + /* + * Gets details of capabilities available to a SKU in specific zones. + */ + private List zoneDetails; + + /** + * Creates an instance of ResourceSkuLocationInfo class. + */ + private ResourceSkuLocationInfo() { + } + + /** + * Get the location property: Location of the SKU. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the zones property: List of availability zones where the SKU is supported. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Get the zoneDetails property: Gets details of capabilities available to a SKU in specific zones. + * + * @return the zoneDetails value. + */ + public List zoneDetails() { + return this.zoneDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property location in model ResourceSkuLocationInfo")); + } + if (zones() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property zones in model ResourceSkuLocationInfo")); + } + if (zoneDetails() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property zoneDetails in model ResourceSkuLocationInfo")); + } else { + zoneDetails().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceSkuLocationInfo.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("zoneDetails", this.zoneDetails, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSkuLocationInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSkuLocationInfo if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceSkuLocationInfo. + */ + public static ResourceSkuLocationInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSkuLocationInfo deserializedResourceSkuLocationInfo = new ResourceSkuLocationInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedResourceSkuLocationInfo.location = reader.getString(); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceSkuLocationInfo.zones = zones; + } else if ("zoneDetails".equals(fieldName)) { + List zoneDetails + = reader.readArray(reader1 -> ResourceSkuZoneDetails.fromJson(reader1)); + deserializedResourceSkuLocationInfo.zoneDetails = zoneDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSkuLocationInfo; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuResourceType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuResourceType.java new file mode 100644 index 000000000000..993e08320279 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuResourceType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes the type of resource the SKU applies to. + */ +public final class ResourceSkuResourceType extends ExpandableStringEnum { + /** + * The SKU is for a private cloud. + */ + public static final ResourceSkuResourceType PRIVATE_CLOUDS = fromString("privateClouds"); + + /** + * The SKU is for a private cloud cluster. + */ + public static final ResourceSkuResourceType PRIVATE_CLOUDS_CLUSTERS = fromString("privateClouds/clusters"); + + /** + * Creates a new instance of ResourceSkuResourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceSkuResourceType() { + } + + /** + * Creates or finds a ResourceSkuResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceSkuResourceType. + */ + public static ResourceSkuResourceType fromString(String name) { + return fromString(name, ResourceSkuResourceType.class); + } + + /** + * Gets known ResourceSkuResourceType values. + * + * @return known ResourceSkuResourceType values. + */ + public static Collection values() { + return values(ResourceSkuResourceType.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictionInfo.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictionInfo.java new file mode 100644 index 000000000000..01297083aa0a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictionInfo.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes an available Compute SKU Restriction Information. + */ +@Immutable +public final class ResourceSkuRestrictionInfo implements JsonSerializable { + /* + * Locations where the SKU is restricted + */ + private List locations; + + /* + * List of availability zones where the SKU is restricted. + */ + private List zones; + + /** + * Creates an instance of ResourceSkuRestrictionInfo class. + */ + private ResourceSkuRestrictionInfo() { + } + + /** + * Get the locations property: Locations where the SKU is restricted. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the zones property: List of availability zones where the SKU is restricted. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("locations", this.locations, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSkuRestrictionInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSkuRestrictionInfo if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceSkuRestrictionInfo. + */ + public static ResourceSkuRestrictionInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSkuRestrictionInfo deserializedResourceSkuRestrictionInfo = new ResourceSkuRestrictionInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("locations".equals(fieldName)) { + List locations = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceSkuRestrictionInfo.locations = locations; + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceSkuRestrictionInfo.zones = zones; + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSkuRestrictionInfo; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictions.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictions.java new file mode 100644 index 000000000000..a896ff96e313 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictions.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The restrictions of the SKU. + */ +@Immutable +public final class ResourceSkuRestrictions implements JsonSerializable { + /* + * the type of restrictions. + */ + private ResourceSkuRestrictionsType type; + + /* + * The value of restrictions. If the restriction type is set to location. This would be different locations where + * the SKU is restricted. + */ + private List values; + + /* + * The information about the restriction where the SKU cannot be used. + */ + private ResourceSkuRestrictionInfo restrictionInfo; + + /* + * the reason for restriction. + */ + private ResourceSkuRestrictionsReasonCode reasonCode; + + /** + * Creates an instance of ResourceSkuRestrictions class. + */ + private ResourceSkuRestrictions() { + } + + /** + * Get the type property: the type of restrictions. + * + * @return the type value. + */ + public ResourceSkuRestrictionsType type() { + return this.type; + } + + /** + * Get the values property: The value of restrictions. If the restriction type is set to location. This would be + * different locations where the SKU is restricted. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Get the restrictionInfo property: The information about the restriction where the SKU cannot be used. + * + * @return the restrictionInfo value. + */ + public ResourceSkuRestrictionInfo restrictionInfo() { + return this.restrictionInfo; + } + + /** + * Get the reasonCode property: the reason for restriction. + * + * @return the reasonCode value. + */ + public ResourceSkuRestrictionsReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (values() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property values in model ResourceSkuRestrictions")); + } + if (restrictionInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property restrictionInfo in model ResourceSkuRestrictions")); + } else { + restrictionInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceSkuRestrictions.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("restrictionInfo", this.restrictionInfo); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("reasonCode", this.reasonCode == null ? null : this.reasonCode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSkuRestrictions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSkuRestrictions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceSkuRestrictions. + */ + public static ResourceSkuRestrictions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSkuRestrictions deserializedResourceSkuRestrictions = new ResourceSkuRestrictions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceSkuRestrictions.values = values; + } else if ("restrictionInfo".equals(fieldName)) { + deserializedResourceSkuRestrictions.restrictionInfo = ResourceSkuRestrictionInfo.fromJson(reader); + } else if ("type".equals(fieldName)) { + deserializedResourceSkuRestrictions.type + = ResourceSkuRestrictionsType.fromString(reader.getString()); + } else if ("reasonCode".equals(fieldName)) { + deserializedResourceSkuRestrictions.reasonCode + = ResourceSkuRestrictionsReasonCode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSkuRestrictions; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictionsReasonCode.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictionsReasonCode.java new file mode 100644 index 000000000000..4d5db27de3ef --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictionsReasonCode.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes the reason for SKU restriction. + */ +public final class ResourceSkuRestrictionsReasonCode extends ExpandableStringEnum { + /** + * The restriction is due to exceeding a quota limitation. + */ + public static final ResourceSkuRestrictionsReasonCode QUOTA_ID = fromString("QuotaId"); + + /** + * The restriction is not available for this subscription. + */ + public static final ResourceSkuRestrictionsReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION + = fromString("NotAvailableForSubscription"); + + /** + * Creates a new instance of ResourceSkuRestrictionsReasonCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceSkuRestrictionsReasonCode() { + } + + /** + * Creates or finds a ResourceSkuRestrictionsReasonCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceSkuRestrictionsReasonCode. + */ + public static ResourceSkuRestrictionsReasonCode fromString(String name) { + return fromString(name, ResourceSkuRestrictionsReasonCode.class); + } + + /** + * Gets known ResourceSkuRestrictionsReasonCode values. + * + * @return known ResourceSkuRestrictionsReasonCode values. + */ + public static Collection values() { + return values(ResourceSkuRestrictionsReasonCode.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictionsType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictionsType.java new file mode 100644 index 000000000000..f040a92e303c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuRestrictionsType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes the kind of SKU restrictions that can exist. + */ +public final class ResourceSkuRestrictionsType extends ExpandableStringEnum { + /** + * SKU restricted by location. + */ + public static final ResourceSkuRestrictionsType LOCATION = fromString("Location"); + + /** + * SKU restricted by availability zone. + */ + public static final ResourceSkuRestrictionsType ZONE = fromString("Zone"); + + /** + * Creates a new instance of ResourceSkuRestrictionsType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceSkuRestrictionsType() { + } + + /** + * Creates or finds a ResourceSkuRestrictionsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceSkuRestrictionsType. + */ + public static ResourceSkuRestrictionsType fromString(String name) { + return fromString(name, ResourceSkuRestrictionsType.class); + } + + /** + * Gets known ResourceSkuRestrictionsType values. + * + * @return known ResourceSkuRestrictionsType values. + */ + public static Collection values() { + return values(ResourceSkuRestrictionsType.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuZoneDetails.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuZoneDetails.java new file mode 100644 index 000000000000..c284792e6a87 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ResourceSkuZoneDetails.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes The zonal capabilities of a SKU. + */ +@Immutable +public final class ResourceSkuZoneDetails implements JsonSerializable { + /* + * Gets the set of zones that the SKU is available in with the specified capabilities. + */ + private List name; + + /* + * A list of capabilities that are available for the SKU in the specified list of zones. + */ + private List capabilities; + + /** + * Creates an instance of ResourceSkuZoneDetails class. + */ + private ResourceSkuZoneDetails() { + } + + /** + * Get the name property: Gets the set of zones that the SKU is available in with the specified capabilities. + * + * @return the name value. + */ + public List name() { + return this.name; + } + + /** + * Get the capabilities property: A list of capabilities that are available for the SKU in the specified list of + * zones. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model ResourceSkuZoneDetails")); + } + if (capabilities() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property capabilities in model ResourceSkuZoneDetails")); + } else { + capabilities().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceSkuZoneDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("name", this.name, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("capabilities", this.capabilities, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSkuZoneDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSkuZoneDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceSkuZoneDetails. + */ + public static ResourceSkuZoneDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSkuZoneDetails deserializedResourceSkuZoneDetails = new ResourceSkuZoneDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + List name = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceSkuZoneDetails.name = name; + } else if ("capabilities".equals(fieldName)) { + List capabilities + = reader.readArray(reader1 -> ResourceSkuCapabilities.fromJson(reader1)); + deserializedResourceSkuZoneDetails.capabilities = capabilities; + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSkuZoneDetails; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlet.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlet.java index f6758052b6f9..f01378a9493c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlet.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlet.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; import com.azure.core.management.SystemData; import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner; -import java.util.List; /** * An immutable client-side representation of ScriptCmdlet. @@ -34,47 +33,18 @@ public interface ScriptCmdlet { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - ScriptCmdletProvisioningState provisioningState(); - - /** - * Gets the description property: Description of the scripts functionality. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the description value. + * @return the properties value. */ - String description(); + ScriptCmdletProperties properties(); /** - * Gets the timeout property: Recommended time limit for execution. - * - * @return the timeout value. - */ - String timeout(); - - /** - * Gets the audience property: Specifies whether a script cmdlet is intended to be invoked only through automation - * or visible to customers. - * - * @return the audience value. - */ - ScriptCmdletAudience audience(); - - /** - * Gets the parameters property: Parameters the script will accept. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the parameters value. + * @return the systemData value. */ - List parameters(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner object. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletAudience.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletAudience.java index 83d394dcb7a2..b017ff935129 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletAudience.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletAudience.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class ScriptCmdletAudience extends ExpandableStringEnum { /** - * Static value Automation for ScriptCmdletAudience. + * is automation. */ public static final ScriptCmdletAudience AUTOMATION = fromString("Automation"); /** - * Static value Any for ScriptCmdletAudience. + * is any. */ public static final ScriptCmdletAudience ANY = fromString("Any"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletProperties.java similarity index 93% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletProperties.java index 59edb9ad797a..621d48625415 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletProperties.java @@ -1,17 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.ScriptCmdletAudience; -import com.azure.resourcemanager.avs.models.ScriptCmdletProvisioningState; -import com.azure.resourcemanager.avs.models.ScriptParameter; import java.io.IOException; import java.util.List; @@ -48,7 +45,7 @@ public final class ScriptCmdletProperties implements JsonSerializable { /** - * Static value Succeeded for ScriptCmdletProvisioningState. + * Resource has been created. */ public static final ScriptCmdletProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ScriptCmdletProvisioningState. + * Resource creation failed. */ public static final ScriptCmdletProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ScriptCmdletProvisioningState. + * Resource creation was canceled. */ public static final ScriptCmdletProvisioningState CANCELED = fromString("Canceled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlets.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlets.java index 7f8d7b4b433f..d1d79be5c463 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlets.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlets.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecution.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecution.java index ae7e11eca9be..c1514fcc85b4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecution.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecution.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -8,9 +8,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.ScriptExecutionInner; -import java.time.OffsetDateTime; import java.util.List; -import java.util.Map; /** * An immutable client-side representation of ScriptExecution. @@ -38,118 +36,18 @@ public interface ScriptExecution { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the scriptCmdletId property: A reference to the script cmdlet resource if user is running a AVS script. - * - * @return the scriptCmdletId value. - */ - String scriptCmdletId(); - - /** - * Gets the parameters property: Parameters the script will accept. - * - * @return the parameters value. - */ - List parameters(); - - /** - * Gets the hiddenParameters property: Parameters that will be hidden/not visible to ARM, such as passwords and - * credentials. - * - * @return the hiddenParameters value. - */ - List hiddenParameters(); - - /** - * Gets the failureReason property: Error message if the script was able to run, but if the script itself had - * errors or powershell threw an exception. - * - * @return the failureReason value. - */ - String failureReason(); - - /** - * Gets the timeout property: Time limit for execution. - * - * @return the timeout value. - */ - String timeout(); - - /** - * Gets the retention property: Time to live for the resource. If not provided, will be available for 60 days. - * - * @return the retention value. - */ - String retention(); - - /** - * Gets the submittedAt property: Time the script execution was submitted. - * - * @return the submittedAt value. - */ - OffsetDateTime submittedAt(); - - /** - * Gets the startedAt property: Time the script execution was started. - * - * @return the startedAt value. - */ - OffsetDateTime startedAt(); - - /** - * Gets the finishedAt property: Time the script execution was finished. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the finishedAt value. + * @return the properties value. */ - OffsetDateTime finishedAt(); + ScriptExecutionProperties properties(); /** - * Gets the provisioningState property: The state of the script execution resource. - * - * @return the provisioningState value. - */ - ScriptExecutionProvisioningState provisioningState(); - - /** - * Gets the output property: Standard output stream from the powershell execution. - * - * @return the output value. - */ - List output(); - - /** - * Gets the namedOutputs property: User-defined dictionary. - * - * @return the namedOutputs value. - */ - Map namedOutputs(); - - /** - * Gets the information property: Standard information out stream from the powershell execution. - * - * @return the information value. - */ - List information(); - - /** - * Gets the warnings property: Standard warning out stream from the powershell execution. - * - * @return the warnings value. - */ - List warnings(); - - /** - * Gets the errors property: Standard error output stream from the powershell execution. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the errors value. + * @return the systemData value. */ - List errors(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -200,9 +98,7 @@ interface WithParentResource { * The stage of the ScriptExecution 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.WithScriptCmdletId, DefinitionStages.WithParameters, - DefinitionStages.WithHiddenParameters, DefinitionStages.WithFailureReason, DefinitionStages.WithTimeout, - DefinitionStages.WithRetention, DefinitionStages.WithOutput, DefinitionStages.WithNamedOutputs { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -220,115 +116,16 @@ interface WithCreate extends DefinitionStages.WithScriptCmdletId, DefinitionStag } /** - * The stage of the ScriptExecution definition allowing to specify scriptCmdletId. - */ - interface WithScriptCmdletId { - /** - * Specifies the scriptCmdletId property: A reference to the script cmdlet resource if user is running a AVS - * script. - * - * @param scriptCmdletId A reference to the script cmdlet resource if user is running a AVS script. - * @return the next definition stage. - */ - WithCreate withScriptCmdletId(String scriptCmdletId); - } - - /** - * The stage of the ScriptExecution definition allowing to specify parameters. - */ - interface WithParameters { - /** - * Specifies the parameters property: Parameters the script will accept. - * - * @param parameters Parameters the script will accept. - * @return the next definition stage. - */ - WithCreate withParameters(List parameters); - } - - /** - * The stage of the ScriptExecution definition allowing to specify hiddenParameters. - */ - interface WithHiddenParameters { - /** - * Specifies the hiddenParameters property: Parameters that will be hidden/not visible to ARM, such as - * passwords and - * credentials. - * - * @param hiddenParameters Parameters that will be hidden/not visible to ARM, such as passwords and - * credentials. - * @return the next definition stage. - */ - WithCreate withHiddenParameters(List hiddenParameters); - } - - /** - * The stage of the ScriptExecution definition allowing to specify failureReason. - */ - interface WithFailureReason { - /** - * Specifies the failureReason property: Error message if the script was able to run, but if the script - * itself had - * errors or powershell threw an exception. - * - * @param failureReason Error message if the script was able to run, but if the script itself had - * errors or powershell threw an exception. - * @return the next definition stage. - */ - WithCreate withFailureReason(String failureReason); - } - - /** - * The stage of the ScriptExecution definition allowing to specify timeout. - */ - interface WithTimeout { - /** - * Specifies the timeout property: Time limit for execution. - * - * @param timeout Time limit for execution. - * @return the next definition stage. - */ - WithCreate withTimeout(String timeout); - } - - /** - * The stage of the ScriptExecution definition allowing to specify retention. - */ - interface WithRetention { - /** - * Specifies the retention property: Time to live for the resource. If not provided, will be available for - * 60 days. - * - * @param retention Time to live for the resource. If not provided, will be available for 60 days. - * @return the next definition stage. - */ - WithCreate withRetention(String retention); - } - - /** - * The stage of the ScriptExecution definition allowing to specify output. + * The stage of the ScriptExecution definition allowing to specify properties. */ - interface WithOutput { + interface WithProperties { /** - * Specifies the output property: Standard output stream from the powershell execution. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param output Standard output stream from the powershell execution. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withOutput(List output); - } - - /** - * The stage of the ScriptExecution definition allowing to specify namedOutputs. - */ - interface WithNamedOutputs { - /** - * Specifies the namedOutputs property: User-defined dictionary.. - * - * @param namedOutputs User-defined dictionary. - * @return the next definition stage. - */ - WithCreate withNamedOutputs(Map namedOutputs); + WithCreate withProperties(ScriptExecutionProperties properties); } } @@ -342,9 +139,7 @@ interface WithNamedOutputs { /** * The template for ScriptExecution update. */ - interface Update extends UpdateStages.WithScriptCmdletId, UpdateStages.WithParameters, - UpdateStages.WithHiddenParameters, UpdateStages.WithFailureReason, UpdateStages.WithTimeout, - UpdateStages.WithRetention, UpdateStages.WithOutput, UpdateStages.WithNamedOutputs { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -366,115 +161,16 @@ interface Update extends UpdateStages.WithScriptCmdletId, UpdateStages.WithParam */ interface UpdateStages { /** - * The stage of the ScriptExecution update allowing to specify scriptCmdletId. - */ - interface WithScriptCmdletId { - /** - * Specifies the scriptCmdletId property: A reference to the script cmdlet resource if user is running a AVS - * script. - * - * @param scriptCmdletId A reference to the script cmdlet resource if user is running a AVS script. - * @return the next definition stage. - */ - Update withScriptCmdletId(String scriptCmdletId); - } - - /** - * The stage of the ScriptExecution update allowing to specify parameters. - */ - interface WithParameters { - /** - * Specifies the parameters property: Parameters the script will accept. - * - * @param parameters Parameters the script will accept. - * @return the next definition stage. - */ - Update withParameters(List parameters); - } - - /** - * The stage of the ScriptExecution update allowing to specify hiddenParameters. - */ - interface WithHiddenParameters { - /** - * Specifies the hiddenParameters property: Parameters that will be hidden/not visible to ARM, such as - * passwords and - * credentials. - * - * @param hiddenParameters Parameters that will be hidden/not visible to ARM, such as passwords and - * credentials. - * @return the next definition stage. - */ - Update withHiddenParameters(List hiddenParameters); - } - - /** - * The stage of the ScriptExecution update allowing to specify failureReason. - */ - interface WithFailureReason { - /** - * Specifies the failureReason property: Error message if the script was able to run, but if the script - * itself had - * errors or powershell threw an exception. - * - * @param failureReason Error message if the script was able to run, but if the script itself had - * errors or powershell threw an exception. - * @return the next definition stage. - */ - Update withFailureReason(String failureReason); - } - - /** - * The stage of the ScriptExecution update allowing to specify timeout. - */ - interface WithTimeout { - /** - * Specifies the timeout property: Time limit for execution. - * - * @param timeout Time limit for execution. - * @return the next definition stage. - */ - Update withTimeout(String timeout); - } - - /** - * The stage of the ScriptExecution update allowing to specify retention. - */ - interface WithRetention { - /** - * Specifies the retention property: Time to live for the resource. If not provided, will be available for - * 60 days. - * - * @param retention Time to live for the resource. If not provided, will be available for 60 days. - * @return the next definition stage. - */ - Update withRetention(String retention); - } - - /** - * The stage of the ScriptExecution update allowing to specify output. - */ - interface WithOutput { - /** - * Specifies the output property: Standard output stream from the powershell execution. - * - * @param output Standard output stream from the powershell execution. - * @return the next definition stage. - */ - Update withOutput(List output); - } - - /** - * The stage of the ScriptExecution update allowing to specify namedOutputs. + * The stage of the ScriptExecution update allowing to specify properties. */ - interface WithNamedOutputs { + interface WithProperties { /** - * Specifies the namedOutputs property: User-defined dictionary.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param namedOutputs User-defined dictionary. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - Update withNamedOutputs(Map namedOutputs); + Update withProperties(ScriptExecutionProperties properties); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameter.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameter.java index 00e76a4968a6..2767375ab487 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameter.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -112,12 +112,12 @@ public static ScriptExecutionParameter fromJson(JsonReader jsonReader) throws IO } } // Use the discriminator value to determine which subtype should be deserialized. - if ("Credential".equals(discriminatorValue)) { - return PSCredentialExecutionParameter.fromJson(readerToUse.reset()); - } else if ("SecureValue".equals(discriminatorValue)) { + if ("SecureValue".equals(discriminatorValue)) { return ScriptSecureStringExecutionParameter.fromJson(readerToUse.reset()); } else if ("Value".equals(discriminatorValue)) { return ScriptStringExecutionParameter.fromJson(readerToUse.reset()); + } else if ("Credential".equals(discriminatorValue)) { + return PSCredentialExecutionParameter.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameterType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameterType.java index 0dd85491426a..73e9dbf342a4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameterType.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameterType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionProperties.java similarity index 95% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionProperties.java index 02fc66dcb498..d943e6e050ab 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionProperties.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; @@ -11,8 +11,6 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.ScriptExecutionParameter; -import com.azure.resourcemanager.avs.models.ScriptExecutionProvisioningState; import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; @@ -83,7 +81,7 @@ public final class ScriptExecutionProperties implements JsonSerializable namedOutputs; + private Map namedOutputs; /* * Standard information out stream from the powershell execution @@ -291,7 +289,7 @@ public ScriptExecutionProperties withOutput(List output) { * * @return the namedOutputs value. */ - public Map namedOutputs() { + public Map namedOutputs() { return this.namedOutputs; } @@ -301,7 +299,7 @@ public Map namedOutputs() { * @param namedOutputs the namedOutputs value to set. * @return the ScriptExecutionProperties object itself. */ - public ScriptExecutionProperties withNamedOutputs(Map namedOutputs) { + public ScriptExecutionProperties withNamedOutputs(Map namedOutputs) { this.namedOutputs = namedOutputs; return this; } @@ -350,6 +348,13 @@ public void validate() { .log(new IllegalArgumentException( "Missing required property timeout in model ScriptExecutionProperties")); } + if (namedOutputs() != null) { + namedOutputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } } private static final ClientLogger LOGGER = new ClientLogger(ScriptExecutionProperties.class); @@ -368,7 +373,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("failureReason", this.failureReason); jsonWriter.writeStringField("retention", this.retention); jsonWriter.writeArrayField("output", this.output, (writer, element) -> writer.writeString(element)); - jsonWriter.writeMapField("namedOutputs", this.namedOutputs, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("namedOutputs", this.namedOutputs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -420,7 +425,8 @@ public static ScriptExecutionProperties fromJson(JsonReader jsonReader) throws I List output = reader.readArray(reader1 -> reader1.getString()); deserializedScriptExecutionProperties.output = output; } else if ("namedOutputs".equals(fieldName)) { - Map namedOutputs = reader.readMap(reader1 -> reader1.readUntyped()); + Map namedOutputs + = reader.readMap(reader1 -> ScriptExecutionPropertiesNamedOutput.fromJson(reader1)); deserializedScriptExecutionProperties.namedOutputs = namedOutputs; } else if ("information".equals(fieldName)) { List information = reader.readArray(reader1 -> reader1.getString()); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionPropertiesNamedOutput.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionPropertiesNamedOutput.java new file mode 100644 index 000000000000..c700a8c83809 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionPropertiesNamedOutput.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ScriptExecutionPropertiesNamedOutput model. + */ +@Immutable +public final class ScriptExecutionPropertiesNamedOutput + implements JsonSerializable { + /** + * Creates an instance of ScriptExecutionPropertiesNamedOutput class. + */ + public ScriptExecutionPropertiesNamedOutput() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScriptExecutionPropertiesNamedOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScriptExecutionPropertiesNamedOutput if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScriptExecutionPropertiesNamedOutput. + */ + public static ScriptExecutionPropertiesNamedOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScriptExecutionPropertiesNamedOutput deserializedScriptExecutionPropertiesNamedOutput + = new ScriptExecutionPropertiesNamedOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + reader.skipChildren(); + } + + return deserializedScriptExecutionPropertiesNamedOutput; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionProvisioningState.java index 7fe0d7c8bb45..35688988d197 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,42 +12,42 @@ */ public final class ScriptExecutionProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for ScriptExecutionProvisioningState. + * Resource has been created. */ public static final ScriptExecutionProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ScriptExecutionProvisioningState. + * Resource creation failed. */ public static final ScriptExecutionProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ScriptExecutionProvisioningState. + * Resource creation was canceled. */ public static final ScriptExecutionProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Pending for ScriptExecutionProvisioningState. + * is pending. */ public static final ScriptExecutionProvisioningState PENDING = fromString("Pending"); /** - * Static value Running for ScriptExecutionProvisioningState. + * is running. */ public static final ScriptExecutionProvisioningState RUNNING = fromString("Running"); /** - * Static value Cancelling for ScriptExecutionProvisioningState. + * is cancelling. */ public static final ScriptExecutionProvisioningState CANCELLING = fromString("Cancelling"); /** - * Static value Cancelled for ScriptExecutionProvisioningState. + * is cancelled. */ public static final ScriptExecutionProvisioningState CANCELLED = fromString("Cancelled"); /** - * Static value Deleting for ScriptExecutionProvisioningState. + * is deleting. */ public static final ScriptExecutionProvisioningState DELETING = fromString("Deleting"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutions.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutions.java index 5d1e4330c70a..751fd80070b2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutions.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptOutputStreamType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptOutputStreamType.java index 493208fd5e84..c9f9e68927b4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptOutputStreamType.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptOutputStreamType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,22 +12,22 @@ */ public final class ScriptOutputStreamType extends ExpandableStringEnum { /** - * Static value Information for ScriptOutputStreamType. + * is information. */ public static final ScriptOutputStreamType INFORMATION = fromString("Information"); /** - * Static value Warning for ScriptOutputStreamType. + * is warning. */ public static final ScriptOutputStreamType WARNING = fromString("Warning"); /** - * Static value Output for ScriptOutputStreamType. + * is output. */ public static final ScriptOutputStreamType OUTPUT = fromString("Output"); /** - * Static value Error for ScriptOutputStreamType. + * is error. */ public static final ScriptOutputStreamType ERROR = fromString("Error"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackage.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackage.java index 33cedd0592b9..3b04c28bb079 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackage.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -33,46 +33,18 @@ public interface ScriptPackage { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - ScriptPackageProvisioningState provisioningState(); - - /** - * Gets the description property: User friendly description of the package. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the description value. + * @return the properties value. */ - String description(); + ScriptPackageProperties properties(); /** - * Gets the version property: Module version. - * - * @return the version value. - */ - String version(); - - /** - * Gets the company property: Company that created and supports the package. - * - * @return the company value. - */ - String company(); - - /** - * Gets the uri property: Link to support by the package vendor. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the uri value. + * @return the systemData value. */ - String uri(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner object. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackageProperties.java similarity index 94% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackageProperties.java index 09b4e16cac56..5726f94f9982 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackageProperties.java @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.ScriptPackageProvisioningState; import java.io.IOException; /** @@ -45,7 +44,7 @@ public final class ScriptPackageProperties implements JsonSerializable { /** - * Static value Succeeded for ScriptPackageProvisioningState. + * Resource has been created. */ public static final ScriptPackageProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ScriptPackageProvisioningState. + * Resource creation failed. */ public static final ScriptPackageProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ScriptPackageProvisioningState. + * Resource creation was canceled. */ public static final ScriptPackageProvisioningState CANCELED = fromString("Canceled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackages.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackages.java index 457f32d3e0dd..0c3e2f0101f5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackages.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackages.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameter.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameter.java index a7b577ca91a9..cce96969e8c8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameter.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameter.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * An parameter that the script will accept. */ -@Fluent +@Immutable public final class ScriptParameter implements JsonSerializable { /* * The type of parameter the script is expecting. psCredential is a @@ -46,7 +46,7 @@ public final class ScriptParameter implements JsonSerializable /** * Creates an instance of ScriptParameter class. */ - public ScriptParameter() { + private ScriptParameter() { } /** @@ -68,17 +68,6 @@ public String name() { return this.name; } - /** - * Set the name property: The parameter name that the script will expect a parameter value for. - * - * @param name the name value to set. - * @return the ScriptParameter object itself. - */ - public ScriptParameter withName(String name) { - this.name = name; - return this; - } - /** * Get the description property: User friendly description of the parameter. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameterTypes.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameterTypes.java index dc5232cd21a3..f5ec37fdc190 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameterTypes.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameterTypes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,32 +12,32 @@ */ public final class ScriptParameterTypes extends ExpandableStringEnum { /** - * Static value String for ScriptParameterTypes. + * is string. */ public static final ScriptParameterTypes STRING = fromString("String"); /** - * Static value SecureString for ScriptParameterTypes. + * is secure string. */ public static final ScriptParameterTypes SECURE_STRING = fromString("SecureString"); /** - * Static value Credential for ScriptParameterTypes. + * is credential. */ public static final ScriptParameterTypes CREDENTIAL = fromString("Credential"); /** - * Static value Int for ScriptParameterTypes. + * is int. */ public static final ScriptParameterTypes INT = fromString("Int"); /** - * Static value Bool for ScriptParameterTypes. + * is bool. */ public static final ScriptParameterTypes BOOL = fromString("Bool"); /** - * Static value Float for ScriptParameterTypes. + * is float. */ public static final ScriptParameterTypes FLOAT = fromString("Float"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptSecureStringExecutionParameter.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptSecureStringExecutionParameter.java index a26151dff54d..107e3af02698 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptSecureStringExecutionParameter.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptSecureStringExecutionParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptStringExecutionParameter.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptStringExecutionParameter.java index 04389922f92b..ff4a7444e24f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptStringExecutionParameter.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptStringExecutionParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SegmentStatusEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SegmentStatusEnum.java index 03d45f61c809..374c42d9ee6f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SegmentStatusEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SegmentStatusEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class SegmentStatusEnum extends ExpandableStringEnum { /** - * Static value SUCCESS for SegmentStatusEnum. + * is success. */ public static final SegmentStatusEnum SUCCESS = fromString("SUCCESS"); /** - * Static value FAILURE for SegmentStatusEnum. + * is failure. */ public static final SegmentStatusEnum FAILURE = fromString("FAILURE"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Sku.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Sku.java index b527649da328..f06fe022b873 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Sku.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Sku.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -18,7 +18,7 @@ @Fluent public final class Sku implements JsonSerializable { /* - * The name of the SKU. E.g. P3. It is typically a letter+number code + * The name of the SKU. Ex - P3. It is typically a letter+number code */ private String name; @@ -52,7 +52,7 @@ public Sku() { } /** - * Get the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. + * Get the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. * * @return the name value. */ @@ -61,7 +61,7 @@ public String name() { } /** - * Set the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. + * Set the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. * * @param name the name value to set. * @return the Sku object itself. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SkuTier.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SkuTier.java index 6be884faf689..56f43a035b75 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SkuTier.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SkuTier.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -10,22 +10,22 @@ */ public enum SkuTier { /** - * Enum value Free. + * The Free service tier. */ FREE("Free"), /** - * Enum value Basic. + * The Basic service tier. */ BASIC("Basic"), /** - * Enum value Standard. + * The Standard service tier. */ STANDARD("Standard"), /** - * Enum value Premium. + * The Premium service tier. */ PREMIUM("Premium"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Skus.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Skus.java new file mode 100644 index 000000000000..a09646f34479 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Skus.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Skus. + */ +public interface Skus { + /** + * A list of SKUs. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * A list of SKUs. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ResourceSku items as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SpecializedHostProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SpecializedHostProperties.java new file mode 100644 index 000000000000..cba5a005bab9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SpecializedHostProperties.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of a specialized host. + */ +@Immutable +public final class SpecializedHostProperties extends HostProperties { + /* + * The kind of host + */ + private HostKind kind = HostKind.SPECIALIZED; + + /** + * Creates an instance of SpecializedHostProperties class. + */ + private SpecializedHostProperties() { + } + + /** + * Get the kind property: The kind of host. + * + * @return the kind value. + */ + @Override + public HostKind kind() { + return this.kind; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeStringField("maintenance", maintenance() == null ? null : maintenance().toString()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SpecializedHostProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SpecializedHostProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SpecializedHostProperties. + */ + public static SpecializedHostProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SpecializedHostProperties deserializedSpecializedHostProperties = new SpecializedHostProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSpecializedHostProperties + .withProvisioningState(HostProvisioningState.fromString(reader.getString())); + } else if ("displayName".equals(fieldName)) { + deserializedSpecializedHostProperties.withDisplayName(reader.getString()); + } else if ("moRefId".equals(fieldName)) { + deserializedSpecializedHostProperties.withMoRefId(reader.getString()); + } else if ("fqdn".equals(fieldName)) { + deserializedSpecializedHostProperties.withFqdn(reader.getString()); + } else if ("maintenance".equals(fieldName)) { + deserializedSpecializedHostProperties + .withMaintenance(HostMaintenance.fromString(reader.getString())); + } else if ("faultDomain".equals(fieldName)) { + deserializedSpecializedHostProperties.withFaultDomain(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedSpecializedHostProperties.kind = HostKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSpecializedHostProperties; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SslEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SslEnum.java index f45b038c9c10..5d146bf7599f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SslEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SslEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class SslEnum extends ExpandableStringEnum { /** - * Static value Enabled for SslEnum. + * is enabled. */ public static final SslEnum ENABLED = fromString("Enabled"); /** - * Static value Disabled for SslEnum. + * is disabled. */ public static final SslEnum DISABLED = fromString("Disabled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SystemAssignedServiceIdentityType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SystemAssignedServiceIdentityType.java new file mode 100644 index 000000000000..901a51178dc9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SystemAssignedServiceIdentityType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (either system assigned, or none). + */ +public final class SystemAssignedServiceIdentityType extends ExpandableStringEnum { + /** + * No managed system identity. + */ + public static final SystemAssignedServiceIdentityType NONE = fromString("None"); + + /** + * System assigned managed system identity. + */ + public static final SystemAssignedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Creates a new instance of SystemAssignedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SystemAssignedServiceIdentityType() { + } + + /** + * Creates or finds a SystemAssignedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SystemAssignedServiceIdentityType. + */ + public static SystemAssignedServiceIdentityType fromString(String name) { + return fromString(name, SystemAssignedServiceIdentityType.class); + } + + /** + * Gets known SystemAssignedServiceIdentityType values. + * + * @return known SystemAssignedServiceIdentityType values. + */ + public static Collection values() { + return values(SystemAssignedServiceIdentityType.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Trial.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Trial.java index f65dae8db654..d80e79d348d9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Trial.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Trial.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/TrialStatus.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/TrialStatus.java index 4b651f7724c0..567cfc9b9451 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/TrialStatus.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/TrialStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,17 +12,17 @@ */ public final class TrialStatus extends ExpandableStringEnum { /** - * Static value TrialAvailable for TrialStatus. + * is available. */ public static final TrialStatus TRIAL_AVAILABLE = fromString("TrialAvailable"); /** - * Static value TrialUsed for TrialStatus. + * is used. */ public static final TrialStatus TRIAL_USED = fromString("TrialUsed"); /** - * Static value TrialDisabled for TrialStatus. + * is disabled. */ public static final TrialStatus TRIAL_DISABLED = fromString("TrialDisabled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMGroupStatusEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMGroupStatusEnum.java index c5aa668dc4c8..8a740c086f57 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMGroupStatusEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMGroupStatusEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class VMGroupStatusEnum extends ExpandableStringEnum { /** - * Static value SUCCESS for VMGroupStatusEnum. + * is success. */ public static final VMGroupStatusEnum SUCCESS = fromString("SUCCESS"); /** - * Static value FAILURE for VMGroupStatusEnum. + * is failure. */ public static final VMGroupStatusEnum FAILURE = fromString("FAILURE"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMTypeEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMTypeEnum.java index ad9c0334ea14..4cbd77ba13e4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMTypeEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMTypeEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,17 +12,17 @@ */ public final class VMTypeEnum extends ExpandableStringEnum { /** - * Static value REGULAR for VMTypeEnum. + * is regular. */ public static final VMTypeEnum REGULAR = fromString("REGULAR"); /** - * Static value EDGE for VMTypeEnum. + * is edge. */ public static final VMTypeEnum EDGE = fromString("EDGE"); /** - * Static value SERVICE for VMTypeEnum. + * is service. */ public static final VMTypeEnum SERVICE = fromString("SERVICE"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachine.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachine.java index d471b5290870..3d19329fffec 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachine.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachine.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -33,46 +33,18 @@ public interface VirtualMachine { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - VirtualMachineProvisioningState provisioningState(); - - /** - * Gets the displayName property: Display name of the VM. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the displayName value. + * @return the properties value. */ - String displayName(); + VirtualMachineProperties properties(); /** - * Gets the moRefId property: Virtual machine managed object reference id. - * - * @return the moRefId value. - */ - String moRefId(); - - /** - * Gets the folderPath property: Path to virtual machine's folder starting from datacenter virtual machine folder. - * - * @return the folderPath value. - */ - String folderPath(); - - /** - * Gets the restrictMovement property: Whether VM DRS-driven movement is restricted (enabled) or not (disabled). + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the restrictMovement value. + * @return the systemData value. */ - VirtualMachineRestrictMovementState restrictMovement(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.avs.fluent.models.VirtualMachineInner object. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachineProperties.java similarity index 91% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachineProperties.java index 3a1994e2bc3e..49493c671f87 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachineProperties.java @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.VirtualMachineProvisioningState; -import com.azure.resourcemanager.avs.models.VirtualMachineRestrictMovementState; import java.io.IOException; /** @@ -29,7 +27,7 @@ public final class VirtualMachineProperties implements JsonSerializable { /** - * Static value Succeeded for VirtualMachineProvisioningState. + * Resource has been created. */ public static final VirtualMachineProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for VirtualMachineProvisioningState. + * Resource creation failed. */ public static final VirtualMachineProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for VirtualMachineProvisioningState. + * Resource creation was canceled. */ public static final VirtualMachineProvisioningState CANCELED = fromString("Canceled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachineRestrictMovement.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachineRestrictMovement.java index c9d45cb67602..705cde62c1b7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachineRestrictMovement.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachineRestrictMovement.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachineRestrictMovementState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachineRestrictMovementState.java index aafb82a07a72..0b1993e9d734 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachineRestrictMovementState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachineRestrictMovementState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -13,12 +13,12 @@ public final class VirtualMachineRestrictMovementState extends ExpandableStringEnum { /** - * Static value Enabled for VirtualMachineRestrictMovementState. + * is enabled. */ public static final VirtualMachineRestrictMovementState ENABLED = fromString("Enabled"); /** - * Static value Disabled for VirtualMachineRestrictMovementState. + * is disabled. */ public static final VirtualMachineRestrictMovementState DISABLED = fromString("Disabled"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachines.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachines.java index 3f358eca9c42..ba250a01c1cb 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachines.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VirtualMachines.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -77,7 +77,7 @@ Response getWithResponse(String resourceGroupName, String privat * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -92,7 +92,7 @@ void restrictMovement(String resourceGroupName, String privateCloudName, String * @param privateCloudName Name of the private cloud. * @param clusterName Name of the cluster. * @param virtualMachineId ID of the virtual machine. - * @param restrictMovement The body type of the operation request. + * @param restrictMovement The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VisibilityParameterEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VisibilityParameterEnum.java index ad2ea2724459..9199f52cbd20 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VisibilityParameterEnum.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VisibilityParameterEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -12,12 +12,12 @@ */ public final class VisibilityParameterEnum extends ExpandableStringEnum { /** - * Static value Visible for VisibilityParameterEnum. + * is visible. */ public static final VisibilityParameterEnum VISIBLE = fromString("Visible"); /** - * Static value Hidden for VisibilityParameterEnum. + * is hidden. */ public static final VisibilityParameterEnum HIDDEN = fromString("Hidden"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VmHostPlacementPolicyProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VmHostPlacementPolicyProperties.java index 7986c7508b4c..7058b9a573c6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VmHostPlacementPolicyProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VmHostPlacementPolicyProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -47,11 +47,6 @@ public final class VmHostPlacementPolicyProperties extends PlacementPolicyProper */ private AzureHybridBenefitType azureHybridBenefitType; - /* - * The provisioning state - */ - private PlacementPolicyProvisioningState provisioningState; - /** * Creates an instance of VmHostPlacementPolicyProperties class. */ @@ -168,16 +163,6 @@ public VmHostPlacementPolicyProperties withAzureHybridBenefitType(AzureHybridBen return this; } - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - @Override - public PlacementPolicyProvisioningState provisioningState() { - return this.provisioningState; - } - /** * {@inheritDoc} */ @@ -264,8 +249,8 @@ public static VmHostPlacementPolicyProperties fromJson(JsonReader jsonReader) th } else if ("displayName".equals(fieldName)) { deserializedVmHostPlacementPolicyProperties.withDisplayName(reader.getString()); } else if ("provisioningState".equals(fieldName)) { - deserializedVmHostPlacementPolicyProperties.provisioningState - = PlacementPolicyProvisioningState.fromString(reader.getString()); + deserializedVmHostPlacementPolicyProperties + .withProvisioningState(PlacementPolicyProvisioningState.fromString(reader.getString())); } else if ("vmMembers".equals(fieldName)) { List vmMembers = reader.readArray(reader1 -> reader1.getString()); deserializedVmHostPlacementPolicyProperties.vmMembers = vmMembers; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VmPlacementPolicyProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VmPlacementPolicyProperties.java index 6265781a8a53..deede05446e8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VmPlacementPolicyProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VmPlacementPolicyProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -32,11 +32,6 @@ public final class VmPlacementPolicyProperties extends PlacementPolicyProperties */ private AffinityType affinityType; - /* - * The provisioning state - */ - private PlacementPolicyProvisioningState provisioningState; - /** * Creates an instance of VmPlacementPolicyProperties class. */ @@ -93,16 +88,6 @@ public VmPlacementPolicyProperties withAffinityType(AffinityType affinityType) { return this; } - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - @Override - public PlacementPolicyProvisioningState provisioningState() { - return this.provisioningState; - } - /** * {@inheritDoc} */ @@ -178,8 +163,8 @@ public static VmPlacementPolicyProperties fromJson(JsonReader jsonReader) throws } else if ("displayName".equals(fieldName)) { deserializedVmPlacementPolicyProperties.withDisplayName(reader.getString()); } else if ("provisioningState".equals(fieldName)) { - deserializedVmPlacementPolicyProperties.provisioningState - = PlacementPolicyProvisioningState.fromString(reader.getString()); + deserializedVmPlacementPolicyProperties + .withProvisioningState(PlacementPolicyProvisioningState.fromString(reader.getString())); } else if ("vmMembers".equals(fieldName)) { List vmMembers = reader.readArray(reader1 -> reader1.getString()); deserializedVmPlacementPolicyProperties.vmMembers = vmMembers; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetwork.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetwork.java index be59cf3574dc..6afd33cf024a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetwork.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetwork.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -33,18 +33,18 @@ public interface WorkloadNetwork { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the systemData value. + * @return the properties value. */ - SystemData systemData(); + WorkloadNetworkProperties properties(); /** - * Gets the provisioningState property: The provisioning state of the resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the provisioningState value. + * @return the systemData value. */ - WorkloadNetworkProvisioningState provisioningState(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkInner object. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcp.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcp.java index a205f5ad95ca..c3b35ecd53f8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcp.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcp.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -83,13 +83,15 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, privateCloudName. + * Specifies resourceGroupName, privateCloudName, workloadNetworkName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @return the next definition stage. */ - WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + WithCreate withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName); } /** @@ -171,19 +173,4 @@ interface WithProperties { Update withProperties(WorkloadNetworkDhcpEntity properties); } } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - WorkloadNetworkDhcp refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - WorkloadNetworkDhcp refresh(Context context); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpEntity.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpEntity.java index 9aba7bfb0a91..eb71f9e61f71 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpEntity.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpEntity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -182,10 +182,10 @@ public static WorkloadNetworkDhcpEntity fromJson(JsonReader jsonReader) throws I } } // Use the discriminator value to determine which subtype should be deserialized. - if ("RELAY".equals(discriminatorValue)) { - return WorkloadNetworkDhcpRelay.fromJson(readerToUse.reset()); - } else if ("SERVER".equals(discriminatorValue)) { + if ("SERVER".equals(discriminatorValue)) { return WorkloadNetworkDhcpServer.fromJson(readerToUse.reset()); + } else if ("RELAY".equals(discriminatorValue)) { + return WorkloadNetworkDhcpRelay.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpProvisioningState.java index 7c5edf4a9e68..4f23575949f5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -13,32 +13,32 @@ public final class WorkloadNetworkDhcpProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for WorkloadNetworkDhcpProvisioningState. + * Resource has been created. */ public static final WorkloadNetworkDhcpProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for WorkloadNetworkDhcpProvisioningState. + * Resource creation failed. */ public static final WorkloadNetworkDhcpProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for WorkloadNetworkDhcpProvisioningState. + * Resource creation was canceled. */ public static final WorkloadNetworkDhcpProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Building for WorkloadNetworkDhcpProvisioningState. + * is building. */ public static final WorkloadNetworkDhcpProvisioningState BUILDING = fromString("Building"); /** - * Static value Deleting for WorkloadNetworkDhcpProvisioningState. + * is deleting. */ public static final WorkloadNetworkDhcpProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for WorkloadNetworkDhcpProvisioningState. + * is updating. */ public static final WorkloadNetworkDhcpProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpRelay.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpRelay.java index d17c49115834..d17612f8494f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpRelay.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpRelay.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -26,16 +26,6 @@ public final class WorkloadNetworkDhcpRelay extends WorkloadNetworkDhcpEntity { */ private List serverAddresses; - /* - * The provisioning state - */ - private WorkloadNetworkDhcpProvisioningState provisioningState; - - /* - * NSX Segments consuming DHCP. - */ - private List segments; - /** * Creates an instance of WorkloadNetworkDhcpRelay class. */ @@ -72,26 +62,6 @@ public WorkloadNetworkDhcpRelay withServerAddresses(List serverAddresses return this; } - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - @Override - public WorkloadNetworkDhcpProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the segments property: NSX Segments consuming DHCP. - * - * @return the segments value. - */ - @Override - public List segments() { - return this.segments; - } - /** * {@inheritDoc} */ @@ -152,10 +122,10 @@ public static WorkloadNetworkDhcpRelay fromJson(JsonReader jsonReader) throws IO deserializedWorkloadNetworkDhcpRelay.withDisplayName(reader.getString()); } else if ("segments".equals(fieldName)) { List segments = reader.readArray(reader1 -> reader1.getString()); - deserializedWorkloadNetworkDhcpRelay.segments = segments; + deserializedWorkloadNetworkDhcpRelay.withSegments(segments); } else if ("provisioningState".equals(fieldName)) { - deserializedWorkloadNetworkDhcpRelay.provisioningState - = WorkloadNetworkDhcpProvisioningState.fromString(reader.getString()); + deserializedWorkloadNetworkDhcpRelay + .withProvisioningState(WorkloadNetworkDhcpProvisioningState.fromString(reader.getString())); } else if ("revision".equals(fieldName)) { deserializedWorkloadNetworkDhcpRelay.withRevision(reader.getNullable(JsonReader::getLong)); } else if ("dhcpType".equals(fieldName)) { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpServer.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpServer.java index 4893d866c68e..042c905dad94 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpServer.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpServer.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -31,16 +31,6 @@ public final class WorkloadNetworkDhcpServer extends WorkloadNetworkDhcpEntity { */ private Long leaseTime; - /* - * The provisioning state - */ - private WorkloadNetworkDhcpProvisioningState provisioningState; - - /* - * NSX Segments consuming DHCP. - */ - private List segments; - /** * Creates an instance of WorkloadNetworkDhcpServer class. */ @@ -97,26 +87,6 @@ public WorkloadNetworkDhcpServer withLeaseTime(Long leaseTime) { return this; } - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - @Override - public WorkloadNetworkDhcpProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the segments property: NSX Segments consuming DHCP. - * - * @return the segments value. - */ - @Override - public List segments() { - return this.segments; - } - /** * {@inheritDoc} */ @@ -177,10 +147,10 @@ public static WorkloadNetworkDhcpServer fromJson(JsonReader jsonReader) throws I deserializedWorkloadNetworkDhcpServer.withDisplayName(reader.getString()); } else if ("segments".equals(fieldName)) { List segments = reader.readArray(reader1 -> reader1.getString()); - deserializedWorkloadNetworkDhcpServer.segments = segments; + deserializedWorkloadNetworkDhcpServer.withSegments(segments); } else if ("provisioningState".equals(fieldName)) { - deserializedWorkloadNetworkDhcpServer.provisioningState - = WorkloadNetworkDhcpProvisioningState.fromString(reader.getString()); + deserializedWorkloadNetworkDhcpServer + .withProvisioningState(WorkloadNetworkDhcpProvisioningState.fromString(reader.getString())); } else if ("revision".equals(fieldName)) { deserializedWorkloadNetworkDhcpServer.withRevision(reader.getNullable(JsonReader::getLong)); } else if ("dhcpType".equals(fieldName)) { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsService.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsService.java index c6e4c0ae7327..4d7d69e886ac 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsService.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsService.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; -import java.util.List; /** * An immutable client-side representation of WorkloadNetworkDnsService. @@ -35,67 +34,18 @@ public interface WorkloadNetworkDnsService { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the displayName property: Display name of the DNS Service. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the dnsServiceIp property: DNS service IP of the DNS Service. - * - * @return the dnsServiceIp value. - */ - String dnsServiceIp(); - - /** - * Gets the defaultDnsZone property: Default DNS zone of the DNS Service. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the defaultDnsZone value. + * @return the properties value. */ - String defaultDnsZone(); + WorkloadNetworkDnsServiceProperties properties(); /** - * Gets the fqdnZones property: FQDN zones of the DNS Service. - * - * @return the fqdnZones value. - */ - List fqdnZones(); - - /** - * Gets the logLevel property: DNS Service log level. - * - * @return the logLevel value. - */ - DnsServiceLogLevelEnum logLevel(); - - /** - * Gets the status property: DNS Service status. - * - * @return the status value. - */ - DnsServiceStatusEnum status(); - - /** - * Gets the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - WorkloadNetworkDnsServiceProvisioningState provisioningState(); - - /** - * Gets the revision property: NSX revision number. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the revision value. + * @return the systemData value. */ - Long revision(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -133,22 +83,22 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, privateCloudName. + * Specifies resourceGroupName, privateCloudName, workloadNetworkName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @return the next definition stage. */ - WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + WithCreate withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName); } /** * The stage of the WorkloadNetworkDnsService 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.WithDisplayName, DefinitionStages.WithDnsServiceIp, - DefinitionStages.WithDefaultDnsZone, DefinitionStages.WithFqdnZones, DefinitionStages.WithLogLevel, - DefinitionStages.WithRevision { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -166,81 +116,16 @@ interface WithCreate extends DefinitionStages.WithDisplayName, DefinitionStages. } /** - * The stage of the WorkloadNetworkDnsService definition allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the DNS Service.. - * - * @param displayName Display name of the DNS Service. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - - /** - * The stage of the WorkloadNetworkDnsService definition allowing to specify dnsServiceIp. - */ - interface WithDnsServiceIp { - /** - * Specifies the dnsServiceIp property: DNS service IP of the DNS Service.. - * - * @param dnsServiceIp DNS service IP of the DNS Service. - * @return the next definition stage. - */ - WithCreate withDnsServiceIp(String dnsServiceIp); - } - - /** - * The stage of the WorkloadNetworkDnsService definition allowing to specify defaultDnsZone. - */ - interface WithDefaultDnsZone { - /** - * Specifies the defaultDnsZone property: Default DNS zone of the DNS Service.. - * - * @param defaultDnsZone Default DNS zone of the DNS Service. - * @return the next definition stage. - */ - WithCreate withDefaultDnsZone(String defaultDnsZone); - } - - /** - * The stage of the WorkloadNetworkDnsService definition allowing to specify fqdnZones. + * The stage of the WorkloadNetworkDnsService definition allowing to specify properties. */ - interface WithFqdnZones { + interface WithProperties { /** - * Specifies the fqdnZones property: FQDN zones of the DNS Service.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param fqdnZones FQDN zones of the DNS Service. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withFqdnZones(List fqdnZones); - } - - /** - * The stage of the WorkloadNetworkDnsService definition allowing to specify logLevel. - */ - interface WithLogLevel { - /** - * Specifies the logLevel property: DNS Service log level.. - * - * @param logLevel DNS Service log level. - * @return the next definition stage. - */ - WithCreate withLogLevel(DnsServiceLogLevelEnum logLevel); - } - - /** - * The stage of the WorkloadNetworkDnsService definition allowing to specify revision. - */ - interface WithRevision { - /** - * Specifies the revision property: NSX revision number.. - * - * @param revision NSX revision number. - * @return the next definition stage. - */ - WithCreate withRevision(Long revision); + WithCreate withProperties(WorkloadNetworkDnsServiceProperties properties); } } @@ -254,9 +139,7 @@ interface WithRevision { /** * The template for WorkloadNetworkDnsService update. */ - interface Update - extends UpdateStages.WithDisplayName, UpdateStages.WithDnsServiceIp, UpdateStages.WithDefaultDnsZone, - UpdateStages.WithFqdnZones, UpdateStages.WithLogLevel, UpdateStages.WithRevision { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -278,81 +161,16 @@ interface Update */ interface UpdateStages { /** - * The stage of the WorkloadNetworkDnsService update allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the DNS Service.. - * - * @param displayName Display name of the DNS Service. - * @return the next definition stage. - */ - Update withDisplayName(String displayName); - } - - /** - * The stage of the WorkloadNetworkDnsService update allowing to specify dnsServiceIp. - */ - interface WithDnsServiceIp { - /** - * Specifies the dnsServiceIp property: DNS service IP of the DNS Service.. - * - * @param dnsServiceIp DNS service IP of the DNS Service. - * @return the next definition stage. - */ - Update withDnsServiceIp(String dnsServiceIp); - } - - /** - * The stage of the WorkloadNetworkDnsService update allowing to specify defaultDnsZone. - */ - interface WithDefaultDnsZone { - /** - * Specifies the defaultDnsZone property: Default DNS zone of the DNS Service.. - * - * @param defaultDnsZone Default DNS zone of the DNS Service. - * @return the next definition stage. - */ - Update withDefaultDnsZone(String defaultDnsZone); - } - - /** - * The stage of the WorkloadNetworkDnsService update allowing to specify fqdnZones. - */ - interface WithFqdnZones { - /** - * Specifies the fqdnZones property: FQDN zones of the DNS Service.. - * - * @param fqdnZones FQDN zones of the DNS Service. - * @return the next definition stage. - */ - Update withFqdnZones(List fqdnZones); - } - - /** - * The stage of the WorkloadNetworkDnsService update allowing to specify logLevel. - */ - interface WithLogLevel { - /** - * Specifies the logLevel property: DNS Service log level.. - * - * @param logLevel DNS Service log level. - * @return the next definition stage. - */ - Update withLogLevel(DnsServiceLogLevelEnum logLevel); - } - - /** - * The stage of the WorkloadNetworkDnsService update allowing to specify revision. + * The stage of the WorkloadNetworkDnsService update allowing to specify properties. */ - interface WithRevision { + interface WithProperties { /** - * Specifies the revision property: NSX revision number.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param revision NSX revision number. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - Update withRevision(Long revision); + Update withProperties(WorkloadNetworkDnsServiceProperties properties); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProperties.java similarity index 96% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProperties.java index a8b579f27b87..a1b70ffd6636 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProperties.java @@ -1,17 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; -import com.azure.resourcemanager.avs.models.DnsServiceStatusEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProvisioningState; import java.io.IOException; import java.util.List; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProvisioningState.java index 3a7245b6d274..69f20c555fcd 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -13,32 +13,32 @@ public final class WorkloadNetworkDnsServiceProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for WorkloadNetworkDnsServiceProvisioningState. + * Resource has been created. */ public static final WorkloadNetworkDnsServiceProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for WorkloadNetworkDnsServiceProvisioningState. + * Resource creation failed. */ public static final WorkloadNetworkDnsServiceProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for WorkloadNetworkDnsServiceProvisioningState. + * Resource creation was canceled. */ public static final WorkloadNetworkDnsServiceProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Building for WorkloadNetworkDnsServiceProvisioningState. + * is building. */ public static final WorkloadNetworkDnsServiceProvisioningState BUILDING = fromString("Building"); /** - * Static value Deleting for WorkloadNetworkDnsServiceProvisioningState. + * is deleting. */ public static final WorkloadNetworkDnsServiceProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for WorkloadNetworkDnsServiceProvisioningState. + * is updating. */ public static final WorkloadNetworkDnsServiceProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZone.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZone.java index b141ff0bbb33..00d03eab6d36 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZone.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZone.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; -import java.util.List; /** * An immutable client-side representation of WorkloadNetworkDnsZone. @@ -35,60 +34,18 @@ public interface WorkloadNetworkDnsZone { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the displayName property: Display name of the DNS Zone. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the domain property: Domain names of the DNS Zone. - * - * @return the domain value. - */ - List domain(); - - /** - * Gets the dnsServerIps property: DNS Server IP array of the DNS Zone. - * - * @return the dnsServerIps value. - */ - List dnsServerIps(); - - /** - * Gets the sourceIp property: Source IP of the DNS Zone. - * - * @return the sourceIp value. - */ - String sourceIp(); - - /** - * Gets the dnsServices property: Number of DNS Services using the DNS zone. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the dnsServices value. + * @return the properties value. */ - Long dnsServices(); + WorkloadNetworkDnsZoneProperties properties(); /** - * Gets the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - WorkloadNetworkDnsZoneProvisioningState provisioningState(); - - /** - * Gets the revision property: NSX revision number. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the revision value. + * @return the systemData value. */ - Long revision(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -126,22 +83,22 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, privateCloudName. + * Specifies resourceGroupName, privateCloudName, workloadNetworkName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @return the next definition stage. */ - WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + WithCreate withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName); } /** * The stage of the WorkloadNetworkDnsZone 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.WithDisplayName, DefinitionStages.WithDomain, DefinitionStages.WithDnsServerIps, - DefinitionStages.WithSourceIp, DefinitionStages.WithDnsServices, DefinitionStages.WithRevision { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -159,81 +116,16 @@ interface WithCreate } /** - * The stage of the WorkloadNetworkDnsZone definition allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the DNS Zone.. - * - * @param displayName Display name of the DNS Zone. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - - /** - * The stage of the WorkloadNetworkDnsZone definition allowing to specify domain. - */ - interface WithDomain { - /** - * Specifies the domain property: Domain names of the DNS Zone.. - * - * @param domain Domain names of the DNS Zone. - * @return the next definition stage. - */ - WithCreate withDomain(List domain); - } - - /** - * The stage of the WorkloadNetworkDnsZone definition allowing to specify dnsServerIps. - */ - interface WithDnsServerIps { - /** - * Specifies the dnsServerIps property: DNS Server IP array of the DNS Zone.. - * - * @param dnsServerIps DNS Server IP array of the DNS Zone. - * @return the next definition stage. - */ - WithCreate withDnsServerIps(List dnsServerIps); - } - - /** - * The stage of the WorkloadNetworkDnsZone definition allowing to specify sourceIp. - */ - interface WithSourceIp { - /** - * Specifies the sourceIp property: Source IP of the DNS Zone.. - * - * @param sourceIp Source IP of the DNS Zone. - * @return the next definition stage. - */ - WithCreate withSourceIp(String sourceIp); - } - - /** - * The stage of the WorkloadNetworkDnsZone definition allowing to specify dnsServices. - */ - interface WithDnsServices { - /** - * Specifies the dnsServices property: Number of DNS Services using the DNS zone.. - * - * @param dnsServices Number of DNS Services using the DNS zone. - * @return the next definition stage. - */ - WithCreate withDnsServices(Long dnsServices); - } - - /** - * The stage of the WorkloadNetworkDnsZone definition allowing to specify revision. + * The stage of the WorkloadNetworkDnsZone definition allowing to specify properties. */ - interface WithRevision { + interface WithProperties { /** - * Specifies the revision property: NSX revision number.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param revision NSX revision number. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withRevision(Long revision); + WithCreate withProperties(WorkloadNetworkDnsZoneProperties properties); } } @@ -247,8 +139,7 @@ interface WithRevision { /** * The template for WorkloadNetworkDnsZone update. */ - interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithDomain, UpdateStages.WithDnsServerIps, - UpdateStages.WithSourceIp, UpdateStages.WithDnsServices, UpdateStages.WithRevision { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -270,81 +161,16 @@ interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithDomain, */ interface UpdateStages { /** - * The stage of the WorkloadNetworkDnsZone update allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the DNS Zone.. - * - * @param displayName Display name of the DNS Zone. - * @return the next definition stage. - */ - Update withDisplayName(String displayName); - } - - /** - * The stage of the WorkloadNetworkDnsZone update allowing to specify domain. - */ - interface WithDomain { - /** - * Specifies the domain property: Domain names of the DNS Zone.. - * - * @param domain Domain names of the DNS Zone. - * @return the next definition stage. - */ - Update withDomain(List domain); - } - - /** - * The stage of the WorkloadNetworkDnsZone update allowing to specify dnsServerIps. - */ - interface WithDnsServerIps { - /** - * Specifies the dnsServerIps property: DNS Server IP array of the DNS Zone.. - * - * @param dnsServerIps DNS Server IP array of the DNS Zone. - * @return the next definition stage. - */ - Update withDnsServerIps(List dnsServerIps); - } - - /** - * The stage of the WorkloadNetworkDnsZone update allowing to specify sourceIp. - */ - interface WithSourceIp { - /** - * Specifies the sourceIp property: Source IP of the DNS Zone.. - * - * @param sourceIp Source IP of the DNS Zone. - * @return the next definition stage. - */ - Update withSourceIp(String sourceIp); - } - - /** - * The stage of the WorkloadNetworkDnsZone update allowing to specify dnsServices. - */ - interface WithDnsServices { - /** - * Specifies the dnsServices property: Number of DNS Services using the DNS zone.. - * - * @param dnsServices Number of DNS Services using the DNS zone. - * @return the next definition stage. - */ - Update withDnsServices(Long dnsServices); - } - - /** - * The stage of the WorkloadNetworkDnsZone update allowing to specify revision. + * The stage of the WorkloadNetworkDnsZone update allowing to specify properties. */ - interface WithRevision { + interface WithProperties { /** - * Specifies the revision property: NSX revision number.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param revision NSX revision number. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - Update withRevision(Long revision); + Update withProperties(WorkloadNetworkDnsZoneProperties properties); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProperties.java similarity index 97% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProperties.java index b0f8c2d3d831..481ee9c2e15c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProperties.java @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProvisioningState; import java.io.IOException; import java.util.List; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProvisioningState.java index 86f1440591dc..36bcc8ec16b2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -13,32 +13,32 @@ public final class WorkloadNetworkDnsZoneProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for WorkloadNetworkDnsZoneProvisioningState. + * Resource has been created. */ public static final WorkloadNetworkDnsZoneProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for WorkloadNetworkDnsZoneProvisioningState. + * Resource creation failed. */ public static final WorkloadNetworkDnsZoneProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for WorkloadNetworkDnsZoneProvisioningState. + * Resource creation was canceled. */ public static final WorkloadNetworkDnsZoneProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Building for WorkloadNetworkDnsZoneProvisioningState. + * is building. */ public static final WorkloadNetworkDnsZoneProvisioningState BUILDING = fromString("Building"); /** - * Static value Deleting for WorkloadNetworkDnsZoneProvisioningState. + * is deleting. */ public static final WorkloadNetworkDnsZoneProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for WorkloadNetworkDnsZoneProvisioningState. + * is updating. */ public static final WorkloadNetworkDnsZoneProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGateway.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGateway.java index fc5f23c15a90..85e2c41b1a7a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGateway.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGateway.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -33,32 +33,18 @@ public interface WorkloadNetworkGateway { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the resource. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the provisioningState value. + * @return the properties value. */ - WorkloadNetworkProvisioningState provisioningState(); + WorkloadNetworkGatewayProperties properties(); /** - * Gets the displayName property: Display name of the DHCP entity. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the path property: NSX Gateway Path. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the path value. + * @return the systemData value. */ - String path(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner object. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayProperties.java similarity index 84% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayProperties.java index 2782a972ae11..9a28b68f1846 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayProperties.java @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.WorkloadNetworkProvisioningState; import java.io.IOException; /** * Properties of a NSX Gateway. */ -@Fluent +@Immutable public final class WorkloadNetworkGatewayProperties implements JsonSerializable { /* * The provisioning state of the resource. @@ -35,7 +34,7 @@ public final class WorkloadNetworkGatewayProperties implements JsonSerializable< /** * Creates an instance of WorkloadNetworkGatewayProperties class. */ - public WorkloadNetworkGatewayProperties() { + private WorkloadNetworkGatewayProperties() { } /** @@ -56,17 +55,6 @@ public String displayName() { return this.displayName; } - /** - * Set the displayName property: Display name of the DHCP entity. - * - * @param displayName the displayName value to set. - * @return the WorkloadNetworkGatewayProperties object itself. - */ - public WorkloadNetworkGatewayProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - /** * Get the path property: NSX Gateway Path. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroring.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroring.java index a446ad3bb381..2405003f68d8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroring.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroring.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -34,60 +34,18 @@ public interface WorkloadNetworkPortMirroring { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the displayName property: Display name of the port mirroring profile. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the direction property: Direction of port mirroring profile. - * - * @return the direction value. - */ - PortMirroringDirectionEnum direction(); - - /** - * Gets the source property: Source VM Group. - * - * @return the source value. - */ - String source(); - - /** - * Gets the destination property: Destination VM Group. - * - * @return the destination value. - */ - String destination(); - - /** - * Gets the status property: Port Mirroring Status. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the status value. + * @return the properties value. */ - PortMirroringStatusEnum status(); + WorkloadNetworkPortMirroringProperties properties(); /** - * Gets the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - WorkloadNetworkPortMirroringProvisioningState provisioningState(); - - /** - * Gets the revision property: NSX revision number. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the revision value. + * @return the systemData value. */ - Long revision(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -125,21 +83,22 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, privateCloudName. + * Specifies resourceGroupName, privateCloudName, workloadNetworkName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @return the next definition stage. */ - WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + WithCreate withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName); } /** * The stage of the WorkloadNetworkPortMirroring 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.WithDisplayName, DefinitionStages.WithDirection, - DefinitionStages.WithSource, DefinitionStages.WithDestination, DefinitionStages.WithRevision { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -157,68 +116,16 @@ interface WithCreate extends DefinitionStages.WithDisplayName, DefinitionStages. } /** - * The stage of the WorkloadNetworkPortMirroring definition allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the port mirroring profile.. - * - * @param displayName Display name of the port mirroring profile. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - - /** - * The stage of the WorkloadNetworkPortMirroring definition allowing to specify direction. - */ - interface WithDirection { - /** - * Specifies the direction property: Direction of port mirroring profile.. - * - * @param direction Direction of port mirroring profile. - * @return the next definition stage. - */ - WithCreate withDirection(PortMirroringDirectionEnum direction); - } - - /** - * The stage of the WorkloadNetworkPortMirroring definition allowing to specify source. - */ - interface WithSource { - /** - * Specifies the source property: Source VM Group.. - * - * @param source Source VM Group. - * @return the next definition stage. - */ - WithCreate withSource(String source); - } - - /** - * The stage of the WorkloadNetworkPortMirroring definition allowing to specify destination. - */ - interface WithDestination { - /** - * Specifies the destination property: Destination VM Group.. - * - * @param destination Destination VM Group. - * @return the next definition stage. - */ - WithCreate withDestination(String destination); - } - - /** - * The stage of the WorkloadNetworkPortMirroring definition allowing to specify revision. + * The stage of the WorkloadNetworkPortMirroring definition allowing to specify properties. */ - interface WithRevision { + interface WithProperties { /** - * Specifies the revision property: NSX revision number.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param revision NSX revision number. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withRevision(Long revision); + WithCreate withProperties(WorkloadNetworkPortMirroringProperties properties); } } @@ -232,8 +139,7 @@ interface WithRevision { /** * The template for WorkloadNetworkPortMirroring update. */ - interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithDirection, UpdateStages.WithSource, - UpdateStages.WithDestination, UpdateStages.WithRevision { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -255,68 +161,16 @@ interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithDirectio */ interface UpdateStages { /** - * The stage of the WorkloadNetworkPortMirroring update allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the port mirroring profile.. - * - * @param displayName Display name of the port mirroring profile. - * @return the next definition stage. - */ - Update withDisplayName(String displayName); - } - - /** - * The stage of the WorkloadNetworkPortMirroring update allowing to specify direction. - */ - interface WithDirection { - /** - * Specifies the direction property: Direction of port mirroring profile.. - * - * @param direction Direction of port mirroring profile. - * @return the next definition stage. - */ - Update withDirection(PortMirroringDirectionEnum direction); - } - - /** - * The stage of the WorkloadNetworkPortMirroring update allowing to specify source. - */ - interface WithSource { - /** - * Specifies the source property: Source VM Group.. - * - * @param source Source VM Group. - * @return the next definition stage. - */ - Update withSource(String source); - } - - /** - * The stage of the WorkloadNetworkPortMirroring update allowing to specify destination. - */ - interface WithDestination { - /** - * Specifies the destination property: Destination VM Group.. - * - * @param destination Destination VM Group. - * @return the next definition stage. - */ - Update withDestination(String destination); - } - - /** - * The stage of the WorkloadNetworkPortMirroring update allowing to specify revision. + * The stage of the WorkloadNetworkPortMirroring update allowing to specify properties. */ - interface WithRevision { + interface WithProperties { /** - * Specifies the revision property: NSX revision number.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param revision NSX revision number. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - Update withRevision(Long revision); + Update withProperties(WorkloadNetworkPortMirroringProperties properties); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProperties.java similarity index 95% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProperties.java index 68ae5d148f4c..3aa13eb8f98b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProperties.java @@ -1,17 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; -import com.azure.resourcemanager.avs.models.PortMirroringStatusEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProvisioningState; import java.io.IOException; /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProvisioningState.java index f68e65097b5b..f01980545b19 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -13,32 +13,32 @@ public final class WorkloadNetworkPortMirroringProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for WorkloadNetworkPortMirroringProvisioningState. + * Resource has been created. */ public static final WorkloadNetworkPortMirroringProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for WorkloadNetworkPortMirroringProvisioningState. + * Resource creation failed. */ public static final WorkloadNetworkPortMirroringProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for WorkloadNetworkPortMirroringProvisioningState. + * Resource creation was canceled. */ public static final WorkloadNetworkPortMirroringProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Building for WorkloadNetworkPortMirroringProvisioningState. + * is building. */ public static final WorkloadNetworkPortMirroringProvisioningState BUILDING = fromString("Building"); /** - * Static value Deleting for WorkloadNetworkPortMirroringProvisioningState. + * is deleting. */ public static final WorkloadNetworkPortMirroringProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for WorkloadNetworkPortMirroringProvisioningState. + * is updating. */ public static final WorkloadNetworkPortMirroringProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkProperties.java similarity index 91% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkProperties.java index 027ce7b763e9..852c68315000 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkProperties.java @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.WorkloadNetworkProvisioningState; import java.io.IOException; /** @@ -25,7 +24,7 @@ public final class WorkloadNetworkProperties implements JsonSerializable { /** - * Static value Succeeded for WorkloadNetworkProvisioningState. + * Resource has been created. */ public static final WorkloadNetworkProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for WorkloadNetworkProvisioningState. + * Resource creation failed. */ public static final WorkloadNetworkProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for WorkloadNetworkProvisioningState. + * Resource creation was canceled. */ public static final WorkloadNetworkProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Building for WorkloadNetworkProvisioningState. + * is building. */ public static final WorkloadNetworkProvisioningState BUILDING = fromString("Building"); /** - * Static value Deleting for WorkloadNetworkProvisioningState. + * is deleting. */ public static final WorkloadNetworkProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for WorkloadNetworkProvisioningState. + * is updating. */ public static final WorkloadNetworkProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIp.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIp.java index fada5305c0ad..7a0925711d48 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIp.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIp.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -34,39 +34,18 @@ public interface WorkloadNetworkPublicIp { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the displayName property: Display name of the Public IP Block. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the numberOfPublicIPs property: Number of Public IPs requested. - * - * @return the numberOfPublicIPs value. - */ - Long numberOfPublicIPs(); - - /** - * Gets the publicIpBlock property: CIDR Block of the Public IP Block. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the publicIpBlock value. + * @return the properties value. */ - String publicIpBlock(); + WorkloadNetworkPublicIpProperties properties(); /** - * Gets the provisioningState property: The provisioning state. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the provisioningState value. + * @return the systemData value. */ - WorkloadNetworkPublicIpProvisioningState provisioningState(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner object. @@ -97,20 +76,22 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, privateCloudName. + * Specifies resourceGroupName, privateCloudName, workloadNetworkName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @return the next definition stage. */ - WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + WithCreate withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName); } /** * The stage of the WorkloadNetworkPublicIp 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.WithDisplayName, DefinitionStages.WithNumberOfPublicIPs { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -128,29 +109,16 @@ interface WithCreate extends DefinitionStages.WithDisplayName, DefinitionStages. } /** - * The stage of the WorkloadNetworkPublicIp definition allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the Public IP Block.. - * - * @param displayName Display name of the Public IP Block. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - - /** - * The stage of the WorkloadNetworkPublicIp definition allowing to specify numberOfPublicIPs. + * The stage of the WorkloadNetworkPublicIp definition allowing to specify properties. */ - interface WithNumberOfPublicIPs { + interface WithProperties { /** - * Specifies the numberOfPublicIPs property: Number of Public IPs requested.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param numberOfPublicIPs Number of Public IPs requested. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withNumberOfPublicIPs(Long numberOfPublicIPs); + WithCreate withProperties(WorkloadNetworkPublicIpProperties properties); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIpProperties.java similarity index 96% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIpProperties.java index 0b766135aed7..1737dd90b6e9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIpProperties.java @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIpProvisioningState; import java.io.IOException; /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIpProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIpProvisioningState.java index 0e264a22523d..7f56e833e8a6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIpProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIpProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -13,32 +13,32 @@ public final class WorkloadNetworkPublicIpProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for WorkloadNetworkPublicIpProvisioningState. + * Resource has been created. */ public static final WorkloadNetworkPublicIpProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for WorkloadNetworkPublicIpProvisioningState. + * Resource creation failed. */ public static final WorkloadNetworkPublicIpProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for WorkloadNetworkPublicIpProvisioningState. + * Resource creation was canceled. */ public static final WorkloadNetworkPublicIpProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Building for WorkloadNetworkPublicIpProvisioningState. + * is building. */ public static final WorkloadNetworkPublicIpProvisioningState BUILDING = fromString("Building"); /** - * Static value Deleting for WorkloadNetworkPublicIpProvisioningState. + * is deleting. */ public static final WorkloadNetworkPublicIpProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for WorkloadNetworkPublicIpProvisioningState. + * is updating. */ public static final WorkloadNetworkPublicIpProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegment.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegment.java index 47bcaa0510d6..e1a5fc63d727 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegment.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegment.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; -import java.util.List; /** * An immutable client-side representation of WorkloadNetworkSegment. @@ -35,60 +34,18 @@ public interface WorkloadNetworkSegment { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the displayName property: Display name of the segment. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the connectedGateway property: Gateway which to connect segment to. - * - * @return the connectedGateway value. - */ - String connectedGateway(); - - /** - * Gets the subnet property: Subnet which to connect segment to. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the subnet value. + * @return the properties value. */ - WorkloadNetworkSegmentSubnet subnet(); + WorkloadNetworkSegmentProperties properties(); /** - * Gets the portVif property: Port Vif which segment is associated with. - * - * @return the portVif value. - */ - List portVif(); - - /** - * Gets the status property: Segment status. - * - * @return the status value. - */ - SegmentStatusEnum status(); - - /** - * Gets the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - WorkloadNetworkSegmentProvisioningState provisioningState(); - - /** - * Gets the revision property: NSX revision number. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the revision value. + * @return the systemData value. */ - Long revision(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -126,21 +83,22 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, privateCloudName. + * Specifies resourceGroupName, privateCloudName, workloadNetworkName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @return the next definition stage. */ - WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + WithCreate withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName); } /** * The stage of the WorkloadNetworkSegment 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.WithDisplayName, DefinitionStages.WithConnectedGateway, - DefinitionStages.WithSubnet, DefinitionStages.WithRevision { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -158,55 +116,16 @@ interface WithCreate extends DefinitionStages.WithDisplayName, DefinitionStages. } /** - * The stage of the WorkloadNetworkSegment definition allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the segment.. - * - * @param displayName Display name of the segment. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - - /** - * The stage of the WorkloadNetworkSegment definition allowing to specify connectedGateway. - */ - interface WithConnectedGateway { - /** - * Specifies the connectedGateway property: Gateway which to connect segment to.. - * - * @param connectedGateway Gateway which to connect segment to. - * @return the next definition stage. - */ - WithCreate withConnectedGateway(String connectedGateway); - } - - /** - * The stage of the WorkloadNetworkSegment definition allowing to specify subnet. - */ - interface WithSubnet { - /** - * Specifies the subnet property: Subnet which to connect segment to.. - * - * @param subnet Subnet which to connect segment to. - * @return the next definition stage. - */ - WithCreate withSubnet(WorkloadNetworkSegmentSubnet subnet); - } - - /** - * The stage of the WorkloadNetworkSegment definition allowing to specify revision. + * The stage of the WorkloadNetworkSegment definition allowing to specify properties. */ - interface WithRevision { + interface WithProperties { /** - * Specifies the revision property: NSX revision number.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param revision NSX revision number. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withRevision(Long revision); + WithCreate withProperties(WorkloadNetworkSegmentProperties properties); } } @@ -220,8 +139,7 @@ interface WithRevision { /** * The template for WorkloadNetworkSegment update. */ - interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithConnectedGateway, UpdateStages.WithSubnet, - UpdateStages.WithRevision { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -243,55 +161,16 @@ interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithConnecte */ interface UpdateStages { /** - * The stage of the WorkloadNetworkSegment update allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the segment.. - * - * @param displayName Display name of the segment. - * @return the next definition stage. - */ - Update withDisplayName(String displayName); - } - - /** - * The stage of the WorkloadNetworkSegment update allowing to specify connectedGateway. - */ - interface WithConnectedGateway { - /** - * Specifies the connectedGateway property: Gateway which to connect segment to.. - * - * @param connectedGateway Gateway which to connect segment to. - * @return the next definition stage. - */ - Update withConnectedGateway(String connectedGateway); - } - - /** - * The stage of the WorkloadNetworkSegment update allowing to specify subnet. - */ - interface WithSubnet { - /** - * Specifies the subnet property: Subnet which to connect segment to.. - * - * @param subnet Subnet which to connect segment to. - * @return the next definition stage. - */ - Update withSubnet(WorkloadNetworkSegmentSubnet subnet); - } - - /** - * The stage of the WorkloadNetworkSegment update allowing to specify revision. + * The stage of the WorkloadNetworkSegment update allowing to specify properties. */ - interface WithRevision { + interface WithProperties { /** - * Specifies the revision property: NSX revision number.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param revision NSX revision number. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - Update withRevision(Long revision); + Update withProperties(WorkloadNetworkSegmentProperties properties); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentPortVif.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentPortVif.java index 7083990dc7b5..32c5a4e85f31 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentPortVif.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentPortVif.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Ports and any VIF attached to segment. */ -@Fluent +@Immutable public final class WorkloadNetworkSegmentPortVif implements JsonSerializable { /* * Name of port or VIF attached to segment. @@ -24,7 +24,7 @@ public final class WorkloadNetworkSegmentPortVif implements JsonSerializable { /** - * Static value Succeeded for WorkloadNetworkSegmentProvisioningState. + * Resource has been created. */ public static final WorkloadNetworkSegmentProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for WorkloadNetworkSegmentProvisioningState. + * Resource creation failed. */ public static final WorkloadNetworkSegmentProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for WorkloadNetworkSegmentProvisioningState. + * Resource creation was canceled. */ public static final WorkloadNetworkSegmentProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Building for WorkloadNetworkSegmentProvisioningState. + * is building. */ public static final WorkloadNetworkSegmentProvisioningState BUILDING = fromString("Building"); /** - * Static value Deleting for WorkloadNetworkSegmentProvisioningState. + * is deleting. */ public static final WorkloadNetworkSegmentProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for WorkloadNetworkSegmentProvisioningState. + * is updating. */ public static final WorkloadNetworkSegmentProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentSubnet.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentSubnet.java index 9521121042ad..a4a5a4234f92 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentSubnet.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentSubnet.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroup.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroup.java index cb464c2ecfae..7207712e05a5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroup.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroup.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; -import java.util.List; /** * An immutable client-side representation of WorkloadNetworkVMGroup. @@ -35,46 +34,18 @@ public interface WorkloadNetworkVMGroup { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the displayName property: Display name of the VM group. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the displayName value. + * @return the properties value. */ - String displayName(); + WorkloadNetworkVMGroupProperties properties(); /** - * Gets the members property: Virtual machine members of this group. - * - * @return the members value. - */ - List members(); - - /** - * Gets the status property: VM Group status. - * - * @return the status value. - */ - VMGroupStatusEnum status(); - - /** - * Gets the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - WorkloadNetworkVMGroupProvisioningState provisioningState(); - - /** - * Gets the revision property: NSX revision number. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the revision value. + * @return the systemData value. */ - Long revision(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -112,21 +83,22 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, privateCloudName. + * Specifies resourceGroupName, privateCloudName, workloadNetworkName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @return the next definition stage. */ - WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + WithCreate withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName, + String workloadNetworkName); } /** * The stage of the WorkloadNetworkVMGroup 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.WithDisplayName, DefinitionStages.WithMembers, DefinitionStages.WithRevision { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -144,42 +116,16 @@ interface WithCreate } /** - * The stage of the WorkloadNetworkVMGroup definition allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the VM group.. - * - * @param displayName Display name of the VM group. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - - /** - * The stage of the WorkloadNetworkVMGroup definition allowing to specify members. - */ - interface WithMembers { - /** - * Specifies the members property: Virtual machine members of this group.. - * - * @param members Virtual machine members of this group. - * @return the next definition stage. - */ - WithCreate withMembers(List members); - } - - /** - * The stage of the WorkloadNetworkVMGroup definition allowing to specify revision. + * The stage of the WorkloadNetworkVMGroup definition allowing to specify properties. */ - interface WithRevision { + interface WithProperties { /** - * Specifies the revision property: NSX revision number.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param revision NSX revision number. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withRevision(Long revision); + WithCreate withProperties(WorkloadNetworkVMGroupProperties properties); } } @@ -193,7 +139,7 @@ interface WithRevision { /** * The template for WorkloadNetworkVMGroup update. */ - interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithMembers, UpdateStages.WithRevision { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -215,42 +161,16 @@ interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithMembers, */ interface UpdateStages { /** - * The stage of the WorkloadNetworkVMGroup update allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the VM group.. - * - * @param displayName Display name of the VM group. - * @return the next definition stage. - */ - Update withDisplayName(String displayName); - } - - /** - * The stage of the WorkloadNetworkVMGroup update allowing to specify members. - */ - interface WithMembers { - /** - * Specifies the members property: Virtual machine members of this group.. - * - * @param members Virtual machine members of this group. - * @return the next definition stage. - */ - Update withMembers(List members); - } - - /** - * The stage of the WorkloadNetworkVMGroup update allowing to specify revision. + * The stage of the WorkloadNetworkVMGroup update allowing to specify properties. */ - interface WithRevision { + interface WithProperties { /** - * Specifies the revision property: NSX revision number.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param revision NSX revision number. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - Update withRevision(Long revision); + Update withProperties(WorkloadNetworkVMGroupProperties properties); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProperties.java similarity index 95% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProperties.java index a1f2658d86cd..f0027825b995 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProperties.java @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.VMGroupStatusEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProvisioningState; import java.io.IOException; import java.util.List; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProvisioningState.java index bbc70c1181ac..956bddde1c75 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProvisioningState.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -13,32 +13,32 @@ public final class WorkloadNetworkVMGroupProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for WorkloadNetworkVMGroupProvisioningState. + * Resource has been created. */ public static final WorkloadNetworkVMGroupProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for WorkloadNetworkVMGroupProvisioningState. + * Resource creation failed. */ public static final WorkloadNetworkVMGroupProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for WorkloadNetworkVMGroupProvisioningState. + * Resource creation was canceled. */ public static final WorkloadNetworkVMGroupProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Building for WorkloadNetworkVMGroupProvisioningState. + * is building. */ public static final WorkloadNetworkVMGroupProvisioningState BUILDING = fromString("Building"); /** - * Static value Deleting for WorkloadNetworkVMGroupProvisioningState. + * is deleting. */ public static final WorkloadNetworkVMGroupProvisioningState DELETING = fromString("Deleting"); /** - * Static value Updating for WorkloadNetworkVMGroupProvisioningState. + * is updating. */ public static final WorkloadNetworkVMGroupProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachine.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachine.java index fa22a3fccf0e..3e933999887b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachine.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachine.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -33,32 +33,18 @@ public interface WorkloadNetworkVirtualMachine { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: The provisioning state of the resource. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the provisioningState value. + * @return the properties value. */ - WorkloadNetworkProvisioningState provisioningState(); + WorkloadNetworkVirtualMachineProperties properties(); /** - * Gets the displayName property: Display name of the VM. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the vmType property: Virtual machine type. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the vmType value. + * @return the systemData value. */ - VMTypeEnum vmType(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner object. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachineProperties.java similarity index 83% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachineProperties.java index 2e0f59180e60..2647bfc9b3a5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachineProperties.java @@ -1,22 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.avs.fluent.models; +package com.azure.resourcemanager.avs.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.avs.models.VMTypeEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkProvisioningState; import java.io.IOException; /** * NSX Virtual Machine Properties. */ -@Fluent +@Immutable public final class WorkloadNetworkVirtualMachineProperties implements JsonSerializable { /* @@ -37,7 +35,7 @@ public final class WorkloadNetworkVirtualMachineProperties /** * Creates an instance of WorkloadNetworkVirtualMachineProperties class. */ - public WorkloadNetworkVirtualMachineProperties() { + private WorkloadNetworkVirtualMachineProperties() { } /** @@ -58,17 +56,6 @@ public String displayName() { return this.displayName; } - /** - * Set the displayName property: Display name of the VM. - * - * @param displayName the displayName value to set. - * @return the WorkloadNetworkVirtualMachineProperties object itself. - */ - public WorkloadNetworkVirtualMachineProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - /** * Get the vmType property: Virtual machine type. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworks.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworks.java index e0b2c8394d12..a86f6e8aa080 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworks.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworks.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.models; @@ -42,50 +42,57 @@ public interface WorkloadNetworks { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 WorkloadNetwork along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String privateCloudName, Context context); + Response getWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, Context context); /** * Get a WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 WorkloadNetwork. */ - WorkloadNetwork get(String resourceGroupName, String privateCloudName); + WorkloadNetwork get(String resourceGroupName, String privateCloudName, String workloadNetworkName); /** * List WorkloadNetworkDhcp resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listDhcp(String resourceGroupName, String privateCloudName); + PagedIterable listDhcp(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkDhcp resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listDhcp(String resourceGroupName, String privateCloudName, Context context); + PagedIterable listDhcp(String resourceGroupName, String privateCloudName, + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkDhcp. @@ -120,44 +127,50 @@ Response getDhcpWithResponse(String resourceGroupName, Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId); + void deleteDhcp(String resourceGroupName, String privateCloudName, String workloadNetworkName, String dhcpId); /** * Delete a WorkloadNetworkDhcp. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dhcpId The ID of the DHCP 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 deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context); + void deleteDhcp(String resourceGroupName, String privateCloudName, String workloadNetworkName, String dhcpId, + Context context); /** * List WorkloadNetworkDnsService resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkDnsService list operation as paginated response with * {@link PagedIterable}. */ - PagedIterable listDnsServices(String resourceGroupName, String privateCloudName); + PagedIterable listDnsService(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkDnsService resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -165,14 +178,15 @@ Response getDhcpWithResponse(String resourceGroupName, Stri * @return the response of a WorkloadNetworkDnsService list operation as paginated response with * {@link PagedIterable}. */ - PagedIterable listDnsServices(String resourceGroupName, String privateCloudName, - Context context); + PagedIterable listDnsService(String resourceGroupName, String privateCloudName, + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkDnsService. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -181,20 +195,22 @@ PagedIterable listDnsServices(String resourceGroupNam * @return a WorkloadNetworkDnsService along with {@link Response}. */ Response getDnsServiceWithResponse(String resourceGroupName, String privateCloudName, - String dnsServiceId, Context context); + String workloadNetworkName, String dnsServiceId, Context context); /** * Get a WorkloadNetworkDnsService. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsServiceId ID of the DNS service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a WorkloadNetworkDnsService. */ - WorkloadNetworkDnsService getDnsService(String resourceGroupName, String privateCloudName, String dnsServiceId); + WorkloadNetworkDnsService getDnsService(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String dnsServiceId); /** * Delete a WorkloadNetworkDnsService. @@ -226,18 +242,21 @@ Response getDnsServiceWithResponse(String resourceGro * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listDnsZones(String resourceGroupName, String privateCloudName); + PagedIterable listDnsZones(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkDnsZone resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -245,13 +264,14 @@ Response getDnsServiceWithResponse(String resourceGro * @return the response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedIterable}. */ PagedIterable listDnsZones(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkDnsZone. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -260,20 +280,22 @@ PagedIterable listDnsZones(String resourceGroupName, Str * @return a WorkloadNetworkDnsZone along with {@link Response}. */ Response getDnsZoneWithResponse(String resourceGroupName, String privateCloudName, - String dnsZoneId, Context context); + String workloadNetworkName, String dnsZoneId, Context context); /** * Get a WorkloadNetworkDnsZone. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param dnsZoneId ID of the DNS zone. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 WorkloadNetworkDnsZone. */ - WorkloadNetworkDnsZone getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId); + WorkloadNetworkDnsZone getDnsZone(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String dnsZoneId); /** * Delete a WorkloadNetworkDnsZone. @@ -305,18 +327,21 @@ Response getDnsZoneWithResponse(String resourceGroupName * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listGateways(String resourceGroupName, String privateCloudName); + PagedIterable listGateways(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkGateway resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -324,13 +349,14 @@ Response getDnsZoneWithResponse(String resourceGroupName * @return the response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedIterable}. */ PagedIterable listGateways(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkGateway. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param gatewayId The ID of the NSX Gateway. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -339,39 +365,44 @@ PagedIterable listGateways(String resourceGroupName, Str * @return a WorkloadNetworkGateway along with {@link Response}. */ Response getGatewayWithResponse(String resourceGroupName, String privateCloudName, - String gatewayId, Context context); + String workloadNetworkName, String gatewayId, Context context); /** * Get a WorkloadNetworkGateway. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param gatewayId The ID of the NSX Gateway. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 WorkloadNetworkGateway. */ - WorkloadNetworkGateway getGateway(String resourceGroupName, String privateCloudName, String gatewayId); + WorkloadNetworkGateway getGateway(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String gatewayId); /** * List WorkloadNetworkPortMirroring resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkPortMirroring list operation as paginated response with * {@link PagedIterable}. */ - PagedIterable listPortMirroring(String resourceGroupName, String privateCloudName); + PagedIterable listPortMirroring(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkPortMirroring resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -380,13 +411,14 @@ Response getGatewayWithResponse(String resourceGroupName * {@link PagedIterable}. */ PagedIterable listPortMirroring(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkPortMirroring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -395,13 +427,14 @@ PagedIterable listPortMirroring(String resourceGro * @return a WorkloadNetworkPortMirroring along with {@link Response}. */ Response getPortMirroringWithResponse(String resourceGroupName, - String privateCloudName, String portMirroringId, Context context); + String privateCloudName, String workloadNetworkName, String portMirroringId, Context context); /** * Get a WorkloadNetworkPortMirroring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param portMirroringId ID of the NSX port mirroring profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -409,7 +442,7 @@ Response getPortMirroringWithResponse(String resou * @return a WorkloadNetworkPortMirroring. */ WorkloadNetworkPortMirroring getPortMirroring(String resourceGroupName, String privateCloudName, - String portMirroringId); + String workloadNetworkName, String portMirroringId); /** * Delete a WorkloadNetworkPortMirroring. @@ -442,19 +475,22 @@ void deletePortMirroring(String resourceGroupName, String portMirroringId, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkPublicIP list operation as paginated response with * {@link PagedIterable}. */ - PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName); + PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkPublicIP resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -463,78 +499,84 @@ void deletePortMirroring(String resourceGroupName, String portMirroringId, Strin * {@link PagedIterable}. */ PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 WorkloadNetworkPublicIP along with {@link Response}. */ - Response getPublicIpWithResponse(String resourceGroupName, String privateCloudName, - String publicIpId, Context context); + Response getPublicIPWithResponse(String resourceGroupName, String privateCloudName, + String workloadNetworkName, String publicIPId, Context context); /** * Get a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. - * @param publicIpId ID of the DNS zone. + * @param workloadNetworkName Name of the global reach connection. + * @param publicIPId ID of the DNS zone. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 WorkloadNetworkPublicIP. */ - WorkloadNetworkPublicIp getPublicIp(String resourceGroupName, String privateCloudName, String publicIpId); + WorkloadNetworkPublicIp getPublicIP(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String publicIPId); /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName); + void deletePublicIP(String resourceGroupName, String publicIPId, String privateCloudName); /** * Delete a WorkloadNetworkPublicIP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param publicIpId ID of the DNS zone. + * @param publicIPId ID of the DNS zone. * @param privateCloudName Name of the private cloud. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName, Context context); + void deletePublicIP(String resourceGroupName, String publicIPId, String privateCloudName, Context context); /** * List WorkloadNetworkSegment resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkSegment list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listSegments(String resourceGroupName, String privateCloudName); + PagedIterable listSegments(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkSegment resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -542,13 +584,14 @@ Response getPublicIpWithResponse(String resourceGroupNa * @return the response of a WorkloadNetworkSegment list operation as paginated response with {@link PagedIterable}. */ PagedIterable listSegments(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -557,64 +600,72 @@ PagedIterable listSegments(String resourceGroupName, Str * @return a WorkloadNetworkSegment along with {@link Response}. */ Response getSegmentWithResponse(String resourceGroupName, String privateCloudName, - String segmentId, Context context); + String workloadNetworkName, String segmentId, Context context); /** * Get a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 WorkloadNetworkSegment. */ - WorkloadNetworkSegment getSegment(String resourceGroupName, String privateCloudName, String segmentId); + WorkloadNetworkSegment getSegment(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String segmentId); /** * Delete a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId); + void deleteSegment(String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId); /** * Delete a WorkloadNetworkSegment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param segmentId The ID of the NSX Segment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context); + void deleteSegment(String resourceGroupName, String privateCloudName, String workloadNetworkName, String segmentId, + Context context); /** * List WorkloadNetworkVirtualMachine resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkVirtualMachine list operation as paginated response with * {@link PagedIterable}. */ - PagedIterable listVirtualMachines(String resourceGroupName, String privateCloudName); + PagedIterable listVirtualMachines(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkVirtualMachine resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -623,13 +674,14 @@ Response getSegmentWithResponse(String resourceGroupName * {@link PagedIterable}. */ PagedIterable listVirtualMachines(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkVirtualMachine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param virtualMachineId ID of the virtual machine. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -638,13 +690,14 @@ PagedIterable listVirtualMachines(String resource * @return a WorkloadNetworkVirtualMachine along with {@link Response}. */ Response getVirtualMachineWithResponse(String resourceGroupName, - String privateCloudName, String virtualMachineId, Context context); + String privateCloudName, String workloadNetworkName, String virtualMachineId, Context context); /** * Get a WorkloadNetworkVirtualMachine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param virtualMachineId ID of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -652,25 +705,28 @@ Response getVirtualMachineWithResponse(String res * @return a WorkloadNetworkVirtualMachine. */ WorkloadNetworkVirtualMachine getVirtualMachine(String resourceGroupName, String privateCloudName, - String virtualMachineId); + String workloadNetworkName, String virtualMachineId); /** * List WorkloadNetworkVMGroup resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a WorkloadNetworkVMGroup list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listVMGroups(String resourceGroupName, String privateCloudName); + PagedIterable listVMGroups(String resourceGroupName, String privateCloudName, + String workloadNetworkName); /** * List WorkloadNetworkVMGroup resources by WorkloadNetwork. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -678,13 +734,14 @@ WorkloadNetworkVirtualMachine getVirtualMachine(String resourceGroupName, String * @return the response of a WorkloadNetworkVMGroup list operation as paginated response with {@link PagedIterable}. */ PagedIterable listVMGroups(String resourceGroupName, String privateCloudName, - Context context); + String workloadNetworkName, Context context); /** * Get a WorkloadNetworkVMGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -693,20 +750,22 @@ PagedIterable listVMGroups(String resourceGroupName, Str * @return a WorkloadNetworkVMGroup along with {@link Response}. */ Response getVMGroupWithResponse(String resourceGroupName, String privateCloudName, - String vmGroupId, Context context); + String workloadNetworkName, String vmGroupId, Context context); /** * Get a WorkloadNetworkVMGroup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. + * @param workloadNetworkName Name of the global reach connection. * @param vmGroupId ID of the VM group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 WorkloadNetworkVMGroup. */ - WorkloadNetworkVMGroup getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId); + WorkloadNetworkVMGroup getVMGroup(String resourceGroupName, String privateCloudName, String workloadNetworkName, + String vmGroupId); /** * Delete a WorkloadNetworkVMGroup. @@ -733,29 +792,6 @@ Response getVMGroupWithResponse(String resourceGroupName */ void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName, Context context); - /** - * Get a WorkloadNetworkDhcp. - * - * @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 WorkloadNetworkDhcp along with {@link Response}. - */ - WorkloadNetworkDhcp getDhcpById(String id); - - /** - * Get a WorkloadNetworkDhcp. - * - * @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 WorkloadNetworkDhcp along with {@link Response}. - */ - Response getDhcpByIdWithResponse(String id, Context context); - /** * Get a WorkloadNetworkDnsService. * @@ -834,7 +870,7 @@ Response getVMGroupWithResponse(String resourceGroupName * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a WorkloadNetworkPublicIP along with {@link Response}. */ - WorkloadNetworkPublicIp getPublicIpById(String id); + WorkloadNetworkPublicIp getPublicIPById(String id); /** * Get a WorkloadNetworkPublicIP. @@ -846,7 +882,7 @@ Response getVMGroupWithResponse(String resourceGroupName * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a WorkloadNetworkPublicIP along with {@link Response}. */ - Response getPublicIpByIdWithResponse(String id, Context context); + Response getPublicIPByIdWithResponse(String id, Context context); /** * Get a WorkloadNetworkSegment. @@ -915,90 +951,6 @@ Response getVMGroupWithResponse(String resourceGroupName */ void deleteDhcpByIdWithResponse(String id, Context context); - /** - * Delete a WorkloadNetworkDnsService. - * - * @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 deleteDnsServiceById(String id); - - /** - * Delete a WorkloadNetworkDnsService. - * - * @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 deleteDnsServiceByIdWithResponse(String id, Context context); - - /** - * Delete a WorkloadNetworkDnsZone. - * - * @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 deleteDnsZoneById(String id); - - /** - * Delete a WorkloadNetworkDnsZone. - * - * @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 deleteDnsZoneByIdWithResponse(String id, Context context); - - /** - * Delete a WorkloadNetworkPortMirroring. - * - * @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 deletePortMirroringById(String id); - - /** - * Delete a WorkloadNetworkPortMirroring. - * - * @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 deletePortMirroringByIdWithResponse(String id, Context context); - - /** - * Delete a WorkloadNetworkPublicIP. - * - * @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 deletePublicIpById(String id); - - /** - * Delete a WorkloadNetworkPublicIP. - * - * @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 deletePublicIpByIdWithResponse(String id, Context context); - /** * Delete a WorkloadNetworkSegment. * @@ -1020,27 +972,6 @@ Response getVMGroupWithResponse(String resourceGroupName */ void deleteSegmentByIdWithResponse(String id, Context context); - /** - * Delete a WorkloadNetworkVMGroup. - * - * @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 deleteVMGroupById(String id); - - /** - * Delete a WorkloadNetworkVMGroup. - * - * @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 deleteVMGroupByIdWithResponse(String id, Context context); - /** * Begins definition for a new WorkloadNetworkDhcp resource. * @@ -1079,7 +1010,7 @@ Response getVMGroupWithResponse(String resourceGroupName * @param name resource name. * @return the first stage of the new WorkloadNetworkPublicIp definition. */ - WorkloadNetworkPublicIp.DefinitionStages.Blank definePublicIp(String name); + WorkloadNetworkPublicIp.DefinitionStages.Blank definePublicIP(String name); /** * Begins definition for a new WorkloadNetworkSegment resource. @@ -1087,7 +1018,7 @@ Response getVMGroupWithResponse(String resourceGroupName * @param name resource name. * @return the first stage of the new WorkloadNetworkSegment definition. */ - WorkloadNetworkSegment.DefinitionStages.Blank defineSegments(String name); + WorkloadNetworkSegment.DefinitionStages.Blank defineSegment(String name); /** * Begins definition for a new WorkloadNetworkVMGroup resource. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/package-info.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/package-info.java index 6324b6c91578..5861083294c4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/package-info.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for AvsClient. + * Package containing the data models for Avs. * Azure VMware Solution API. */ package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/package-info.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/package-info.java index 5c45a9ed54e5..b6b9d1926f20 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/package-info.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for AvsClient. + * Package containing the classes for Avs. * Azure VMware Solution API. */ package com.azure.resourcemanager.avs; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/module-info.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/module-info.java index 87b5358a052c..50aced2f8e9c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/module-info.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.avs { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.avs.fluent.models to com.azure.core; opens com.azure.resourcemanager.avs.models to com.azure.core; + opens com.azure.resourcemanager.avs.implementation.models to com.azure.core; } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-avs/proxy-config.json b/sdk/avs/azure-resourcemanager-avs/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-avs/proxy-config.json index 4c04471a4cd3..4d4ce7a23dcf 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-avs/proxy-config.json +++ b/sdk/avs/azure-resourcemanager-avs/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-avs/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.avs.implementation.AddonsClientImpl$AddonsService"],["com.azure.resourcemanager.avs.implementation.AuthorizationsClientImpl$AuthorizationsService"],["com.azure.resourcemanager.avs.implementation.CloudLinksClientImpl$CloudLinksService"],["com.azure.resourcemanager.avs.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.avs.implementation.DatastoresClientImpl$DatastoresService"],["com.azure.resourcemanager.avs.implementation.GlobalReachConnectionsClientImpl$GlobalReachConnectionsService"],["com.azure.resourcemanager.avs.implementation.HcxEnterpriseSitesClientImpl$HcxEnterpriseSitesService"],["com.azure.resourcemanager.avs.implementation.IscsiPathsClientImpl$IscsiPathsService"],["com.azure.resourcemanager.avs.implementation.LocationsClientImpl$LocationsService"],["com.azure.resourcemanager.avs.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.avs.implementation.PlacementPoliciesClientImpl$PlacementPoliciesService"],["com.azure.resourcemanager.avs.implementation.PrivateCloudsClientImpl$PrivateCloudsService"],["com.azure.resourcemanager.avs.implementation.ScriptCmdletsClientImpl$ScriptCmdletsService"],["com.azure.resourcemanager.avs.implementation.ScriptExecutionsClientImpl$ScriptExecutionsService"],["com.azure.resourcemanager.avs.implementation.ScriptPackagesClientImpl$ScriptPackagesService"],["com.azure.resourcemanager.avs.implementation.VirtualMachinesClientImpl$VirtualMachinesService"],["com.azure.resourcemanager.avs.implementation.WorkloadNetworksClientImpl$WorkloadNetworksService"]] \ No newline at end of file +[["com.azure.resourcemanager.avs.implementation.AddonsClientImpl$AddonsService"],["com.azure.resourcemanager.avs.implementation.AuthorizationsClientImpl$AuthorizationsService"],["com.azure.resourcemanager.avs.implementation.CloudLinksClientImpl$CloudLinksService"],["com.azure.resourcemanager.avs.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.avs.implementation.DatastoresClientImpl$DatastoresService"],["com.azure.resourcemanager.avs.implementation.GlobalReachConnectionsClientImpl$GlobalReachConnectionsService"],["com.azure.resourcemanager.avs.implementation.HcxEnterpriseSitesClientImpl$HcxEnterpriseSitesService"],["com.azure.resourcemanager.avs.implementation.HostsClientImpl$HostsService"],["com.azure.resourcemanager.avs.implementation.IscsiPathsClientImpl$IscsiPathsService"],["com.azure.resourcemanager.avs.implementation.LocationsClientImpl$LocationsService"],["com.azure.resourcemanager.avs.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.avs.implementation.PlacementPoliciesClientImpl$PlacementPoliciesService"],["com.azure.resourcemanager.avs.implementation.PrivateCloudsClientImpl$PrivateCloudsService"],["com.azure.resourcemanager.avs.implementation.ProvisionedNetworksClientImpl$ProvisionedNetworksService"],["com.azure.resourcemanager.avs.implementation.ScriptCmdletsClientImpl$ScriptCmdletsService"],["com.azure.resourcemanager.avs.implementation.ScriptExecutionsClientImpl$ScriptExecutionsService"],["com.azure.resourcemanager.avs.implementation.ScriptPackagesClientImpl$ScriptPackagesService"],["com.azure.resourcemanager.avs.implementation.SkusClientImpl$SkusService"],["com.azure.resourcemanager.avs.implementation.VirtualMachinesClientImpl$VirtualMachinesService"],["com.azure.resourcemanager.avs.implementation.WorkloadNetworksClientImpl$WorkloadNetworksService"]] \ No newline at end of file diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/resources/azure-resourcemanager-avs.properties b/sdk/avs/azure-resourcemanager-avs/src/main/resources/azure-resourcemanager-avs.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/resources/azure-resourcemanager-avs.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsCreateOrUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsCreateOrUpdateSamples.java index 14808360094a..c81a2c77aff8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsCreateOrUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -14,8 +14,7 @@ */ public final class AddonsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_HCX.json + * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_HCX.json */ /** * Sample code: Addons_CreateOrUpdate_HCX. @@ -31,8 +30,7 @@ public static void addonsCreateOrUpdateHCX(com.azure.resourcemanager.avs.AvsMana } /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_SRM.json + * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_SRM.json */ /** * Sample code: Addons_CreateOrUpdate_SRM. @@ -48,8 +46,25 @@ public static void addonsCreateOrUpdateSRM(com.azure.resourcemanager.avs.AvsMana } /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_ArcReg.json + * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_HCX_With_Networks.json + */ + /** + * Sample code: Addons_CreateOrUpdate_HCX_With_Networks. + * + * @param manager Entry point to AvsManager. + */ + public static void addonsCreateOrUpdateHCXWithNetworks(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons() + .define("hcx") + .withExistingPrivateCloud("group1", "cloud1") + .withProperties(new AddonHcxProperties().withOffer("VMware MaaS Cloud Provider (Enterprise)") + .withManagementNetwork("10.3.1.0/24") + .withUplinkNetwork("10.3.2.0/24")) + .create(); + } + + /* + * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_ArcReg.json */ /** * Sample code: Addons_CreateOrUpdate_ArcReg. @@ -66,8 +81,7 @@ public static void addonsCreateOrUpdateArcReg(com.azure.resourcemanager.avs.AvsM } /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_CreateOrUpdate_VR.json + * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_VR.json */ /** * Sample code: Addons_CreateOrUpdate_VR. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsDeleteSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsDeleteSamples.java index f349917d9e7f..e4dd7a445bd0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsDeleteSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class AddonsDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Delete.json + * x-ms-original-file: 2024-09-01/Addons_Delete.json */ /** * Sample code: Addons_Delete. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsGetSamples.java index 56796ee7a6ac..fb8be8c0c1ec 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,19 @@ */ public final class AddonsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_SRM.json + * x-ms-original-file: 2024-09-01/Addons_Get_HCX_With_Networks.json + */ + /** + * Sample code: Addons_Get_HCX_With_Networks. + * + * @param manager Entry point to AvsManager. + */ + public static void addonsGetHCXWithNetworks(com.azure.resourcemanager.avs.AvsManager manager) { + manager.addons().getWithResponse("group1", "cloud1", "hcx", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-09-01/Addons_Get_SRM.json */ /** * Sample code: Addons_Get_SRM. @@ -22,8 +33,7 @@ public static void addonsGetSRM(com.azure.resourcemanager.avs.AvsManager manager } /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_VR.json + * x-ms-original-file: 2024-09-01/Addons_Get_VR.json */ /** * Sample code: Addons_Get_VR. @@ -35,8 +45,7 @@ public static void addonsGetVR(com.azure.resourcemanager.avs.AvsManager manager) } /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_HCX.json + * x-ms-original-file: 2024-09-01/Addons_Get_HCX.json */ /** * Sample code: Addons_Get_HCX. @@ -48,8 +57,7 @@ public static void addonsGetHCX(com.azure.resourcemanager.avs.AvsManager manager } /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_Get_ArcReg.json + * x-ms-original-file: 2024-09-01/Addons_Get_ArcReg.json */ /** * Sample code: Addons_Get_ArcReg. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsListSamples.java index 7a0ae9b4749f..77d6758d89c2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AddonsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class AddonsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Addons_List.json + * x-ms-original-file: 2024-09-01/Addons_List.json */ /** * Sample code: Addons_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsCreateOrUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsCreateOrUpdateSamples.java index 63126d910ffd..6833c5cf447a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsCreateOrUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class AuthorizationsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/Authorizations_CreateOrUpdate.json */ /** * Sample code: Authorizations_CreateOrUpdate. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsDeleteSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsDeleteSamples.java index f8bbe20e72a2..a8b69e0ba072 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsDeleteSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class AuthorizationsDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_Delete.json + * x-ms-original-file: 2024-09-01/Authorizations_Delete.json */ /** * Sample code: Authorizations_Delete. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsGetSamples.java index 7feb82c8d993..b1e75ac67fb6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class AuthorizationsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_Get.json + * x-ms-original-file: 2024-09-01/Authorizations_Get.json */ /** * Sample code: Authorizations_Get. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsListSamples.java index 755f8e2f5628..fb09d81c99ab 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/AuthorizationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class AuthorizationsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Authorizations_List.json + * x-ms-original-file: 2024-09-01/Authorizations_List.json */ /** * Sample code: Authorizations_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksCreateOrUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksCreateOrUpdateSamples.java index f6e45e40b639..159246a49960 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksCreateOrUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksCreateOrUpdateSamples.java @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; +import com.azure.resourcemanager.avs.models.CloudLinkProperties; + /** * Samples for CloudLinks CreateOrUpdate. */ public final class CloudLinksCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/CloudLinks_CreateOrUpdate.json */ /** * Sample code: CloudLinks_CreateOrUpdate. @@ -21,8 +22,8 @@ public static void cloudLinksCreateOrUpdate(com.azure.resourcemanager.avs.AvsMan manager.cloudLinks() .define("cloudLink1") .withExistingPrivateCloud("group1", "cloud1") - .withLinkedCloud( - "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2") + .withProperties(new CloudLinkProperties().withLinkedCloud( + "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2")) .create(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksDeleteSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksDeleteSamples.java index 31bf24f15c4a..c330c60381d4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksDeleteSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class CloudLinksDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_Delete.json + * x-ms-original-file: 2024-09-01/CloudLinks_Delete.json */ /** * Sample code: CloudLinks_Delete. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksGetSamples.java index 177850fb751e..795c55e1dea8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class CloudLinksGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_Get.json + * x-ms-original-file: 2024-09-01/CloudLinks_Get.json */ /** * Sample code: CloudLinks_Get. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksListSamples.java index d913adaf9ca0..5ab1c298d413 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/CloudLinksListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class CloudLinksListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/CloudLinks_List.json + * x-ms-original-file: 2024-09-01/CloudLinks_List.json */ /** * Sample code: CloudLinks_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersCreateOrUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersCreateOrUpdateSamples.java index 9d93bd1df9cd..ce2b856c5c76 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersCreateOrUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersCreateOrUpdateSamples.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; +import com.azure.resourcemanager.avs.models.ClusterProperties; import com.azure.resourcemanager.avs.models.Sku; /** @@ -11,8 +12,7 @@ */ public final class ClustersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/Clusters_CreateOrUpdate.json */ /** * Sample code: Clusters_CreateOrUpdate. @@ -24,7 +24,7 @@ public static void clustersCreateOrUpdate(com.azure.resourcemanager.avs.AvsManag .define("cluster1") .withExistingPrivateCloud("group1", "cloud1") .withSku(new Sku().withName("AV20")) - .withClusterSize(3) + .withProperties(new ClusterProperties().withClusterSize(3)) .create(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersDeleteSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersDeleteSamples.java index 0b557c7795d3..d02a358ab1d3 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersDeleteSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_Delete.json + * x-ms-original-file: 2024-09-01/Clusters_Delete.json */ /** * Sample code: Clusters_Delete. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersGetSamples.java index de560b3c5f44..af904a52b063 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class ClustersGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_Get.json + * x-ms-original-file: 2024-09-01/Clusters_Get.json */ /** * Sample code: Clusters_Get. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersListSamples.java index 0e4975687763..2b2e10cd5592 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class ClustersListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_List.json + * x-ms-original-file: 2024-09-01/Clusters_List.json */ /** * Sample code: Clusters_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersListZonesSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersListZonesSamples.java index 5b57800e6215..b3ab0338617d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersListZonesSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersListZonesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class ClustersListZonesSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_ListZones.json + * x-ms-original-file: 2024-09-01/Clusters_ListZones.json */ /** * Sample code: Clusters_ListZones. @@ -22,8 +21,7 @@ public static void clustersListZones(com.azure.resourcemanager.avs.AvsManager ma } /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_ListZones_Stretched.json + * x-ms-original-file: 2024-09-01/Clusters_ListZones_Stretched.json */ /** * Sample code: Clusters_ListZones_Stretched. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersUpdateSamples.java index 97129bcee76e..7e44b00985a2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ClustersUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -11,8 +11,7 @@ */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Clusters_Update.json + * x-ms-original-file: 2024-09-01/Clusters_Update.json */ /** * Sample code: Clusters_Update. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresCreateOrUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresCreateOrUpdateSamples.java index 66ed7169d9ae..71d62268f741 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresCreateOrUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresCreateOrUpdateSamples.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; +import com.azure.resourcemanager.avs.models.DatastoreProperties; import com.azure.resourcemanager.avs.models.NetAppVolume; /** @@ -11,8 +12,7 @@ */ public final class DatastoresCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/Datastores_CreateOrUpdate.json */ /** * Sample code: Datastores_CreateOrUpdate. @@ -23,8 +23,8 @@ public static void datastoresCreateOrUpdate(com.azure.resourcemanager.avs.AvsMan manager.datastores() .define("datastore1") .withExistingCluster("group1", "cloud1", "cluster1") - .withNetAppVolume(new NetAppVolume().withId( - "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1")) + .withProperties(new DatastoreProperties().withNetAppVolume(new NetAppVolume().withId( + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"))) .create(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresDeleteSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresDeleteSamples.java index c22c6754286e..a732392a7052 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresDeleteSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class DatastoresDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_Delete.json + * x-ms-original-file: 2024-09-01/Datastores_Delete.json */ /** * Sample code: Datastores_Delete. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresGetSamples.java index b0c624a7609b..2195bb616c9c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class DatastoresGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_Get.json + * x-ms-original-file: 2024-09-01/Datastores_Get.json */ /** * Sample code: Datastores_Get. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresListSamples.java index 441a855fe062..b639d14c47dd 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/DatastoresListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class DatastoresListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Datastores_List.json + * x-ms-original-file: 2024-09-01/Datastores_List.json */ /** * Sample code: Datastores_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsCreateOrUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsCreateOrUpdateSamples.java index 83749f5e17a7..bb36cf663308 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsCreateOrUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsCreateOrUpdateSamples.java @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionProperties; + /** * Samples for GlobalReachConnections CreateOrUpdate. */ public final class GlobalReachConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * GlobalReachConnections_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/GlobalReachConnections_CreateOrUpdate.json */ /** * Sample code: GlobalReachConnections_CreateOrUpdate. @@ -21,9 +22,9 @@ public static void globalReachConnectionsCreateOrUpdate(com.azure.resourcemanage manager.globalReachConnections() .define("connection1") .withExistingPrivateCloud("group1", "cloud1") - .withAuthorizationKey("01010101-0101-0101-0101-010101010101") - .withPeerExpressRouteCircuit( - "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer") + .withProperties(new GlobalReachConnectionProperties().withAuthorizationKey("fakeTokenPlaceholder") + .withPeerExpressRouteCircuit( + "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer")) .create(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsDeleteSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsDeleteSamples.java index 599f2ffaf2a2..23b5bed425f8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsDeleteSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class GlobalReachConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_Delete.json + * x-ms-original-file: 2024-09-01/GlobalReachConnections_Delete.json */ /** * Sample code: GlobalReachConnections_Delete. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsGetSamples.java index b1e02991c662..7e8c7fc3b6d6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class GlobalReachConnectionsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_Get.json + * x-ms-original-file: 2024-09-01/GlobalReachConnections_Get.json */ /** * Sample code: GlobalReachConnections_Get. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsListSamples.java index 3cb609a06eaa..4a4537a69040 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class GlobalReachConnectionsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/GlobalReachConnections_List.json + * x-ms-original-file: 2024-09-01/GlobalReachConnections_List.json */ /** * Sample code: GlobalReachConnections_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesCreateOrUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesCreateOrUpdateSamples.java index 376bfde12df7..6b6e475938d1 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesCreateOrUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class HcxEnterpriseSitesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_CreateOrUpdate. - * json + * x-ms-original-file: 2024-09-01/HcxEnterpriseSites_CreateOrUpdate.json */ /** * Sample code: HcxEnterpriseSites_CreateOrUpdate. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesDeleteSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesDeleteSamples.java index 2e2bf093711b..2873fe9639f9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesDeleteSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class HcxEnterpriseSitesDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_Delete.json + * x-ms-original-file: 2024-09-01/HcxEnterpriseSites_Delete.json */ /** * Sample code: HcxEnterpriseSites_Delete. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesGetSamples.java index eaa84e987a75..cc96347b6fe2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class HcxEnterpriseSitesGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_Get.json + * x-ms-original-file: 2024-09-01/HcxEnterpriseSites_Get.json */ /** * Sample code: HcxEnterpriseSites_Get. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesListSamples.java index d5144b06bc09..35c583789575 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class HcxEnterpriseSitesListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/HcxEnterpriseSites_List.json + * x-ms-original-file: 2024-09-01/HcxEnterpriseSites_List.json */ /** * Sample code: HcxEnterpriseSites_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HostsGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HostsGetSamples.java new file mode 100644 index 000000000000..951440bc8d23 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HostsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +/** + * Samples for Hosts Get. + */ +public final class HostsGetSamples { + /* + * x-ms-original-file: 2024-09-01/Hosts_Get.json + */ + /** + * Sample code: Hosts_Get. + * + * @param manager Entry point to AvsManager. + */ + public static void hostsGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.hosts() + .getWithResponse("group1", "cloud1", "cluster1", + "esx03-r52.1111111111111111111.westcentralus.prod.azure.com", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HostsListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HostsListSamples.java new file mode 100644 index 000000000000..53f8689a83e3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/HostsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +/** + * Samples for Hosts List. + */ +public final class HostsListSamples { + /* + * x-ms-original-file: 2024-09-01/Hosts_List.json + */ + /** + * Sample code: Hosts_List. + * + * @param manager Entry point to AvsManager. + */ + public static void hostsList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.hosts().list("group1", "cloud1", "cluster1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsCreateOrUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsCreateOrUpdateSamples.java index 6692612b50b0..caab2ab3ebf3 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsCreateOrUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsCreateOrUpdateSamples.java @@ -1,18 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; -import com.azure.resourcemanager.avs.fluent.models.IscsiPathInner; +import com.azure.resourcemanager.avs.models.IscsiPathProperties; /** * Samples for IscsiPaths CreateOrUpdate. */ public final class IscsiPathsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/IscsiPaths_CreateOrUpdate.json */ /** * Sample code: IscsiPaths_CreateOrUpdate. @@ -21,7 +20,9 @@ public final class IscsiPathsCreateOrUpdateSamples { */ public static void iscsiPathsCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { manager.iscsiPaths() - .createOrUpdate("group1", "cloud1", new IscsiPathInner().withNetworkBlock("192.168.0.0/24"), - com.azure.core.util.Context.NONE); + .define("default") + .withExistingPrivateCloud("group1", "cloud1") + .withProperties(new IscsiPathProperties().withNetworkBlock("192.168.0.0/24")) + .create(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsDeleteSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsDeleteSamples.java index 8fbfd8f8ec0e..9f500f8a2afb 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsDeleteSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class IscsiPathsDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_Delete.json + * x-ms-original-file: 2024-09-01/IscsiPaths_Delete.json */ /** * Sample code: IscsiPaths_Delete. @@ -18,6 +17,6 @@ public final class IscsiPathsDeleteSamples { * @param manager Entry point to AvsManager. */ public static void iscsiPathsDelete(com.azure.resourcemanager.avs.AvsManager manager) { - manager.iscsiPaths().delete("group1", "cloud1", com.azure.core.util.Context.NONE); + manager.iscsiPaths().delete("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsGetSamples.java index b29e1a44475e..08d593cdf0f3 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class IscsiPathsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_Get.json + * x-ms-original-file: 2024-09-01/IscsiPaths_Get.json */ /** * Sample code: IscsiPaths_Get. @@ -18,6 +17,6 @@ public final class IscsiPathsGetSamples { * @param manager Entry point to AvsManager. */ public static void iscsiPathsGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.iscsiPaths().getWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE); + manager.iscsiPaths().getWithResponse("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsListByPrivateCloudSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsListByPrivateCloudSamples.java index 0d70ce515a6d..1184be381a17 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsListByPrivateCloudSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/IscsiPathsListByPrivateCloudSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class IscsiPathsListByPrivateCloudSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/IscsiPaths_List.json + * x-ms-original-file: 2024-09-01/IscsiPaths_List.json */ /** * Sample code: IscsiPaths_ListByPrivateCloud. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/LocationsCheckQuotaAvailabilitySamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/LocationsCheckQuotaAvailabilitySamples.java index 9333ca14d8f0..9d17fd6a13b7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/LocationsCheckQuotaAvailabilitySamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/LocationsCheckQuotaAvailabilitySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class LocationsCheckQuotaAvailabilitySamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Locations_CheckQuotaAvailability. - * json + * x-ms-original-file: 2024-09-01/Locations_CheckQuotaAvailability.json */ /** * Sample code: Locations_CheckQuotaAvailability. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/LocationsCheckTrialAvailabilitySamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/LocationsCheckTrialAvailabilitySamples.java index d7d946e4f59c..9a93518c1775 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/LocationsCheckTrialAvailabilitySamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/LocationsCheckTrialAvailabilitySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -11,9 +11,7 @@ */ public final class LocationsCheckTrialAvailabilitySamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Locations_CheckTrialAvailability. - * json + * x-ms-original-file: 2024-09-01/Locations_CheckTrialAvailability.json */ /** * Sample code: Locations_CheckTrialAvailability. @@ -25,8 +23,7 @@ public static void locationsCheckTrialAvailability(com.azure.resourcemanager.avs } /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * Locations_CheckTrialAvailabilityWithSku.json + * x-ms-original-file: 2024-09-01/Locations_CheckTrialAvailabilityWithSku.json */ /** * Sample code: Locations_CheckTrialAvailabilityWithSku. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/OperationsListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/OperationsListSamples.java index 62dcbfe849ea..ad7f78eb4e2f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/OperationsListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/Operations_List.json + * x-ms-original-file: 2024-09-01/Operations_List.json */ /** * Sample code: Operations_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesCreateOrUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesCreateOrUpdateSamples.java index ab3c50e72903..f73d8016f258 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesCreateOrUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -15,9 +15,7 @@ */ public final class PlacementPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_CreateOrUpdate. - * json + * x-ms-original-file: 2024-09-01/PlacementPolicies_CreateOrUpdate.json */ /** * Sample code: PlacementPolicies_CreateOrUpdate. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesDeleteSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesDeleteSamples.java index d4f1a53e00ce..7ffcd68d0281 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesDeleteSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class PlacementPoliciesDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_Delete.json + * x-ms-original-file: 2024-09-01/PlacementPolicies_Delete.json */ /** * Sample code: PlacementPolicies_Delete. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesGetSamples.java index f04e376a3462..e8c94cde0d2a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class PlacementPoliciesGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_Get.json + * x-ms-original-file: 2024-09-01/PlacementPolicies_Get.json */ /** * Sample code: PlacementPolicies_Get. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesListSamples.java index 16419e451921..35e7d0c239c8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class PlacementPoliciesListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_List.json + * x-ms-original-file: 2024-09-01/PlacementPolicies_List.json */ /** * Sample code: PlacementPolicies_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesUpdateSamples.java index 7baf5fa7fd95..53e01d6dbbd2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -15,8 +15,7 @@ */ public final class PlacementPoliciesUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PlacementPolicies_Update.json + * x-ms-original-file: 2024-09-01/PlacementPolicies_Update.json */ /** * Sample code: PlacementPolicies_Update. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsCreateOrUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsCreateOrUpdateSamples.java index 3f10163d6eda..7be818a7c2e6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsCreateOrUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsCreateOrUpdateSamples.java @@ -1,15 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.resourcemanager.avs.models.AvailabilityProperties; import com.azure.resourcemanager.avs.models.AvailabilityStrategy; +import com.azure.resourcemanager.avs.models.DnsZoneType; import com.azure.resourcemanager.avs.models.ManagementCluster; import com.azure.resourcemanager.avs.models.PrivateCloudIdentity; -import com.azure.resourcemanager.avs.models.ResourceIdentityType; +import com.azure.resourcemanager.avs.models.PrivateCloudProperties; import com.azure.resourcemanager.avs.models.Sku; +import com.azure.resourcemanager.avs.models.SystemAssignedServiceIdentityType; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -18,8 +21,7 @@ */ public final class PrivateCloudsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_CreateOrUpdate.json + * x-ms-original-file: 2024-09-01/PrivateClouds_CreateOrUpdate.json */ /** * Sample code: PrivateClouds_CreateOrUpdate. @@ -33,15 +35,61 @@ public static void privateCloudsCreateOrUpdate(com.azure.resourcemanager.avs.Avs .withExistingResourceGroup("group1") .withSku(new Sku().withName("AV36")) .withTags(mapOf()) - .withIdentity(new PrivateCloudIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withManagementCluster(new ManagementCluster().withClusterSize(4)) - .withNetworkBlock("192.168.48.0/22") + .withProperties( + new PrivateCloudProperties().withManagementCluster(new ManagementCluster().withClusterSize(4)) + .withNetworkBlock("192.168.48.0/22")) + .withIdentity(new PrivateCloudIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) .create(); } /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * PrivateClouds_CreateOrUpdate_Stretched.json + * x-ms-original-file: 2024-09-01/PrivateClouds_CreateOrUpdate_StretchedZones.json + */ + /** + * Sample code: PrivateClouds_CreateOrUpdate_StretchedZones. + * + * @param manager Entry point to AvsManager. + */ + public static void privateCloudsCreateOrUpdateStretchedZones(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds() + .define("cloud1") + .withRegion("eastus2") + .withExistingResourceGroup("group1") + .withSku(new Sku().withName("AV36")) + .withTags(mapOf()) + .withProperties( + new PrivateCloudProperties().withManagementCluster(new ManagementCluster().withClusterSize(4)) + .withNetworkBlock("192.168.48.0/22")) + .withZones(Arrays.asList("1", "2")) + .create(); + } + + /* + * x-ms-original-file: 2024-09-01/PrivateClouds_CreateOrUpdate_FleetNative.json + */ + /** + * Sample code: PrivateClouds_CreateOrUpdate_FleetNative. + * + * @param manager Entry point to AvsManager. + */ + public static void privateCloudsCreateOrUpdateFleetNative(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds() + .define("cloud1") + .withRegion("eastus2") + .withExistingResourceGroup("group1") + .withSku(new Sku().withName("AV64")) + .withTags(mapOf()) + .withProperties(new PrivateCloudProperties() + .withManagementCluster(new ManagementCluster().withClusterSize(4)) + .withNetworkBlock("192.168.48.0/22") + .withVirtualNetworkId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/vnet") + .withDnsZoneType(DnsZoneType.PRIVATE)) + .create(); + } + + /* + * x-ms-original-file: 2024-09-01/PrivateClouds_CreateOrUpdate_Stretched.json */ /** * Sample code: PrivateClouds_CreateOrUpdate_Stretched. @@ -55,11 +103,12 @@ public static void privateCloudsCreateOrUpdateStretched(com.azure.resourcemanage .withExistingResourceGroup("group1") .withSku(new Sku().withName("AV36")) .withTags(mapOf()) - .withManagementCluster(new ManagementCluster().withClusterSize(4)) - .withAvailability(new AvailabilityProperties().withStrategy(AvailabilityStrategy.DUAL_ZONE) - .withZone(1) - .withSecondaryZone(2)) - .withNetworkBlock("192.168.48.0/22") + .withProperties( + new PrivateCloudProperties().withManagementCluster(new ManagementCluster().withClusterSize(4)) + .withAvailability(new AvailabilityProperties().withStrategy(AvailabilityStrategy.DUAL_ZONE) + .withZone(1) + .withSecondaryZone(2)) + .withNetworkBlock("192.168.48.0/22")) .create(); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsDeleteSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsDeleteSamples.java index c868ab66c3de..ece0e3526091 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsDeleteSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class PrivateCloudsDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Delete.json + * x-ms-original-file: 2024-09-01/PrivateClouds_Delete.json */ /** * Sample code: PrivateClouds_Delete. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsGetByResourceGroupSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsGetByResourceGroupSamples.java index 202da6f22009..0defa7dd3eaf 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsGetByResourceGroupSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class PrivateCloudsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Get.json + * x-ms-original-file: 2024-09-01/PrivateClouds_Get.json */ /** * Sample code: PrivateClouds_Get. @@ -22,8 +21,7 @@ public static void privateCloudsGet(com.azure.resourcemanager.avs.AvsManager man } /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Get_Stretched.json + * x-ms-original-file: 2024-09-01/PrivateClouds_Get_Stretched.json */ /** * Sample code: PrivateClouds_Get_Stretched. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsListAdminCredentialsSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsListAdminCredentialsSamples.java index 7270369f7aaa..28788cfcd5c7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsListAdminCredentialsSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsListAdminCredentialsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class PrivateCloudsListAdminCredentialsSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListAdminCredentials - * .json + * x-ms-original-file: 2024-09-01/PrivateClouds_ListAdminCredentials.json */ /** * Sample code: PrivateClouds_ListAdminCredentials. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsListByResourceGroupSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsListByResourceGroupSamples.java index fbc4172d4db3..136f488770c7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsListByResourceGroupSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class PrivateCloudsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_List.json + * x-ms-original-file: 2024-09-01/PrivateClouds_List.json */ /** * Sample code: PrivateClouds_List. @@ -22,8 +21,7 @@ public static void privateCloudsList(com.azure.resourcemanager.avs.AvsManager ma } /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_List_Stretched.json + * x-ms-original-file: 2024-09-01/PrivateClouds_List_Stretched.json */ /** * Sample code: PrivateClouds_List_Stretched. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsListSamples.java index 27e74043fc55..93cde458051a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class PrivateCloudsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListInSubscription. - * json + * x-ms-original-file: 2024-09-01/PrivateClouds_ListInSubscription.json */ /** * Sample code: PrivateClouds_ListInSubscription. @@ -23,8 +21,7 @@ public static void privateCloudsListInSubscription(com.azure.resourcemanager.avs } /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * PrivateClouds_ListInSubscription_Stretched.json + * x-ms-original-file: 2024-09-01/PrivateClouds_ListInSubscription_Stretched.json */ /** * Sample code: PrivateClouds_ListInSubscription_Stretched. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsRotateNsxtPasswordSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsRotateNsxtPasswordSamples.java index 2462a08fd927..4bff535cdb3d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsRotateNsxtPasswordSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsRotateNsxtPasswordSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class PrivateCloudsRotateNsxtPasswordSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_RotateNsxtPassword. - * json + * x-ms-original-file: 2024-09-01/PrivateClouds_RotateNsxtPassword.json */ /** * Sample code: PrivateClouds_RotateNsxtPassword. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsRotateVcenterPasswordSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsRotateVcenterPasswordSamples.java index cbefff7a2923..099d74bf01b3 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsRotateVcenterPasswordSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsRotateVcenterPasswordSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class PrivateCloudsRotateVcenterPasswordSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * PrivateClouds_RotateVcenterPassword.json + * x-ms-original-file: 2024-09-01/PrivateClouds_RotateVcenterPassword.json */ /** * Sample code: PrivateClouds_RotateVcenterPassword. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsUpdateSamples.java index 12e8a6390f63..164ddc564320 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/PrivateCloudsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -10,15 +10,14 @@ import com.azure.resourcemanager.avs.models.ManagementCluster; import com.azure.resourcemanager.avs.models.PrivateCloud; import com.azure.resourcemanager.avs.models.PrivateCloudIdentity; -import com.azure.resourcemanager.avs.models.ResourceIdentityType; +import com.azure.resourcemanager.avs.models.SystemAssignedServiceIdentityType; /** * Samples for PrivateClouds Update. */ public final class PrivateCloudsUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Update.json + * x-ms-original-file: 2024-09-01/PrivateClouds_Update.json */ /** * Sample code: PrivateClouds_Update. @@ -30,7 +29,7 @@ public static void privateCloudsUpdate(com.azure.resourcemanager.avs.AvsManager .getByResourceGroupWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withIdentity(new PrivateCloudIdentity().withType(ResourceIdentityType.NONE)) + .withIdentity(new PrivateCloudIdentity().withType(SystemAssignedServiceIdentityType.NONE)) .withManagementCluster(new ManagementCluster().withClusterSize(4)) .withEncryption(new Encryption().withStatus(EncryptionState.ENABLED) .withKeyVaultProperties(new EncryptionKeyVaultProperties().withKeyName("fakeTokenPlaceholder") @@ -40,9 +39,7 @@ public static void privateCloudsUpdate(com.azure.resourcemanager.avs.AvsManager } /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_Update_Stretched. - * json + * x-ms-original-file: 2024-09-01/PrivateClouds_Update_Stretched.json */ /** * Sample code: PrivateClouds_Update_Stretched. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksGetSamples.java new file mode 100644 index 000000000000..fdd1eb6a66f7 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +/** + * Samples for ProvisionedNetworks Get. + */ +public final class ProvisionedNetworksGetSamples { + /* + * x-ms-original-file: 2024-09-01/ProvisionedNetworks_Get.json + */ + /** + * Sample code: ProvisionedNetworks_Get. + * + * @param manager Entry point to AvsManager. + */ + public static void provisionedNetworksGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.provisionedNetworks().getWithResponse("group1", "cloud1", "vsan", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksListSamples.java new file mode 100644 index 000000000000..54abe365b6f4 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +/** + * Samples for ProvisionedNetworks List. + */ +public final class ProvisionedNetworksListSamples { + /* + * x-ms-original-file: 2024-09-01/ProvisionedNetworks_List.json + */ + /** + * Sample code: ProvisionedNetworks_List. + * + * @param manager Entry point to AvsManager. + */ + public static void provisionedNetworksList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.provisionedNetworks().list("group1", "cloud1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsGetSamples.java index 7085f9340ff2..beaf379b0024 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class ScriptCmdletsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptCmdlets_Get.json + * x-ms-original-file: 2024-09-01/ScriptCmdlets_Get.json */ /** * Sample code: ScriptCmdlets_Get. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsListSamples.java index 957a11dc2138..45bbcf2db065 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class ScriptCmdletsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptCmdlets_List.json + * x-ms-original-file: 2024-09-01/ScriptCmdlets_List.json */ /** * Sample code: ScriptCmdlets_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsCreateOrUpdateSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsCreateOrUpdateSamples.java index 42b8d0c621b9..246263f90862 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsCreateOrUpdateSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsCreateOrUpdateSamples.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; +import com.azure.resourcemanager.avs.models.ScriptExecutionProperties; import com.azure.resourcemanager.avs.models.ScriptSecureStringExecutionParameter; import com.azure.resourcemanager.avs.models.ScriptStringExecutionParameter; import java.util.Arrays; @@ -13,9 +14,7 @@ */ public final class ScriptExecutionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_CreateOrUpdate. - * json + * x-ms-original-file: 2024-09-01/ScriptExecutions_CreateOrUpdate.json */ /** * Sample code: ScriptExecutions_CreateOrUpdate. @@ -26,16 +25,16 @@ public static void scriptExecutionsCreateOrUpdate(com.azure.resourcemanager.avs. manager.scriptExecutions() .define("addSsoServer") .withExistingPrivateCloud("group1", "cloud1") - .withScriptCmdletId( + .withProperties(new ScriptExecutionProperties().withScriptCmdletId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptPackages/AVS.PowerCommands@1.0.0/scriptCmdlets/New-SsoExternalIdentitySource") - .withParameters(Arrays.asList( - new ScriptStringExecutionParameter().withName("DomainName").withValue("placeholderDomain.local"), - new ScriptStringExecutionParameter().withName("BaseUserDN") - .withValue("DC=placeholder, DC=placeholder"))) - .withHiddenParameters(Arrays.asList( - new ScriptSecureStringExecutionParameter().withName("Password").withSecureValue("PlaceholderPassword"))) - .withTimeout("P0Y0M0DT0H60M60S") - .withRetention("P0Y0M60DT0H60M60S") + .withParameters(Arrays.asList( + new ScriptStringExecutionParameter().withName("DomainName").withValue("placeholderDomain.local"), + new ScriptStringExecutionParameter().withName("BaseUserDN") + .withValue("DC=placeholder, DC=placeholder"))) + .withHiddenParameters(Arrays.asList(new ScriptSecureStringExecutionParameter().withName("Password") + .withSecureValue("PlaceholderPassword"))) + .withTimeout("P0Y0M0DT0H60M60S") + .withRetention("P0Y0M60DT0H60M60S")) .create(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsDeleteSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsDeleteSamples.java index e263d2c4fe39..0e9b2cc85b49 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsDeleteSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class ScriptExecutionsDeleteSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_Delete.json + * x-ms-original-file: 2024-09-01/ScriptExecutions_Delete.json */ /** * Sample code: ScriptExecutions_Delete. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetExecutionLogsSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetExecutionLogsSamples.java index 858d244c467d..cd602fca3567 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetExecutionLogsSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetExecutionLogsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -12,9 +12,7 @@ */ public final class ScriptExecutionsGetExecutionLogsSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_GetExecutionLogs. - * json + * x-ms-original-file: 2024-09-01/ScriptExecutions_GetExecutionLogs.json */ /** * Sample code: ScriptExecutions_GetExecutionLogs. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetSamples.java index c21f63f849cc..8758e9fe7994 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class ScriptExecutionsGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_Get.json + * x-ms-original-file: 2024-09-01/ScriptExecutions_Get.json */ /** * Sample code: ScriptExecutions_Get. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsListSamples.java index 5a5942f94752..c46c622f96fa 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class ScriptExecutionsListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptExecutions_List.json + * x-ms-original-file: 2024-09-01/ScriptExecutions_List.json */ /** * Sample code: ScriptExecutions_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptPackagesGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptPackagesGetSamples.java index 09291ebf89e3..4c6aba9d080c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptPackagesGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptPackagesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class ScriptPackagesGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptPackages_Get.json + * x-ms-original-file: 2024-09-01/ScriptPackages_Get.json */ /** * Sample code: ScriptPackages_Get. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptPackagesListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptPackagesListSamples.java index e2c896b5e958..2f7caf80f8dd 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptPackagesListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/ScriptPackagesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class ScriptPackagesListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ScriptPackages_List.json + * x-ms-original-file: 2024-09-01/ScriptPackages_List.json */ /** * Sample code: ScriptPackages_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/SkusListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/SkusListSamples.java new file mode 100644 index 000000000000..a75b9165b42e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/SkusListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +/** + * Samples for Skus List. + */ +public final class SkusListSamples { + /* + * x-ms-original-file: 2024-09-01/Skus_List.json + */ + /** + * Sample code: Skus_List. + * + * @param manager Entry point to AvsManager. + */ + public static void skusList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.skus().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/VirtualMachinesGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/VirtualMachinesGetSamples.java index db8eb3d2b557..5fb2596cfcac 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/VirtualMachinesGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/VirtualMachinesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class VirtualMachinesGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/VirtualMachines_Get.json + * x-ms-original-file: 2024-09-01/VirtualMachines_Get.json */ /** * Sample code: VirtualMachines_Get. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/VirtualMachinesListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/VirtualMachinesListSamples.java index 8150b0f0502b..7c31d8d513f2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/VirtualMachinesListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/VirtualMachinesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class VirtualMachinesListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/VirtualMachines_List.json + * x-ms-original-file: 2024-09-01/VirtualMachines_List.json */ /** * Sample code: VirtualMachines_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/VirtualMachinesRestrictMovementSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/VirtualMachinesRestrictMovementSamples.java index 532bd590087e..a35b094f8605 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/VirtualMachinesRestrictMovementSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/VirtualMachinesRestrictMovementSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -12,9 +12,7 @@ */ public final class VirtualMachinesRestrictMovementSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/VirtualMachines_RestrictMovement. - * json + * x-ms-original-file: 2024-09-01/VirtualMachines_RestrictMovement.json */ /** * Sample code: VirtualMachines_RestrictMovement. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDhcpSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDhcpSamples.java index a7f2f3481545..c12861d075cf 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDhcpSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDhcpSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -11,8 +11,7 @@ */ public final class WorkloadNetworksCreateDhcpSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateDhcp.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateDhcp.json */ /** * Sample code: WorkloadNetworks_CreateDhcp. @@ -22,7 +21,7 @@ public final class WorkloadNetworksCreateDhcpSamples { public static void workloadNetworksCreateDhcp(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() .defineDhcp("dhcp1") - .withExistingPrivateCloud("group1", "cloud1") + .withExistingWorkloadNetwork("group1", "cloud1", null) .withProperties(new WorkloadNetworkDhcpServer().withDisplayName("dhcpConfigurations1") .withRevision(1L) .withServerAddress("40.1.5.1/24") diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsServiceSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsServiceSamples.java index a879ef1a29b9..5f9b68858cc8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsServiceSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsServiceSamples.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProperties; import java.util.Arrays; /** @@ -12,9 +13,7 @@ */ public final class WorkloadNetworksCreateDnsServiceSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateDnsService. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateDnsService.json */ /** * Sample code: WorkloadNetworks_CreateDnsService. @@ -24,13 +23,13 @@ public final class WorkloadNetworksCreateDnsServiceSamples { public static void workloadNetworksCreateDnsService(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() .defineDnsService("dnsService1") - .withExistingPrivateCloud("group1", "cloud1") - .withDisplayName("dnsService1") - .withDnsServiceIp("5.5.5.5") - .withDefaultDnsZone("defaultDnsZone1") - .withFqdnZones(Arrays.asList("fqdnZone1")) - .withLogLevel(DnsServiceLogLevelEnum.INFO) - .withRevision(1L) + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties(new WorkloadNetworkDnsServiceProperties().withDisplayName("dnsService1") + .withDnsServiceIp("5.5.5.5") + .withDefaultDnsZone("defaultDnsZone1") + .withFqdnZones(Arrays.asList("fqdnZone1")) + .withLogLevel(DnsServiceLogLevelEnum.INFO) + .withRevision(1L)) .create(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsZoneSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsZoneSamples.java index ed2723863ceb..327a0b8784ba 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsZoneSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsZoneSamples.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProperties; import java.util.Arrays; /** @@ -11,9 +12,7 @@ */ public final class WorkloadNetworksCreateDnsZoneSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateDnsZone. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateDnsZone.json */ /** * Sample code: WorkloadNetworks_CreateDnsZone. @@ -23,12 +22,12 @@ public final class WorkloadNetworksCreateDnsZoneSamples { public static void workloadNetworksCreateDnsZone(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() .defineDnsZone("dnsZone1") - .withExistingPrivateCloud("group1", "cloud1") - .withDisplayName("dnsZone1") - .withDomain(Arrays.asList()) - .withDnsServerIps(Arrays.asList("1.1.1.1")) - .withSourceIp("8.8.8.8") - .withRevision(1L) + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties(new WorkloadNetworkDnsZoneProperties().withDisplayName("dnsZone1") + .withDomain(Arrays.asList()) + .withDnsServerIps(Arrays.asList("1.1.1.1")) + .withSourceIp("8.8.8.8") + .withRevision(1L)) .create(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePortMirroringSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePortMirroringSamples.java index f7e36c56893b..09bcedddecec 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePortMirroringSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePortMirroringSamples.java @@ -1,18 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProperties; /** * Samples for WorkloadNetworks CreatePortMirroring. */ public final class WorkloadNetworksCreatePortMirroringSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * WorkloadNetworks_CreatePortMirroring.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreatePortMirroring.json */ /** * Sample code: WorkloadNetworks_CreatePortMirroring. @@ -22,12 +22,12 @@ public final class WorkloadNetworksCreatePortMirroringSamples { public static void workloadNetworksCreatePortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() .definePortMirroring("portMirroring1") - .withExistingPrivateCloud("group1", "cloud1") - .withDisplayName("portMirroring1") - .withDirection(PortMirroringDirectionEnum.BIDIRECTIONAL) - .withSource("vmGroup1") - .withDestination("vmGroup2") - .withRevision(1L) + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties(new WorkloadNetworkPortMirroringProperties().withDisplayName("portMirroring1") + .withDirection(PortMirroringDirectionEnum.BIDIRECTIONAL) + .withSource("vmGroup1") + .withDestination("vmGroup2") + .withRevision(1L)) .create(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIPSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIPSamples.java new file mode 100644 index 000000000000..b30c0a1cef59 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIPSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIpProperties; + +/** + * Samples for WorkloadNetworks CreatePublicIP. + */ +public final class WorkloadNetworksCreatePublicIPSamples { + /* + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreatePublicIP.json + */ + /** + * Sample code: WorkloadNetworks_CreatePublicIP. + * + * @param manager Entry point to AvsManager. + */ + public static void workloadNetworksCreatePublicIP(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .definePublicIP("publicIP1") + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties( + new WorkloadNetworkPublicIpProperties().withDisplayName("publicIP1").withNumberOfPublicIPs(32L)) + .create(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIpSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIpSamples.java deleted file mode 100644 index f92d63b19b59..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIpSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -/** - * Samples for WorkloadNetworks CreatePublicIp. - */ -public final class WorkloadNetworksCreatePublicIpSamples { - /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreatePublicIP. - * json - */ - /** - * Sample code: WorkloadNetworks_CreatePublicIP. - * - * @param manager Entry point to AvsManager. - */ - public static void workloadNetworksCreatePublicIP(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .definePublicIp("publicIP1") - .withExistingPrivateCloud("group1", "cloud1") - .withDisplayName("publicIP1") - .withNumberOfPublicIPs(32L) - .create(); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentSamples.java new file mode 100644 index 000000000000..e95cfac3c5e6 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProperties; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; +import java.util.Arrays; + +/** + * Samples for WorkloadNetworks CreateSegment. + */ +public final class WorkloadNetworksCreateSegmentSamples { + /* + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateSegments.json + */ + /** + * Sample code: WorkloadNetworks_CreateSegments. + * + * @param manager Entry point to AvsManager. + */ + public static void workloadNetworksCreateSegments(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks() + .defineSegment("segment1") + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties(new WorkloadNetworkSegmentProperties().withDisplayName("segment1") + .withConnectedGateway("/infra/tier-1s/gateway") + .withSubnet(new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("40.20.0.0-40.20.0.1")) + .withGatewayAddress("40.20.20.20/16")) + .withRevision(1L)) + .create(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentsSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentsSamples.java deleted file mode 100644 index 7577ae0ffc74..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentsSamples.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; -import java.util.Arrays; - -/** - * Samples for WorkloadNetworks CreateSegments. - */ -public final class WorkloadNetworksCreateSegmentsSamples { - /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateSegments. - * json - */ - /** - * Sample code: WorkloadNetworks_CreateSegments. - * - * @param manager Entry point to AvsManager. - */ - public static void workloadNetworksCreateSegments(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks() - .defineSegments("segment1") - .withExistingPrivateCloud("group1", "cloud1") - .withDisplayName("segment1") - .withConnectedGateway("/infra/tier-1s/gateway") - .withSubnet(new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("40.20.0.0-40.20.0.1")) - .withGatewayAddress("40.20.20.20/16")) - .withRevision(1L) - .create(); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateVMGroupSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateVMGroupSamples.java index e01895921c80..023abda73e57 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateVMGroupSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateVMGroupSamples.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProperties; import java.util.Arrays; /** @@ -11,9 +12,7 @@ */ public final class WorkloadNetworksCreateVMGroupSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_CreateVMGroup. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateVMGroup.json */ /** * Sample code: WorkloadNetworks_CreateVMGroup. @@ -23,10 +22,10 @@ public final class WorkloadNetworksCreateVMGroupSamples { public static void workloadNetworksCreateVMGroup(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() .defineVMGroup("vmGroup1") - .withExistingPrivateCloud("group1", "cloud1") - .withDisplayName("vmGroup1") - .withMembers(Arrays.asList("564d43da-fefc-2a3b-1d92-42855622fa50")) - .withRevision(1L) + .withExistingWorkloadNetwork("group1", "cloud1", null) + .withProperties(new WorkloadNetworkVMGroupProperties().withDisplayName("vmGroup1") + .withMembers(Arrays.asList("564d43da-fefc-2a3b-1d92-42855622fa50")) + .withRevision(1L)) .create(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDhcpSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDhcpSamples.java index 780de3a30f30..82c5efe0431b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDhcpSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDhcpSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksDeleteDhcpSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteDhcp.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteDhcp.json */ /** * Sample code: WorkloadNetworks_DeleteDhcp. @@ -18,6 +17,6 @@ public final class WorkloadNetworksDeleteDhcpSamples { * @param manager Entry point to AvsManager. */ public static void workloadNetworksDeleteDhcp(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().deleteDhcp("group1", "cloud1", "dhcp1", com.azure.core.util.Context.NONE); + manager.workloadNetworks().deleteDhcp("group1", "cloud1", null, "dhcp1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsServiceSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsServiceSamples.java index 9a4349156f10..aec0207b064c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsServiceSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsServiceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class WorkloadNetworksDeleteDnsServiceSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteDnsService. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteDnsService.json */ /** * Sample code: WorkloadNetworks_DeleteDnsService. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsZoneSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsZoneSamples.java index ce11038d50ab..12551a69980d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsZoneSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsZoneSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class WorkloadNetworksDeleteDnsZoneSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteDnsZone. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteDnsZone.json */ /** * Sample code: WorkloadNetworks_DeleteDnsZone. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePortMirroringSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePortMirroringSamples.java index 81ff664a078d..3fc45c6337a4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePortMirroringSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePortMirroringSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksDeletePortMirroringSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * WorkloadNetworks_DeletePortMirroring.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeletePortMirroring.json */ /** * Sample code: WorkloadNetworks_DeletePortMirroring. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePublicIpSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePublicIPSamples.java similarity index 54% rename from sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePublicIpSamples.java rename to sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePublicIPSamples.java index 4e06022c3d80..fbe232f59160 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePublicIpSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePublicIPSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; /** - * Samples for WorkloadNetworks DeletePublicIp. + * Samples for WorkloadNetworks DeletePublicIP. */ -public final class WorkloadNetworksDeletePublicIpSamples { +public final class WorkloadNetworksDeletePublicIPSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeletePublicIP. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeletePublicIP.json */ /** * Sample code: WorkloadNetworks_DeletePublicIP. @@ -19,6 +17,6 @@ public final class WorkloadNetworksDeletePublicIpSamples { * @param manager Entry point to AvsManager. */ public static void workloadNetworksDeletePublicIP(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().deletePublicIp("group1", "publicIP1", "cloud1", com.azure.core.util.Context.NONE); + manager.workloadNetworks().deletePublicIP("group1", "publicIP1", "cloud1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteSegmentSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteSegmentSamples.java index dfe14529d014..6e257e289d99 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteSegmentSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteSegmentSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class WorkloadNetworksDeleteSegmentSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteSegment. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteSegment.json */ /** * Sample code: WorkloadNetworks_DeleteSegment. @@ -19,6 +17,7 @@ public final class WorkloadNetworksDeleteSegmentSamples { * @param manager Entry point to AvsManager. */ public static void workloadNetworksDeleteSegment(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().deleteSegment("group1", "cloud1", "segment1", com.azure.core.util.Context.NONE); + manager.workloadNetworks() + .deleteSegment("group1", "cloud1", null, "segment1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteVMGroupSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteVMGroupSamples.java index ae56319d52b7..edfeb5e9c0ac 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteVMGroupSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteVMGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class WorkloadNetworksDeleteVMGroupSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_DeleteVMGroup. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteVMGroup.json */ /** * Sample code: WorkloadNetworks_DeleteVMGroup. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDhcpSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDhcpSamples.java index 9de666b36391..bac42c2b28eb 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDhcpSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDhcpSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksGetDhcpSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetDhcp.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetDhcp.json */ /** * Sample code: WorkloadNetworks_GetDhcp. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsServiceSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsServiceSamples.java index 0cc858bd9c10..95c2292872c9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsServiceSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsServiceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class WorkloadNetworksGetDnsServiceSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetDnsService. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetDnsService.json */ /** * Sample code: WorkloadNetworks_GetDnsService. @@ -20,6 +18,6 @@ public final class WorkloadNetworksGetDnsServiceSamples { */ public static void workloadNetworksGetDnsService(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() - .getDnsServiceWithResponse("group1", "cloud1", "dnsService1", com.azure.core.util.Context.NONE); + .getDnsServiceWithResponse("group1", "cloud1", null, "dnsService1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsZoneSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsZoneSamples.java index c2815fcbc12e..f899e3cd5c20 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsZoneSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsZoneSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksGetDnsZoneSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetDnsZone.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetDnsZone.json */ /** * Sample code: WorkloadNetworks_GetDnsZone. @@ -19,6 +18,6 @@ public final class WorkloadNetworksGetDnsZoneSamples { */ public static void workloadNetworksGetDnsZone(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() - .getDnsZoneWithResponse("group1", "cloud1", "dnsZone1", com.azure.core.util.Context.NONE); + .getDnsZoneWithResponse("group1", "cloud1", null, "dnsZone1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetGatewaySamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetGatewaySamples.java index f3486b81b19d..7de985a135f8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetGatewaySamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetGatewaySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksGetGatewaySamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetGateway.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetGateway.json */ /** * Sample code: WorkloadNetworks_GetGateway. @@ -19,6 +18,6 @@ public final class WorkloadNetworksGetGatewaySamples { */ public static void workloadNetworksGetGateway(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() - .getGatewayWithResponse("group1", "cloud1", "gateway1", com.azure.core.util.Context.NONE); + .getGatewayWithResponse("group1", "cloud1", null, "gateway1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPortMirroringSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPortMirroringSamples.java index 7df72bd5cdd6..b549ef078e36 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPortMirroringSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPortMirroringSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class WorkloadNetworksGetPortMirroringSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetPortMirroring. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetPortMirroring.json */ /** * Sample code: WorkloadNetworks_GetPortMirroring. @@ -20,6 +18,6 @@ public final class WorkloadNetworksGetPortMirroringSamples { */ public static void workloadNetworksGetPortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() - .getPortMirroringWithResponse("group1", "cloud1", "portMirroring1", com.azure.core.util.Context.NONE); + .getPortMirroringWithResponse("group1", "cloud1", null, "portMirroring1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPublicIpSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPublicIPSamples.java similarity index 51% rename from sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPublicIpSamples.java rename to sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPublicIPSamples.java index afec46a6e605..be4f3b1e35ba 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPublicIpSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPublicIPSamples.java @@ -1,16 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; /** - * Samples for WorkloadNetworks GetPublicIp. + * Samples for WorkloadNetworks GetPublicIP. */ -public final class WorkloadNetworksGetPublicIpSamples { +public final class WorkloadNetworksGetPublicIPSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetPublicIP.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetPublicIP.json */ /** * Sample code: WorkloadNetworks_GetPublicIP. @@ -19,6 +18,6 @@ public final class WorkloadNetworksGetPublicIpSamples { */ public static void workloadNetworksGetPublicIP(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() - .getPublicIpWithResponse("group1", "cloud1", "publicIP1", com.azure.core.util.Context.NONE); + .getPublicIPWithResponse("group1", "cloud1", null, "publicIP1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetSamples.java index 31a9a042420e..b24fab1df5cf 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksGetSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_Get.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_Get.json */ /** * Sample code: WorkloadNetworks_Get. @@ -18,6 +17,6 @@ public final class WorkloadNetworksGetSamples { * @param manager Entry point to AvsManager. */ public static void workloadNetworksGet(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().getWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE); + manager.workloadNetworks().getWithResponse("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetSegmentSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetSegmentSamples.java index 2ba3e5817545..0f06e12eada7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetSegmentSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetSegmentSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksGetSegmentSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetSegment.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetSegment.json */ /** * Sample code: WorkloadNetworks_GetSegment. @@ -19,6 +18,6 @@ public final class WorkloadNetworksGetSegmentSamples { */ public static void workloadNetworksGetSegment(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() - .getSegmentWithResponse("group1", "cloud1", "segment1", com.azure.core.util.Context.NONE); + .getSegmentWithResponse("group1", "cloud1", null, "segment1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVMGroupSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVMGroupSamples.java index d48a6294e819..93209b6c3304 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVMGroupSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVMGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksGetVMGroupSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetVMGroup.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetVMGroup.json */ /** * Sample code: WorkloadNetworks_GetVMGroup. @@ -19,6 +18,6 @@ public final class WorkloadNetworksGetVMGroupSamples { */ public static void workloadNetworksGetVMGroup(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() - .getVMGroupWithResponse("group1", "cloud1", "vmGroup1", com.azure.core.util.Context.NONE); + .getVMGroupWithResponse("group1", "cloud1", null, "vmGroup1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVirtualMachineSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVirtualMachineSamples.java index d09cfb5bda60..272e4d7b5348 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVirtualMachineSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVirtualMachineSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class WorkloadNetworksGetVirtualMachineSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_GetVirtualMachine - * .json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetVirtualMachine.json */ /** * Sample code: WorkloadNetworks_GetVirtualMachine. @@ -20,6 +18,6 @@ public final class WorkloadNetworksGetVirtualMachineSamples { */ public static void workloadNetworksGetVirtualMachine(com.azure.resourcemanager.avs.AvsManager manager) { manager.workloadNetworks() - .getVirtualMachineWithResponse("group1", "cloud1", "vm1", com.azure.core.util.Context.NONE); + .getVirtualMachineWithResponse("group1", "cloud1", null, "vm1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDhcpSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDhcpSamples.java index 4c8a87521a6d..0798b00c2976 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDhcpSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDhcpSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksListDhcpSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListDhcp.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListDhcp.json */ /** * Sample code: WorkloadNetworks_ListDhcp. @@ -18,6 +17,6 @@ public final class WorkloadNetworksListDhcpSamples { * @param manager Entry point to AvsManager. */ public static void workloadNetworksListDhcp(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listDhcp("group1", "cloud1", com.azure.core.util.Context.NONE); + manager.workloadNetworks().listDhcp("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServiceSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServiceSamples.java new file mode 100644 index 000000000000..e780b3303ed0 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServiceSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +/** + * Samples for WorkloadNetworks ListDnsService. + */ +public final class WorkloadNetworksListDnsServiceSamples { + /* + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListDnsServices.json + */ + /** + * Sample code: WorkloadNetworks_ListDnsServices. + * + * @param manager Entry point to AvsManager. + */ + public static void workloadNetworksListDnsServices(com.azure.resourcemanager.avs.AvsManager manager) { + manager.workloadNetworks().listDnsService("group1", "cloud1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServicesSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServicesSamples.java deleted file mode 100644 index 60a4bc737357..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServicesSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -/** - * Samples for WorkloadNetworks ListDnsServices. - */ -public final class WorkloadNetworksListDnsServicesSamples { - /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListDnsServices. - * json - */ - /** - * Sample code: WorkloadNetworks_ListDnsServices. - * - * @param manager Entry point to AvsManager. - */ - public static void workloadNetworksListDnsServices(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listDnsServices("group1", "cloud1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsZonesSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsZonesSamples.java index f9764ac62cc2..6fb23fac8367 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsZonesSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsZonesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksListDnsZonesSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListDnsZones.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListDnsZones.json */ /** * Sample code: WorkloadNetworks_ListDnsZones. @@ -18,6 +17,6 @@ public final class WorkloadNetworksListDnsZonesSamples { * @param manager Entry point to AvsManager. */ public static void workloadNetworksListDnsZones(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listDnsZones("group1", "cloud1", com.azure.core.util.Context.NONE); + manager.workloadNetworks().listDnsZones("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListGatewaysSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListGatewaysSamples.java index c403f2db1160..74a39ddf8ab5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListGatewaysSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListGatewaysSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksListGatewaysSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListGateways.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListGateways.json */ /** * Sample code: WorkloadNetworks_ListGateways. @@ -18,6 +17,6 @@ public final class WorkloadNetworksListGatewaysSamples { * @param manager Entry point to AvsManager. */ public static void workloadNetworksListGateways(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listGateways("group1", "cloud1", com.azure.core.util.Context.NONE); + manager.workloadNetworks().listGateways("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPortMirroringSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPortMirroringSamples.java index e3f773675e00..e95ac13a8681 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPortMirroringSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPortMirroringSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class WorkloadNetworksListPortMirroringSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListPortMirroring - * .json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListPortMirroring.json */ /** * Sample code: WorkloadNetworks_ListPortMirroring. @@ -19,6 +17,6 @@ public final class WorkloadNetworksListPortMirroringSamples { * @param manager Entry point to AvsManager. */ public static void workloadNetworksListPortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listPortMirroring("group1", "cloud1", com.azure.core.util.Context.NONE); + manager.workloadNetworks().listPortMirroring("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPublicIPsSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPublicIPsSamples.java index e6e186c759ae..0e35316e226b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPublicIPsSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPublicIPsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,9 +9,7 @@ */ public final class WorkloadNetworksListPublicIPsSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListPublicIPs. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListPublicIPs.json */ /** * Sample code: WorkloadNetworks_ListPublicIPs. @@ -19,6 +17,6 @@ public final class WorkloadNetworksListPublicIPsSamples { * @param manager Entry point to AvsManager. */ public static void workloadNetworksListPublicIPs(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listPublicIPs("group1", "cloud1", com.azure.core.util.Context.NONE); + manager.workloadNetworks().listPublicIPs("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListSamples.java index d22de3e3f03e..dc45431ea8d1 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksListSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_List.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_List.json */ /** * Sample code: WorkloadNetworks_List. diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListSegmentsSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListSegmentsSamples.java index d7a18c67ed24..089fa644d7c7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListSegmentsSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListSegmentsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksListSegmentsSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListSegments.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListSegments.json */ /** * Sample code: WorkloadNetworks_ListSegments. @@ -18,6 +17,6 @@ public final class WorkloadNetworksListSegmentsSamples { * @param manager Entry point to AvsManager. */ public static void workloadNetworksListSegments(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listSegments("group1", "cloud1", com.azure.core.util.Context.NONE); + manager.workloadNetworks().listSegments("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVMGroupsSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVMGroupsSamples.java index 4f2dfa22f588..9bfe446ac059 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVMGroupsSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVMGroupsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksListVMGroupsSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_ListVMGroups.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListVMGroups.json */ /** * Sample code: WorkloadNetworks_ListVMGroups. @@ -18,6 +17,6 @@ public final class WorkloadNetworksListVMGroupsSamples { * @param manager Entry point to AvsManager. */ public static void workloadNetworksListVMGroups(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listVMGroups("group1", "cloud1", com.azure.core.util.Context.NONE); + manager.workloadNetworks().listVMGroups("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVirtualMachinesSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVirtualMachinesSamples.java index bc01084c6c1d..7c60fbc72704 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVirtualMachinesSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVirtualMachinesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; @@ -9,8 +9,7 @@ */ public final class WorkloadNetworksListVirtualMachinesSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * WorkloadNetworks_ListVirtualMachines.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListVirtualMachines.json */ /** * Sample code: WorkloadNetworks_ListVirtualMachines. @@ -18,6 +17,6 @@ public final class WorkloadNetworksListVirtualMachinesSamples { * @param manager Entry point to AvsManager. */ public static void workloadNetworksListVirtualMachines(com.azure.resourcemanager.avs.AvsManager manager) { - manager.workloadNetworks().listVirtualMachines("group1", "cloud1", com.azure.core.util.Context.NONE); + manager.workloadNetworks().listVirtualMachines("group1", "cloud1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateDhcpSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateDhcpSamples.java deleted file mode 100644 index 7b51cb0dd66a..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateDhcpSamples.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcp; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpServer; - -/** - * Samples for WorkloadNetworks UpdateDhcp. - */ -public final class WorkloadNetworksUpdateDhcpSamples { - /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateDhcp.json - */ - /** - * Sample code: WorkloadNetworks_UpdateDhcp. - * - * @param manager Entry point to AvsManager. - */ - public static void workloadNetworksUpdateDhcp(com.azure.resourcemanager.avs.AvsManager manager) { - WorkloadNetworkDhcp resource = manager.workloadNetworks() - .getDhcpWithResponse("group1", "dhcp1", "cloud1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties( - new WorkloadNetworkDhcpServer().withRevision(1L).withServerAddress("40.1.5.1/24").withLeaseTime(86400L)) - .apply(); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateDnsServiceSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateDnsServiceSamples.java index a0cefc025c24..1df55d054c69 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateDnsServiceSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateDnsServiceSamples.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsService; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProperties; import java.util.Arrays; /** @@ -13,9 +14,7 @@ */ public final class WorkloadNetworksUpdateDnsServiceSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateDnsService. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateDnsService.json */ /** * Sample code: WorkloadNetworks_UpdateDnsService. @@ -24,15 +23,15 @@ public final class WorkloadNetworksUpdateDnsServiceSamples { */ public static void workloadNetworksUpdateDnsService(com.azure.resourcemanager.avs.AvsManager manager) { WorkloadNetworkDnsService resource = manager.workloadNetworks() - .getDnsServiceWithResponse("group1", "cloud1", "dnsService1", com.azure.core.util.Context.NONE) + .getDnsServiceWithResponse("group1", "cloud1", null, "dnsService1", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withDisplayName("dnsService1") - .withDnsServiceIp("5.5.5.5") - .withDefaultDnsZone("defaultDnsZone1") - .withFqdnZones(Arrays.asList("fqdnZone1")) - .withLogLevel(DnsServiceLogLevelEnum.INFO) - .withRevision(1L) + .withProperties(new WorkloadNetworkDnsServiceProperties().withDisplayName("dnsService1") + .withDnsServiceIp("5.5.5.5") + .withDefaultDnsZone("defaultDnsZone1") + .withFqdnZones(Arrays.asList("fqdnZone1")) + .withLogLevel(DnsServiceLogLevelEnum.INFO) + .withRevision(1L)) .apply(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateDnsZoneSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateDnsZoneSamples.java index a965cdc801c9..e9efcbcd0b56 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateDnsZoneSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateDnsZoneSamples.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZone; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProperties; import java.util.Arrays; /** @@ -12,9 +13,7 @@ */ public final class WorkloadNetworksUpdateDnsZoneSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateDnsZone. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateDnsZone.json */ /** * Sample code: WorkloadNetworks_UpdateDnsZone. @@ -23,14 +22,14 @@ public final class WorkloadNetworksUpdateDnsZoneSamples { */ public static void workloadNetworksUpdateDnsZone(com.azure.resourcemanager.avs.AvsManager manager) { WorkloadNetworkDnsZone resource = manager.workloadNetworks() - .getDnsZoneWithResponse("group1", "cloud1", "dnsZone1", com.azure.core.util.Context.NONE) + .getDnsZoneWithResponse("group1", "cloud1", null, "dnsZone1", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withDisplayName("dnsZone1") - .withDomain(Arrays.asList()) - .withDnsServerIps(Arrays.asList("1.1.1.1")) - .withSourceIp("8.8.8.8") - .withRevision(1L) + .withProperties(new WorkloadNetworkDnsZoneProperties().withDisplayName("dnsZone1") + .withDomain(Arrays.asList()) + .withDnsServerIps(Arrays.asList("1.1.1.1")) + .withSourceIp("8.8.8.8") + .withRevision(1L)) .apply(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdatePortMirroringSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdatePortMirroringSamples.java index 476b91caecee..6310d6e1568e 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdatePortMirroringSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdatePortMirroringSamples.java @@ -1,19 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroring; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProperties; /** * Samples for WorkloadNetworks UpdatePortMirroring. */ public final class WorkloadNetworksUpdatePortMirroringSamples { /* - * x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/ - * WorkloadNetworks_UpdatePortMirroring.json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdatePortMirroring.json */ /** * Sample code: WorkloadNetworks_UpdatePortMirroring. @@ -22,13 +22,14 @@ public final class WorkloadNetworksUpdatePortMirroringSamples { */ public static void workloadNetworksUpdatePortMirroring(com.azure.resourcemanager.avs.AvsManager manager) { WorkloadNetworkPortMirroring resource = manager.workloadNetworks() - .getPortMirroringWithResponse("group1", "cloud1", "portMirroring1", com.azure.core.util.Context.NONE) + .getPortMirroringWithResponse("group1", "cloud1", null, "portMirroring1", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withDirection(PortMirroringDirectionEnum.BIDIRECTIONAL) - .withSource("vmGroup1") - .withDestination("vmGroup2") - .withRevision(1L) + .withProperties( + new WorkloadNetworkPortMirroringProperties().withDirection(PortMirroringDirectionEnum.BIDIRECTIONAL) + .withSource("vmGroup1") + .withDestination("vmGroup2") + .withRevision(1L)) .apply(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateSegmentSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateSegmentSamples.java new file mode 100644 index 000000000000..f376cdc21c91 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateSegmentSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProperties; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; +import java.util.Arrays; + +/** + * Samples for WorkloadNetworks UpdateSegment. + */ +public final class WorkloadNetworksUpdateSegmentSamples { + /* + * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateSegments.json + */ + /** + * Sample code: WorkloadNetworks_UpdateSegments. + * + * @param manager Entry point to AvsManager. + */ + public static void workloadNetworksUpdateSegments(com.azure.resourcemanager.avs.AvsManager manager) { + WorkloadNetworkSegment resource = manager.workloadNetworks() + .getSegmentWithResponse("group1", "cloud1", null, "segment1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new WorkloadNetworkSegmentProperties().withConnectedGateway("/infra/tier-1s/gateway") + .withSubnet(new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("40.20.0.0-40.20.0.1")) + .withGatewayAddress("40.20.20.20/16")) + .withRevision(1L)) + .apply(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateSegmentsSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateSegmentsSamples.java deleted file mode 100644 index 6a0c67fff5dc..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateSegmentsSamples.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; -import java.util.Arrays; - -/** - * Samples for WorkloadNetworks UpdateSegments. - */ -public final class WorkloadNetworksUpdateSegmentsSamples { - /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateSegments. - * json - */ - /** - * Sample code: WorkloadNetworks_UpdateSegments. - * - * @param manager Entry point to AvsManager. - */ - public static void workloadNetworksUpdateSegments(com.azure.resourcemanager.avs.AvsManager manager) { - WorkloadNetworkSegment resource = manager.workloadNetworks() - .getSegmentWithResponse("group1", "cloud1", "segment1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withConnectedGateway("/infra/tier-1s/gateway") - .withSubnet(new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("40.20.0.0-40.20.0.1")) - .withGatewayAddress("40.20.20.20/16")) - .withRevision(1L) - .apply(); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateVMGroupSamples.java b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateVMGroupSamples.java index a0b31ee0c370..9e7b7143492a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateVMGroupSamples.java +++ b/sdk/avs/azure-resourcemanager-avs/src/samples/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksUpdateVMGroupSamples.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroup; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProperties; import java.util.Arrays; /** @@ -12,9 +13,7 @@ */ public final class WorkloadNetworksUpdateVMGroupSamples { /* - * x-ms-original-file: - * specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/WorkloadNetworks_UpdateVMGroup. - * json + * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateVMGroup.json */ /** * Sample code: WorkloadNetworks_UpdateVMGroup. @@ -23,8 +22,12 @@ public final class WorkloadNetworksUpdateVMGroupSamples { */ public static void workloadNetworksUpdateVMGroup(com.azure.resourcemanager.avs.AvsManager manager) { WorkloadNetworkVMGroup resource = manager.workloadNetworks() - .getVMGroupWithResponse("group1", "cloud1", "vmGroup1", com.azure.core.util.Context.NONE) + .getVMGroupWithResponse("group1", "cloud1", null, "vmGroup1", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withMembers(Arrays.asList("564d43da-fefc-2a3b-1d92-42855622fa50")).withRevision(1L).apply(); + resource.update() + .withProperties(new WorkloadNetworkVMGroupProperties() + .withMembers(Arrays.asList("564d43da-fefc-2a3b-1d92-42855622fa50")) + .withRevision(1L)) + .apply(); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonArcPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonArcPropertiesTests.java deleted file mode 100644 index a622cc4d89ae..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonArcPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.AddonArcProperties; -import org.junit.jupiter.api.Assertions; - -public final class AddonArcPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AddonArcProperties model = BinaryData - .fromString("{\"addonType\":\"Arc\",\"vCenter\":\"oezbrhubsk\",\"provisioningState\":\"Deleting\"}") - .toObject(AddonArcProperties.class); - Assertions.assertEquals("oezbrhubsk", model.vCenter()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AddonArcProperties model = new AddonArcProperties().withVCenter("oezbrhubsk"); - model = BinaryData.fromObject(model).toObject(AddonArcProperties.class); - Assertions.assertEquals("oezbrhubsk", model.vCenter()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonHcxPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonHcxPropertiesTests.java deleted file mode 100644 index 4e13501c0543..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonHcxPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.AddonHcxProperties; -import org.junit.jupiter.api.Assertions; - -public final class AddonHcxPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AddonHcxProperties model - = BinaryData.fromString("{\"addonType\":\"HCX\",\"offer\":\"ygo\",\"provisioningState\":\"Succeeded\"}") - .toObject(AddonHcxProperties.class); - Assertions.assertEquals("ygo", model.offer()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AddonHcxProperties model = new AddonHcxProperties().withOffer("ygo"); - model = BinaryData.fromObject(model).toObject(AddonHcxProperties.class); - Assertions.assertEquals("ygo", model.offer()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonInnerTests.java deleted file mode 100644 index 3af28f82ca5a..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.AddonInner; -import com.azure.resourcemanager.avs.models.AddonProperties; - -public final class AddonInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AddonInner model = BinaryData.fromString( - "{\"properties\":{\"addonType\":\"AddonProperties\",\"provisioningState\":\"Deleting\"},\"id\":\"dtopbob\",\"name\":\"og\",\"type\":\"m\"}") - .toObject(AddonInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AddonInner model = new AddonInner().withProperties(new AddonProperties()); - model = BinaryData.fromObject(model).toObject(AddonInner.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonListTests.java deleted file mode 100644 index a96ced57501e..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonListTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.AddonInner; -import com.azure.resourcemanager.avs.models.AddonList; -import com.azure.resourcemanager.avs.models.AddonProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AddonListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AddonList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"addonType\":\"AddonProperties\",\"provisioningState\":\"Failed\"},\"id\":\"j\",\"name\":\"oejctbzaqsqsy\",\"type\":\"bkbfkgukdkex\"},{\"properties\":{\"addonType\":\"AddonProperties\",\"provisioningState\":\"Succeeded\"},\"id\":\"mxaxc\",\"name\":\"jpgd\",\"type\":\"toc\"},{\"properties\":{\"addonType\":\"AddonProperties\",\"provisioningState\":\"Building\"},\"id\":\"pmouexhdz\",\"name\":\"i\",\"type\":\"qeojnxqbzvddntw\"},{\"properties\":{\"addonType\":\"AddonProperties\",\"provisioningState\":\"Deleting\"},\"id\":\"btwnpzaoqvuhrhcf\",\"name\":\"cyddglmjthjqk\",\"type\":\"pyeicxm\"}],\"nextLink\":\"iwqvhkh\"}") - .toObject(AddonList.class); - Assertions.assertEquals("iwqvhkh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AddonList model - = new AddonList().withValue(Arrays.asList(new AddonInner().withProperties(new AddonProperties()), - new AddonInner().withProperties(new AddonProperties()), - new AddonInner().withProperties(new AddonProperties()), - new AddonInner().withProperties(new AddonProperties()))).withNextLink("iwqvhkh"); - model = BinaryData.fromObject(model).toObject(AddonList.class); - Assertions.assertEquals("iwqvhkh", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonPropertiesTests.java deleted file mode 100644 index d139b51673eb..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.AddonProperties; - -public final class AddonPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AddonProperties model - = BinaryData.fromString("{\"addonType\":\"AddonProperties\",\"provisioningState\":\"Deleting\"}") - .toObject(AddonProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AddonProperties model = new AddonProperties(); - model = BinaryData.fromObject(model).toObject(AddonProperties.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonVrPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonVrPropertiesTests.java deleted file mode 100644 index 325f3d737810..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonVrPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.AddonVrProperties; -import org.junit.jupiter.api.Assertions; - -public final class AddonVrPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AddonVrProperties model - = BinaryData.fromString("{\"addonType\":\"VR\",\"vrsCount\":470627507,\"provisioningState\":\"Cancelled\"}") - .toObject(AddonVrProperties.class); - Assertions.assertEquals(470627507, model.vrsCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AddonVrProperties model = new AddonVrProperties().withVrsCount(470627507); - model = BinaryData.fromObject(model).toObject(AddonVrProperties.class); - Assertions.assertEquals(470627507, model.vrsCount()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsCreateOrUpdateMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsCreateOrUpdateMockTests.java index a6bb800b9a35..dc30e0c7e068 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsCreateOrUpdateMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.Addon; @@ -21,18 +21,18 @@ public final class AddonsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"addonType\":\"AddonProperties\",\"provisioningState\":\"Succeeded\"},\"id\":\"gnjdgkynscliqhz\",\"name\":\"h\",\"type\":\"nk\"}"; + = "{\"properties\":{\"addonType\":\"AddonProperties\",\"provisioningState\":\"Succeeded\"},\"id\":\"namtuatmzw\",\"name\":\"jj\",\"type\":\"cqtjzmi\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Addon response = manager.addons() - .define("auy") - .withExistingPrivateCloud("qyuvvfonkp", "hqyikvy") + .define("fiqwoy") + .withExistingPrivateCloud("gnzxojpslsvj", "pli") .withProperties(new AddonProperties()) .create(); diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsDeleteMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsDeleteMockTests.java index d34353850f1c..18a2cf5defe4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsDeleteMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.addons().delete("tj", "zysdzh", "zwwva", com.azure.core.util.Context.NONE); + manager.addons().delete("uem", "anbwzohmnrxxbso", "klinhmdptysprq", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsGetWithResponseMockTests.java index 9845a5e335c7..bd0fd5d2cf47 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsGetWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.Addon; @@ -20,17 +20,17 @@ public final class AddonsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"addonType\":\"AddonProperties\",\"provisioningState\":\"Building\"},\"id\":\"ho\",\"name\":\"dynhdwdigum\",\"type\":\"nraauzz\"}"; + = "{\"properties\":{\"addonType\":\"AddonProperties\",\"provisioningState\":\"Canceled\"},\"id\":\"qybxceakxcp\",\"name\":\"soqfyiaseqchkrt\",\"type\":\"zrazisgyk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Addon response = manager.addons() - .getWithResponse("pkc", "ayzri", "khyawfvjlboxqv", com.azure.core.util.Context.NONE) + .getWithResponse("acigel", "ohdbvqvwzkj", "pwbeonr", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsListMockTests.java index 6c462a83c49b..4c6acc8962c3 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsListMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AddonsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.Addon; @@ -21,17 +21,17 @@ public final class AddonsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"addonType\":\"AddonProperties\",\"provisioningState\":\"Updating\"},\"id\":\"glae\",\"name\":\"xndticokpvzmlqtm\",\"type\":\"dgxobfircl\"}]}"; + = "{\"value\":[{\"properties\":{\"addonType\":\"AddonProperties\",\"provisioningState\":\"Succeeded\"},\"id\":\"iidlop\",\"name\":\"dbwdpyqyybxubmdn\",\"type\":\"fcbqwremjela\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.addons().list("utnwytpzdmovzvf", "aawzqadfl", com.azure.core.util.Context.NONE); + = manager.addons().list("rrueqthwmg", "mbscbbx", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AuthorizationsDeleteMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AuthorizationsDeleteMockTests.java index 1fecf6badc62..6954a1bb3c0c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AuthorizationsDeleteMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AuthorizationsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.authorizations().delete("sdymbrn", "suxmpraf", "g", com.azure.core.util.Context.NONE); + manager.authorizations().delete("ptjgwdt", "ukranblw", "hqlkccuzgygqwaho", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AvailabilityPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AvailabilityPropertiesTests.java deleted file mode 100644 index 8b79b5c9fee1..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/AvailabilityPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.AvailabilityProperties; -import com.azure.resourcemanager.avs.models.AvailabilityStrategy; -import org.junit.jupiter.api.Assertions; - -public final class AvailabilityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailabilityProperties model - = BinaryData.fromString("{\"strategy\":\"SingleZone\",\"zone\":1462222832,\"secondaryZone\":835826608}") - .toObject(AvailabilityProperties.class); - Assertions.assertEquals(AvailabilityStrategy.SINGLE_ZONE, model.strategy()); - Assertions.assertEquals(1462222832, model.zone()); - Assertions.assertEquals(835826608, model.secondaryZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailabilityProperties model = new AvailabilityProperties().withStrategy(AvailabilityStrategy.SINGLE_ZONE) - .withZone(1462222832) - .withSecondaryZone(835826608); - model = BinaryData.fromObject(model).toObject(AvailabilityProperties.class); - Assertions.assertEquals(AvailabilityStrategy.SINGLE_ZONE, model.strategy()); - Assertions.assertEquals(1462222832, model.zone()); - Assertions.assertEquals(835826608, model.secondaryZone()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CircuitTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CircuitTests.java deleted file mode 100644 index 448914c38c64..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CircuitTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.Circuit; - -public final class CircuitTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Circuit model = BinaryData.fromString( - "{\"primarySubnet\":\"yb\",\"secondarySubnet\":\"qedqytbciqfoufl\",\"expressRouteID\":\"nkzsmodmglou\",\"expressRoutePrivatePeeringID\":\"b\"}") - .toObject(Circuit.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Circuit model = new Circuit(); - model = BinaryData.fromObject(model).toObject(Circuit.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinkInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinkInnerTests.java deleted file mode 100644 index ad75b14ffbfe..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinkInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.CloudLinkInner; -import org.junit.jupiter.api.Assertions; - -public final class CloudLinkInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudLinkInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"status\":\"Deleting\",\"linkedCloud\":\"nbacfi\"},\"id\":\"l\",\"name\":\"bxetqgtzxdpn\",\"type\":\"bqqwxrj\"}") - .toObject(CloudLinkInner.class); - Assertions.assertEquals("nbacfi", model.linkedCloud()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudLinkInner model = new CloudLinkInner().withLinkedCloud("nbacfi"); - model = BinaryData.fromObject(model).toObject(CloudLinkInner.class); - Assertions.assertEquals("nbacfi", model.linkedCloud()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinkListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinkListTests.java deleted file mode 100644 index 81d4e6819f4d..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinkListTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.CloudLinkInner; -import com.azure.resourcemanager.avs.models.CloudLinkList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CloudLinkListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudLinkList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"status\":\"Failed\",\"linkedCloud\":\"nxkrx\"},\"id\":\"mi\",\"name\":\"tthzrvqd\",\"type\":\"abhjybi\"},{\"properties\":{\"provisioningState\":\"Failed\",\"status\":\"Failed\",\"linkedCloud\":\"owskanyktz\"},\"id\":\"u\",\"name\":\"y\",\"type\":\"gqywgndrv\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"status\":\"Failed\",\"linkedCloud\":\"hrc\"},\"id\":\"nc\",\"name\":\"cpecfvmmcoofs\",\"type\":\"lzevgbmqjqab\"}],\"nextLink\":\"pmivkwlzu\"}") - .toObject(CloudLinkList.class); - Assertions.assertEquals("nxkrx", model.value().get(0).linkedCloud()); - Assertions.assertEquals("pmivkwlzu", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudLinkList model = new CloudLinkList() - .withValue(Arrays.asList(new CloudLinkInner().withLinkedCloud("nxkrx"), - new CloudLinkInner().withLinkedCloud("owskanyktz"), new CloudLinkInner().withLinkedCloud("hrc"))) - .withNextLink("pmivkwlzu"); - model = BinaryData.fromObject(model).toObject(CloudLinkList.class); - Assertions.assertEquals("nxkrx", model.value().get(0).linkedCloud()); - Assertions.assertEquals("pmivkwlzu", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinkPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinkPropertiesTests.java deleted file mode 100644 index 805075823dcc..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinkPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.CloudLinkProperties; -import org.junit.jupiter.api.Assertions; - -public final class CloudLinkPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudLinkProperties model = BinaryData - .fromString("{\"provisioningState\":\"Succeeded\",\"status\":\"Building\",\"linkedCloud\":\"wsubisnja\"}") - .toObject(CloudLinkProperties.class); - Assertions.assertEquals("wsubisnja", model.linkedCloud()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudLinkProperties model = new CloudLinkProperties().withLinkedCloud("wsubisnja"); - model = BinaryData.fromObject(model).toObject(CloudLinkProperties.class); - Assertions.assertEquals("wsubisnja", model.linkedCloud()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksCreateOrUpdateMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksCreateOrUpdateMockTests.java index 22606108aaf2..887e40e00da5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksCreateOrUpdateMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksCreateOrUpdateMockTests.java @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.CloudLink; +import com.azure.resourcemanager.avs.models.CloudLinkProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -21,21 +22,21 @@ public final class CloudLinksCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"status\":\"Building\",\"linkedCloud\":\"wcluqovekqvgq\"},\"id\":\"wifzmp\",\"name\":\"wyivqikf\",\"type\":\"cvhrfsp\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"status\":\"Disconnected\",\"linkedCloud\":\"xaomzisglrrc\"},\"id\":\"zkhhltnjadhqo\",\"name\":\"wjqo\",\"type\":\"ueayfbpcmsplb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CloudLink response = manager.cloudLinks() - .define("pe") - .withExistingPrivateCloud("ysownbtgkbug", "jqctojcmisofie") - .withLinkedCloud("cuplcplcwkhih") + .define("gypxrxvbfihwuhvc") + .withExistingPrivateCloud("urnnqbnqbpiz", "qltgrd") + .withProperties(new CloudLinkProperties().withLinkedCloud("rblmli")) .create(); - Assertions.assertEquals("wcluqovekqvgq", response.linkedCloud()); + Assertions.assertEquals("xaomzisglrrc", response.properties().linkedCloud()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksDeleteMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksDeleteMockTests.java index 367ffbf3004d..655ee69437ed 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksDeleteMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.cloudLinks().delete("qwogfnzjvus", "zldmozuxy", "fsbtkad", com.azure.core.util.Context.NONE); + manager.cloudLinks().delete("dmxzjijpv", "aurkihcirlde", "xrdcoxnbkkja", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksGetWithResponseMockTests.java index b057d0e9a16d..d7e3c62cee83 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksGetWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.CloudLink; @@ -21,19 +21,19 @@ public final class CloudLinksGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Failed\",\"status\":\"Active\",\"linkedCloud\":\"ra\"},\"id\":\"aawiuagydwqfb\",\"name\":\"lyr\",\"type\":\"giagtcojo\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"status\":\"Failed\",\"linkedCloud\":\"rpqpd\"},\"id\":\"mkoisqcssf\",\"name\":\"xuifmcsypobkdqz\",\"type\":\"dzsylollgtrczz\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CloudLink response = manager.cloudLinks() - .getWithResponse("nzeyqxtjj", "zqlqhyc", "vodggxdbee", com.azure.core.util.Context.NONE) + .getWithResponse("ycphdrwjjkhvyo", "ac", "u", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ra", response.linkedCloud()); + Assertions.assertEquals("rpqpd", response.properties().linkedCloud()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksListMockTests.java index de319ffba6b8..d0d9a42f77c9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksListMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/CloudLinksListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.CloudLink; @@ -22,17 +22,18 @@ public final class CloudLinksListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"status\":\"Active\",\"linkedCloud\":\"hmfdnbzydvfvfcj\"},\"id\":\"eoisrvhmgor\",\"name\":\"fukiscvwmzhw\",\"type\":\"lefaxvxilcbtgn\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"status\":\"Active\",\"linkedCloud\":\"q\"},\"id\":\"xrjkixtwb\",\"name\":\"aoypny\",\"type\":\"hshxcylhkgmnsghp\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.cloudLinks().list("xg", "moy", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.cloudLinks().list("dlrgms", "lzgaufcshhvnew", com.azure.core.util.Context.NONE); - Assertions.assertEquals("hmfdnbzydvfvfcj", response.iterator().next().linkedCloud()); + Assertions.assertEquals("q", response.iterator().next().properties().linkedCloud()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterInnerTests.java deleted file mode 100644 index 16379f4ecf47..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterInnerTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ClusterInner; -import com.azure.resourcemanager.avs.models.Sku; -import com.azure.resourcemanager.avs.models.SkuTier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClusterInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterInner model = BinaryData.fromString( - "{\"properties\":{\"clusterSize\":1625524147,\"provisioningState\":\"Deleting\",\"clusterId\":55863349,\"hosts\":[\"ltyfsop\",\"usue\",\"nzwdejba\",\"orxzdmohctbqvud\"],\"vsanDatastoreName\":\"dndnvow\"},\"sku\":{\"name\":\"ujjugwdkcglh\",\"tier\":\"Basic\",\"size\":\"jdyggdtji\",\"family\":\"b\",\"capacity\":2140516005},\"id\":\"qweykhmenev\",\"name\":\"yexfwh\",\"type\":\"bcibvyvdcsitynn\"}") - .toObject(ClusterInner.class); - Assertions.assertEquals("ujjugwdkcglh", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("jdyggdtji", model.sku().size()); - Assertions.assertEquals("b", model.sku().family()); - Assertions.assertEquals(2140516005, model.sku().capacity()); - Assertions.assertEquals(1625524147, model.clusterSize()); - Assertions.assertEquals("ltyfsop", model.hosts().get(0)); - Assertions.assertEquals("dndnvow", model.vsanDatastoreName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterInner model = new ClusterInner() - .withSku(new Sku().withName("ujjugwdkcglh") - .withTier(SkuTier.BASIC) - .withSize("jdyggdtji") - .withFamily("b") - .withCapacity(2140516005)) - .withClusterSize(1625524147) - .withHosts(Arrays.asList("ltyfsop", "usue", "nzwdejba", "orxzdmohctbqvud")) - .withVsanDatastoreName("dndnvow"); - model = BinaryData.fromObject(model).toObject(ClusterInner.class); - Assertions.assertEquals("ujjugwdkcglh", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("jdyggdtji", model.sku().size()); - Assertions.assertEquals("b", model.sku().family()); - Assertions.assertEquals(2140516005, model.sku().capacity()); - Assertions.assertEquals(1625524147, model.clusterSize()); - Assertions.assertEquals("ltyfsop", model.hosts().get(0)); - Assertions.assertEquals("dndnvow", model.vsanDatastoreName()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterListTests.java deleted file mode 100644 index 3d51476443b9..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterListTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ClusterInner; -import com.azure.resourcemanager.avs.models.ClusterList; -import com.azure.resourcemanager.avs.models.Sku; -import com.azure.resourcemanager.avs.models.SkuTier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClusterListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"clusterSize\":409786419,\"provisioningState\":\"Failed\",\"clusterId\":86962705,\"hosts\":[\"qwoochcbon\"],\"vsanDatastoreName\":\"pkvlrxn\"},\"sku\":{\"name\":\"ea\",\"tier\":\"Premium\",\"size\":\"heoflokeyyienjbd\",\"family\":\"tgrhpdjpjumas\",\"capacity\":271162944},\"id\":\"pqyegualhbxxh\",\"name\":\"jj\",\"type\":\"zvdudgwdslfhotwm\"}],\"nextLink\":\"npwlbjnpg\"}") - .toObject(ClusterList.class); - Assertions.assertEquals("ea", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).sku().tier()); - Assertions.assertEquals("heoflokeyyienjbd", model.value().get(0).sku().size()); - Assertions.assertEquals("tgrhpdjpjumas", model.value().get(0).sku().family()); - Assertions.assertEquals(271162944, model.value().get(0).sku().capacity()); - Assertions.assertEquals(409786419, model.value().get(0).clusterSize()); - Assertions.assertEquals("qwoochcbon", model.value().get(0).hosts().get(0)); - Assertions.assertEquals("pkvlrxn", model.value().get(0).vsanDatastoreName()); - Assertions.assertEquals("npwlbjnpg", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterList model = new ClusterList().withValue(Arrays.asList(new ClusterInner() - .withSku(new Sku().withName("ea") - .withTier(SkuTier.PREMIUM) - .withSize("heoflokeyyienjbd") - .withFamily("tgrhpdjpjumas") - .withCapacity(271162944)) - .withClusterSize(409786419) - .withHosts(Arrays.asList("qwoochcbon")) - .withVsanDatastoreName("pkvlrxn"))).withNextLink("npwlbjnpg"); - model = BinaryData.fromObject(model).toObject(ClusterList.class); - Assertions.assertEquals("ea", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).sku().tier()); - Assertions.assertEquals("heoflokeyyienjbd", model.value().get(0).sku().size()); - Assertions.assertEquals("tgrhpdjpjumas", model.value().get(0).sku().family()); - Assertions.assertEquals(271162944, model.value().get(0).sku().capacity()); - Assertions.assertEquals(409786419, model.value().get(0).clusterSize()); - Assertions.assertEquals("qwoochcbon", model.value().get(0).hosts().get(0)); - Assertions.assertEquals("pkvlrxn", model.value().get(0).vsanDatastoreName()); - Assertions.assertEquals("npwlbjnpg", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterPropertiesTests.java deleted file mode 100644 index dcb7a7a6290d..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ClusterProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClusterPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterProperties model = BinaryData.fromString( - "{\"clusterSize\":1611277697,\"provisioningState\":\"Updating\",\"clusterId\":1602339472,\"hosts\":[\"f\",\"qsc\",\"eypvhezrkg\",\"hcjrefovgmk\"],\"vsanDatastoreName\":\"leyyvx\"}") - .toObject(ClusterProperties.class); - Assertions.assertEquals(1611277697, model.clusterSize()); - Assertions.assertEquals("f", model.hosts().get(0)); - Assertions.assertEquals("leyyvx", model.vsanDatastoreName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterProperties model = new ClusterProperties().withClusterSize(1611277697) - .withHosts(Arrays.asList("f", "qsc", "eypvhezrkg", "hcjrefovgmk")) - .withVsanDatastoreName("leyyvx"); - model = BinaryData.fromObject(model).toObject(ClusterProperties.class); - Assertions.assertEquals(1611277697, model.clusterSize()); - Assertions.assertEquals("f", model.hosts().get(0)); - Assertions.assertEquals("leyyvx", model.vsanDatastoreName()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterUpdatePropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterUpdatePropertiesTests.java deleted file mode 100644 index 318ed7859332..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterUpdatePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ClusterUpdateProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClusterUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterUpdateProperties model - = BinaryData.fromString("{\"clusterSize\":1961920372,\"hosts\":[\"uiuaodsfcpkvxodp\"]}") - .toObject(ClusterUpdateProperties.class); - Assertions.assertEquals(1961920372, model.clusterSize()); - Assertions.assertEquals("uiuaodsfcpkvxodp", model.hosts().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterUpdateProperties model - = new ClusterUpdateProperties().withClusterSize(1961920372).withHosts(Arrays.asList("uiuaodsfcpkvxodp")); - model = BinaryData.fromObject(model).toObject(ClusterUpdateProperties.class); - Assertions.assertEquals(1961920372, model.clusterSize()); - Assertions.assertEquals("uiuaodsfcpkvxodp", model.hosts().get(0)); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterUpdateTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterUpdateTests.java deleted file mode 100644 index 58dfb947d57f..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterUpdateTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.ClusterUpdate; -import com.azure.resourcemanager.avs.models.Sku; -import com.azure.resourcemanager.avs.models.SkuTier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClusterUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterUpdate model = BinaryData.fromString( - "{\"sku\":{\"name\":\"jpkcattpng\",\"tier\":\"Standard\",\"size\":\"czsqpjhvm\",\"family\":\"jvnysounqe\",\"capacity\":904416760},\"properties\":{\"clusterSize\":1054713689,\"hosts\":[\"fhyhltrpmopjmcma\",\"u\"]}}") - .toObject(ClusterUpdate.class); - Assertions.assertEquals("jpkcattpng", model.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals("czsqpjhvm", model.sku().size()); - Assertions.assertEquals("jvnysounqe", model.sku().family()); - Assertions.assertEquals(904416760, model.sku().capacity()); - Assertions.assertEquals(1054713689, model.clusterSize()); - Assertions.assertEquals("fhyhltrpmopjmcma", model.hosts().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterUpdate model - = new ClusterUpdate() - .withSku(new Sku().withName("jpkcattpng") - .withTier(SkuTier.STANDARD) - .withSize("czsqpjhvm") - .withFamily("jvnysounqe") - .withCapacity(904416760)) - .withClusterSize(1054713689) - .withHosts(Arrays.asList("fhyhltrpmopjmcma", "u")); - model = BinaryData.fromObject(model).toObject(ClusterUpdate.class); - Assertions.assertEquals("jpkcattpng", model.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals("czsqpjhvm", model.sku().size()); - Assertions.assertEquals("jvnysounqe", model.sku().family()); - Assertions.assertEquals(904416760, model.sku().capacity()); - Assertions.assertEquals(1054713689, model.clusterSize()); - Assertions.assertEquals("fhyhltrpmopjmcma", model.hosts().get(0)); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterZoneListInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterZoneListInnerTests.java deleted file mode 100644 index 8651e4b59785..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterZoneListInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ClusterZoneListInner; -import com.azure.resourcemanager.avs.models.ClusterZone; -import java.util.Arrays; - -public final class ClusterZoneListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterZoneListInner model = BinaryData.fromString( - "{\"zones\":[{\"hosts\":[\"zrnkcqvyxlwh\",\"lsicohoqqnwv\",\"ryavwhheunmmqh\",\"yxzk\"],\"zone\":\"ocukoklyax\"},{\"hosts\":[\"nuqszfkbey\"],\"zone\":\"wrmjmwvvjektc\"}]}") - .toObject(ClusterZoneListInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterZoneListInner model - = new ClusterZoneListInner().withZones(Arrays.asList(new ClusterZone(), new ClusterZone())); - model = BinaryData.fromObject(model).toObject(ClusterZoneListInner.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterZoneTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterZoneTests.java deleted file mode 100644 index b13b73ba7d10..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClusterZoneTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.ClusterZone; - -public final class ClusterZoneTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterZone model - = BinaryData.fromString("{\"hosts\":[\"nhwlrsffrzpwvl\",\"dqgbiqylihkaetc\"],\"zone\":\"vfcivfsnkymuc\"}") - .toObject(ClusterZone.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterZone model = new ClusterZone(); - model = BinaryData.fromObject(model).toObject(ClusterZone.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersCreateOrUpdateMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersCreateOrUpdateMockTests.java index 2e4f6ab4e0c5..e64f284b4933 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersCreateOrUpdateMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersCreateOrUpdateMockTests.java @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.Cluster; +import com.azure.resourcemanager.avs.models.ClusterProperties; import com.azure.resourcemanager.avs.models.Sku; import com.azure.resourcemanager.avs.models.SkuTier; import java.nio.charset.StandardCharsets; @@ -24,35 +25,35 @@ public final class ClustersCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"clusterSize\":312575916,\"provisioningState\":\"Succeeded\",\"clusterId\":1231243109,\"hosts\":[\"nbixxrti\"],\"vsanDatastoreName\":\"cpwpg\"},\"sku\":{\"name\":\"lrcivtsoxfrke\",\"tier\":\"Premium\",\"size\":\"yyefrpmpdnqqs\",\"family\":\"waoqvmmb\",\"capacity\":538705263},\"id\":\"rtql\",\"name\":\"zmegnitgvk\",\"type\":\"lzyqd\"}"; + = "{\"properties\":{\"clusterSize\":1317023626,\"provisioningState\":\"Succeeded\",\"clusterId\":1675094486,\"hosts\":[\"sfxsf\",\"ztlvtmvagbwidqlv\"],\"vsanDatastoreName\":\"koveof\"},\"sku\":{\"name\":\"zrvjfnmjmvlwyzgi\",\"tier\":\"Standard\",\"size\":\"jrllf\",\"family\":\"uidjpuuyjucej\",\"capacity\":951024565},\"id\":\"eovvtzej\",\"name\":\"tjklntikyjuzk\",\"type\":\"bqzolxr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Cluster response = manager.clusters() - .define("vetnwsdtutn") - .withExistingPrivateCloud("a", "cqusr") - .withSku(new Sku().withName("udypohyuems") - .withTier(SkuTier.PREMIUM) - .withSize("qyrp") - .withFamily("obrltt") - .withCapacity(2105592893)) - .withClusterSize(1517277198) - .withHosts(Arrays.asList("yrmewipmvekdx", "kuqgsjjxundxgket", "zhhzjhfjmhvvmu", "gpmuneqsxvmhfbuz")) - .withVsanDatastoreName("ihsasb") + .define("hotj") + .withExistingPrivateCloud("rr", "yejylmbkzudnigrf") + .withSku(new Sku().withName("qaxsipietgbebjf") + .withTier(SkuTier.BASIC) + .withSize("oichdlpnfpubnt") + .withFamily("atzviqsowsaael") + .withCapacity(1574672504)) + .withProperties(new ClusterProperties().withClusterSize(1732039162) + .withHosts(Arrays.asList("nrefqyh", "otoihiqa", "ydiw")) + .withVsanDatastoreName("rkwpzdqtvhcspod")) .create(); - Assertions.assertEquals("lrcivtsoxfrke", response.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.sku().tier()); - Assertions.assertEquals("yyefrpmpdnqqs", response.sku().size()); - Assertions.assertEquals("waoqvmmb", response.sku().family()); - Assertions.assertEquals(538705263, response.sku().capacity()); - Assertions.assertEquals(312575916, response.clusterSize()); - Assertions.assertEquals("nbixxrti", response.hosts().get(0)); - Assertions.assertEquals("cpwpg", response.vsanDatastoreName()); + Assertions.assertEquals(1317023626, response.properties().clusterSize()); + Assertions.assertEquals("sfxsf", response.properties().hosts().get(0)); + Assertions.assertEquals("koveof", response.properties().vsanDatastoreName()); + Assertions.assertEquals("zrvjfnmjmvlwyzgi", response.sku().name()); + Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); + Assertions.assertEquals("jrllf", response.sku().size()); + Assertions.assertEquals("uidjpuuyjucej", response.sku().family()); + Assertions.assertEquals(951024565, response.sku().capacity()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersDeleteMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersDeleteMockTests.java index cad841f4e2c3..fc071b4cb055 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersDeleteMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.clusters().delete("jhlfzswpchwahf", "ousnfepgfewe", "wlyxgncxyk", com.azure.core.util.Context.NONE); + manager.clusters().delete("bvopwndyqle", "llklmtk", "lowkxxpvb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersGetWithResponseMockTests.java index 5156f6d726c6..bb97ae2748ef 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersGetWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.Cluster; @@ -22,26 +22,26 @@ public final class ClustersGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"clusterSize\":754106802,\"provisioningState\":\"Failed\",\"clusterId\":1484369172,\"hosts\":[\"ohu\"],\"vsanDatastoreName\":\"wtwko\"},\"sku\":{\"name\":\"zwculkbawpfajnj\",\"tier\":\"Premium\",\"size\":\"wtjjguktalhsnv\",\"family\":\"dmxzr\",\"capacity\":596889388},\"id\":\"mlnwiaaomylweazu\",\"name\":\"cse\",\"type\":\"hwwn\"}"; + = "{\"properties\":{\"clusterSize\":64866209,\"provisioningState\":\"Canceled\",\"clusterId\":1831822639,\"hosts\":[\"viyfcaabeolhbhlv\",\"mxuq\",\"bsxtkcudfbsfarfs\"],\"vsanDatastoreName\":\"wlkjxn\"},\"sku\":{\"name\":\"pvwgfstmhqykizmd\",\"tier\":\"Free\",\"size\":\"afclu\",\"family\":\"oxmycjimryvw\",\"capacity\":1052879653},\"id\":\"pbmz\",\"name\":\"w\",\"type\":\"sydsxwefohe\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Cluster response = manager.clusters() - .getWithResponse("beitpkx", "tmo", "bklftidgfcwqmpim", com.azure.core.util.Context.NONE) + .getWithResponse("qhnlbqnbld", "eaclgschorimk", "srrm", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("zwculkbawpfajnj", response.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.sku().tier()); - Assertions.assertEquals("wtjjguktalhsnv", response.sku().size()); - Assertions.assertEquals("dmxzr", response.sku().family()); - Assertions.assertEquals(596889388, response.sku().capacity()); - Assertions.assertEquals(754106802, response.clusterSize()); - Assertions.assertEquals("ohu", response.hosts().get(0)); - Assertions.assertEquals("wtwko", response.vsanDatastoreName()); + Assertions.assertEquals(64866209, response.properties().clusterSize()); + Assertions.assertEquals("viyfcaabeolhbhlv", response.properties().hosts().get(0)); + Assertions.assertEquals("wlkjxn", response.properties().vsanDatastoreName()); + Assertions.assertEquals("pvwgfstmhqykizmd", response.sku().name()); + Assertions.assertEquals(SkuTier.FREE, response.sku().tier()); + Assertions.assertEquals("afclu", response.sku().size()); + Assertions.assertEquals("oxmycjimryvw", response.sku().family()); + Assertions.assertEquals(1052879653, response.sku().capacity()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersListMockTests.java index 745381b6e3ba..acd4c11bf866 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersListMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.Cluster; @@ -23,25 +23,25 @@ public final class ClustersListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"clusterSize\":602518095,\"provisioningState\":\"Canceled\",\"clusterId\":982758961,\"hosts\":[\"qibrtalme\",\"ttwgdsl\",\"xih\",\"rmooizqse\"],\"vsanDatastoreName\":\"xiutcx\"},\"sku\":{\"name\":\"pzhyr\",\"tier\":\"Standard\",\"size\":\"g\",\"family\":\"joxslhvnhla\",\"capacity\":107871538},\"id\":\"kkzjcjbtrga\",\"name\":\"hvv\",\"type\":\"brxjjsto\"}]}"; + = "{\"value\":[{\"properties\":{\"clusterSize\":757047359,\"provisioningState\":\"Canceled\",\"clusterId\":1911202456,\"hosts\":[\"d\",\"ibidmhmwffp\",\"fmuvapckccr\",\"vwe\"],\"vsanDatastoreName\":\"xoy\"},\"sku\":{\"name\":\"ukphaimmoiroq\",\"tier\":\"Basic\",\"size\":\"bragapyyrmf\",\"family\":\"bpav\",\"capacity\":1121164177},\"id\":\"ppdbwnupgahxkum\",\"name\":\"sjcaacfdmmcpugm\",\"type\":\"hqepvufhbzehewh\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.clusters().list("uagrttikteusqc", "kvyklxubyjaffmm", com.azure.core.util.Context.NONE); + = manager.clusters().list("zqcyknap", "ofyuicd", com.azure.core.util.Context.NONE); - Assertions.assertEquals("pzhyr", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.iterator().next().sku().tier()); - Assertions.assertEquals("g", response.iterator().next().sku().size()); - Assertions.assertEquals("joxslhvnhla", response.iterator().next().sku().family()); - Assertions.assertEquals(107871538, response.iterator().next().sku().capacity()); - Assertions.assertEquals(602518095, response.iterator().next().clusterSize()); - Assertions.assertEquals("qibrtalme", response.iterator().next().hosts().get(0)); - Assertions.assertEquals("xiutcx", response.iterator().next().vsanDatastoreName()); + Assertions.assertEquals(757047359, response.iterator().next().properties().clusterSize()); + Assertions.assertEquals("d", response.iterator().next().properties().hosts().get(0)); + Assertions.assertEquals("xoy", response.iterator().next().properties().vsanDatastoreName()); + Assertions.assertEquals("ukphaimmoiroq", response.iterator().next().sku().name()); + Assertions.assertEquals(SkuTier.BASIC, response.iterator().next().sku().tier()); + Assertions.assertEquals("bragapyyrmf", response.iterator().next().sku().size()); + Assertions.assertEquals("bpav", response.iterator().next().sku().family()); + Assertions.assertEquals(1121164177, response.iterator().next().sku().capacity()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersListZonesWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersListZonesWithResponseMockTests.java index d221c6a81e6c..ca74fa9c2fe6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersListZonesWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ClustersListZonesWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.ClusterZoneList; @@ -20,17 +20,17 @@ public final class ClustersListZonesWithResponseMockTests { @Test public void testListZonesWithResponse() throws Exception { String responseStr - = "{\"zones\":[{\"hosts\":[\"fpxtg\",\"scjavftju\",\"dqazkmtgguwpijra\"],\"zone\":\"ivmmghfcfiwrxgk\"},{\"hosts\":[\"vyi\",\"zqodfvpgshox\",\"sgbpfgzdjtx\",\"zflbqvg\"],\"zone\":\"vl\"}]}"; + = "{\"zones\":[{\"hosts\":[\"pjrtws\",\"hv\"],\"zone\":\"icphvtrrmhw\"},{\"hosts\":[\"dpyflubhv\",\"glrocuy\",\"lw\"],\"zone\":\"memhooclutnpq\"},{\"hosts\":[\"czj\",\"mmyky\"],\"zone\":\"xsglh\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ClusterZoneList response = manager.clusters() - .listZonesWithResponse("hdjhlimmbcx", "h", "cporxvxcjz", com.azure.core.util.Context.NONE) + .listZonesWithResponse("dfjmzsyzfhotlh", "k", "yych", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoreInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoreInnerTests.java deleted file mode 100644 index 425193483ccd..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoreInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; -import com.azure.resourcemanager.avs.models.DiskPoolVolume; -import com.azure.resourcemanager.avs.models.ElasticSanVolume; -import com.azure.resourcemanager.avs.models.MountOptionEnum; -import com.azure.resourcemanager.avs.models.NetAppVolume; -import org.junit.jupiter.api.Assertions; - -public final class DatastoreInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatastoreInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"zy\"},\"diskPoolVolume\":{\"targetId\":\"hxmzsbbzoggig\",\"lunName\":\"xwburvjxxjns\",\"mountOption\":\"ATTACH\",\"path\":\"tko\"},\"elasticSanVolume\":{\"targetId\":\"kouknvudwtiu\"},\"status\":\"Detached\"},\"id\":\"ngkpocipazy\",\"name\":\"o\",\"type\":\"gukgjnpiucgygevq\"}") - .toObject(DatastoreInner.class); - Assertions.assertEquals("zy", model.netAppVolume().id()); - Assertions.assertEquals("hxmzsbbzoggig", model.diskPoolVolume().targetId()); - Assertions.assertEquals("xwburvjxxjns", model.diskPoolVolume().lunName()); - Assertions.assertEquals(MountOptionEnum.ATTACH, model.diskPoolVolume().mountOption()); - Assertions.assertEquals("kouknvudwtiu", model.elasticSanVolume().targetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatastoreInner model = new DatastoreInner().withNetAppVolume(new NetAppVolume().withId("zy")) - .withDiskPoolVolume(new DiskPoolVolume().withTargetId("hxmzsbbzoggig") - .withLunName("xwburvjxxjns") - .withMountOption(MountOptionEnum.ATTACH)) - .withElasticSanVolume(new ElasticSanVolume().withTargetId("kouknvudwtiu")); - model = BinaryData.fromObject(model).toObject(DatastoreInner.class); - Assertions.assertEquals("zy", model.netAppVolume().id()); - Assertions.assertEquals("hxmzsbbzoggig", model.diskPoolVolume().targetId()); - Assertions.assertEquals("xwburvjxxjns", model.diskPoolVolume().lunName()); - Assertions.assertEquals(MountOptionEnum.ATTACH, model.diskPoolVolume().mountOption()); - Assertions.assertEquals("kouknvudwtiu", model.elasticSanVolume().targetId()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoreListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoreListTests.java deleted file mode 100644 index f2543b42d3ce..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoreListTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; -import com.azure.resourcemanager.avs.models.DatastoreList; -import com.azure.resourcemanager.avs.models.DiskPoolVolume; -import com.azure.resourcemanager.avs.models.ElasticSanVolume; -import com.azure.resourcemanager.avs.models.MountOptionEnum; -import com.azure.resourcemanager.avs.models.NetAppVolume; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatastoreListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatastoreList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"netAppVolume\":{\"id\":\"ydagfuaxbe\"},\"diskPoolVolume\":{\"targetId\":\"iu\",\"lunName\":\"kktwhrdxw\",\"mountOption\":\"MOUNT\",\"path\":\"sm\"},\"elasticSanVolume\":{\"targetId\":\"ureximoryocfs\"},\"status\":\"Unknown\"},\"id\":\"mddystkiiux\",\"name\":\"qyud\",\"type\":\"o\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"netAppVolume\":{\"id\":\"poczvyifqrvkdvjs\"},\"diskPoolVolume\":{\"targetId\":\"rm\",\"lunName\":\"vdfwatkpn\",\"mountOption\":\"ATTACH\",\"path\":\"xxbczwtr\"},\"elasticSanVolume\":{\"targetId\":\"iqzbq\"},\"status\":\"Unknown\"},\"id\":\"vmyokacspkwl\",\"name\":\"zdobpxjmflbvvnch\",\"type\":\"kcciwwzjuqkhr\"},{\"properties\":{\"provisioningState\":\"Cancelled\",\"netAppVolume\":{\"id\":\"ku\"},\"diskPoolVolume\":{\"targetId\":\"oskg\",\"lunName\":\"sauuimj\",\"mountOption\":\"ATTACH\",\"path\":\"eduugi\"},\"elasticSanVolume\":{\"targetId\":\"jrrfbyaosve\"},\"status\":\"Attached\"},\"id\":\"npc\",\"name\":\"hocohslkev\",\"type\":\"eggzfb\"}],\"nextLink\":\"fmvfaxkffeiit\"}") - .toObject(DatastoreList.class); - Assertions.assertEquals("ydagfuaxbe", model.value().get(0).netAppVolume().id()); - Assertions.assertEquals("iu", model.value().get(0).diskPoolVolume().targetId()); - Assertions.assertEquals("kktwhrdxw", model.value().get(0).diskPoolVolume().lunName()); - Assertions.assertEquals(MountOptionEnum.MOUNT, model.value().get(0).diskPoolVolume().mountOption()); - Assertions.assertEquals("ureximoryocfs", model.value().get(0).elasticSanVolume().targetId()); - Assertions.assertEquals("fmvfaxkffeiit", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatastoreList model = new DatastoreList() - .withValue(Arrays.asList( - new DatastoreInner().withNetAppVolume(new NetAppVolume().withId("ydagfuaxbe")) - .withDiskPoolVolume(new DiskPoolVolume().withTargetId("iu") - .withLunName("kktwhrdxw") - .withMountOption(MountOptionEnum.MOUNT)) - .withElasticSanVolume(new ElasticSanVolume().withTargetId("ureximoryocfs")), - new DatastoreInner().withNetAppVolume(new NetAppVolume().withId("poczvyifqrvkdvjs")) - .withDiskPoolVolume(new DiskPoolVolume().withTargetId("rm") - .withLunName("vdfwatkpn") - .withMountOption(MountOptionEnum.ATTACH)) - .withElasticSanVolume(new ElasticSanVolume().withTargetId("iqzbq")), - new DatastoreInner().withNetAppVolume(new NetAppVolume().withId("ku")) - .withDiskPoolVolume(new DiskPoolVolume().withTargetId("oskg") - .withLunName("sauuimj") - .withMountOption(MountOptionEnum.ATTACH)) - .withElasticSanVolume(new ElasticSanVolume().withTargetId("jrrfbyaosve")))) - .withNextLink("fmvfaxkffeiit"); - model = BinaryData.fromObject(model).toObject(DatastoreList.class); - Assertions.assertEquals("ydagfuaxbe", model.value().get(0).netAppVolume().id()); - Assertions.assertEquals("iu", model.value().get(0).diskPoolVolume().targetId()); - Assertions.assertEquals("kktwhrdxw", model.value().get(0).diskPoolVolume().lunName()); - Assertions.assertEquals(MountOptionEnum.MOUNT, model.value().get(0).diskPoolVolume().mountOption()); - Assertions.assertEquals("ureximoryocfs", model.value().get(0).elasticSanVolume().targetId()); - Assertions.assertEquals("fmvfaxkffeiit", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastorePropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastorePropertiesTests.java deleted file mode 100644 index 1743e1c56518..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastorePropertiesTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.DatastoreProperties; -import com.azure.resourcemanager.avs.models.DiskPoolVolume; -import com.azure.resourcemanager.avs.models.ElasticSanVolume; -import com.azure.resourcemanager.avs.models.MountOptionEnum; -import com.azure.resourcemanager.avs.models.NetAppVolume; -import org.junit.jupiter.api.Assertions; - -public final class DatastorePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatastoreProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Deleting\",\"netAppVolume\":{\"id\":\"pmr\"},\"diskPoolVolume\":{\"targetId\":\"izcdrqjsd\",\"lunName\":\"ydnfyhxdeoejz\",\"mountOption\":\"MOUNT\",\"path\":\"fsj\"},\"elasticSanVolume\":{\"targetId\":\"gzfbishcbk\"},\"status\":\"DeadOrError\"}") - .toObject(DatastoreProperties.class); - Assertions.assertEquals("pmr", model.netAppVolume().id()); - Assertions.assertEquals("izcdrqjsd", model.diskPoolVolume().targetId()); - Assertions.assertEquals("ydnfyhxdeoejz", model.diskPoolVolume().lunName()); - Assertions.assertEquals(MountOptionEnum.MOUNT, model.diskPoolVolume().mountOption()); - Assertions.assertEquals("gzfbishcbk", model.elasticSanVolume().targetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatastoreProperties model = new DatastoreProperties().withNetAppVolume(new NetAppVolume().withId("pmr")) - .withDiskPoolVolume(new DiskPoolVolume().withTargetId("izcdrqjsd") - .withLunName("ydnfyhxdeoejz") - .withMountOption(MountOptionEnum.MOUNT)) - .withElasticSanVolume(new ElasticSanVolume().withTargetId("gzfbishcbk")); - model = BinaryData.fromObject(model).toObject(DatastoreProperties.class); - Assertions.assertEquals("pmr", model.netAppVolume().id()); - Assertions.assertEquals("izcdrqjsd", model.diskPoolVolume().targetId()); - Assertions.assertEquals("ydnfyhxdeoejz", model.diskPoolVolume().lunName()); - Assertions.assertEquals(MountOptionEnum.MOUNT, model.diskPoolVolume().mountOption()); - Assertions.assertEquals("gzfbishcbk", model.elasticSanVolume().targetId()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresCreateOrUpdateMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresCreateOrUpdateMockTests.java index d14b9db140f7..a3e6ad1c14fe 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresCreateOrUpdateMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresCreateOrUpdateMockTests.java @@ -1,20 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.Datastore; +import com.azure.resourcemanager.avs.models.DatastoreProperties; import com.azure.resourcemanager.avs.models.DiskPoolVolume; import com.azure.resourcemanager.avs.models.ElasticSanVolume; import com.azure.resourcemanager.avs.models.MountOptionEnum; import com.azure.resourcemanager.avs.models.NetAppVolume; +import com.azure.resourcemanager.avs.models.PureStorageVolume; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -25,28 +27,32 @@ public final class DatastoresCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"anokqgu\"},\"diskPoolVolume\":{\"targetId\":\"jqnv\",\"lunName\":\"roylaxxu\",\"mountOption\":\"ATTACH\",\"path\":\"sdosfjbjsvgjr\"},\"elasticSanVolume\":{\"targetId\":\"r\"},\"status\":\"Inaccessible\"},\"id\":\"ytdc\",\"name\":\"xgccknfnw\",\"type\":\"btmvpdvjdhttza\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"yomkxfbvfbhdy\"},\"diskPoolVolume\":{\"targetId\":\"hpwpgddeimawzovg\",\"lunName\":\"kumuikjcjca\",\"mountOption\":\"MOUNT\",\"path\":\"snsqowxwcoml\"},\"elasticSanVolume\":{\"targetId\":\"ytwvczcswkacve\"},\"pureStorageVolume\":{\"storagePoolId\":\"fdv\",\"sizeGb\":664192070},\"status\":\"Accessible\"},\"id\":\"rnfxtgddp\",\"name\":\"th\",\"type\":\"hn\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Datastore response = manager.datastores() - .define("pypqtgsfj") - .withExistingCluster("itvtzeexavo", "tfgle", "dmdqb") - .withNetAppVolume(new NetAppVolume().withId("hhxud")) - .withDiskPoolVolume( - new DiskPoolVolume().withTargetId("vodhtn").withLunName("irudh").withMountOption(MountOptionEnum.MOUNT)) - .withElasticSanVolume(new ElasticSanVolume().withTargetId("zrcxfailcfxwmdbo")) + .define("wwsko") + .withExistingCluster("rlpshhkv", "edwqslsrh", "pq") + .withProperties(new DatastoreProperties().withNetAppVolume(new NetAppVolume().withId("wimuvqej")) + .withDiskPoolVolume(new DiskPoolVolume().withTargetId("ovyrrleaesinu") + .withLunName("tljqobbpih") + .withMountOption(MountOptionEnum.ATTACH)) + .withElasticSanVolume(new ElasticSanVolume().withTargetId("rqbrjbbmpxdlvyk")) + .withPureStorageVolume(new PureStorageVolume().withStoragePoolId("e").withSizeGb(824374091))) .create(); - Assertions.assertEquals("anokqgu", response.netAppVolume().id()); - Assertions.assertEquals("jqnv", response.diskPoolVolume().targetId()); - Assertions.assertEquals("roylaxxu", response.diskPoolVolume().lunName()); - Assertions.assertEquals(MountOptionEnum.ATTACH, response.diskPoolVolume().mountOption()); - Assertions.assertEquals("r", response.elasticSanVolume().targetId()); + Assertions.assertEquals("yomkxfbvfbhdy", response.properties().netAppVolume().id()); + Assertions.assertEquals("hpwpgddeimawzovg", response.properties().diskPoolVolume().targetId()); + Assertions.assertEquals("kumuikjcjca", response.properties().diskPoolVolume().lunName()); + Assertions.assertEquals(MountOptionEnum.MOUNT, response.properties().diskPoolVolume().mountOption()); + Assertions.assertEquals("ytwvczcswkacve", response.properties().elasticSanVolume().targetId()); + Assertions.assertEquals("fdv", response.properties().pureStorageVolume().storagePoolId()); + Assertions.assertEquals(664192070, response.properties().pureStorageVolume().sizeGb()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresDeleteMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresDeleteMockTests.java index 5470846191a2..6dcf7ed3d7f5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresDeleteMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDelete() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.datastores().delete("cuijpxt", "s", "wprtu", "wsawddjibabxvi", com.azure.core.util.Context.NONE); + manager.datastores() + .delete("digsxcdgl", "plkeuachtomflryt", "wfpfmdgycx", "mskwhqjjysl", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresGetWithResponseMockTests.java index d4dc50a3e60b..0aa33a0b9a76 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresGetWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.Datastore; @@ -22,23 +22,25 @@ public final class DatastoresGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Failed\",\"netAppVolume\":{\"id\":\"lxunsmjbnkppxy\"},\"diskPoolVolume\":{\"targetId\":\"nlsvxeiz\",\"lunName\":\"gwklnsr\",\"mountOption\":\"ATTACH\",\"path\":\"ycxcktpiym\"},\"elasticSanVolume\":{\"targetId\":\"teeammxqiekkkzd\"},\"status\":\"Detached\"},\"id\":\"g\",\"name\":\"ojbmxv\",\"type\":\"vrefdeesv\"}"; + = "{\"properties\":{\"provisioningState\":\"Failed\",\"netAppVolume\":{\"id\":\"v\"},\"diskPoolVolume\":{\"targetId\":\"laiwdcxsmlzzh\",\"lunName\":\"dtxetlgydlh\",\"mountOption\":\"MOUNT\",\"path\":\"npxybafiq\"},\"elasticSanVolume\":{\"targetId\":\"aarbgjekg\"},\"pureStorageVolume\":{\"storagePoolId\":\"lbyulidwcwvmze\",\"sizeGb\":2074330013},\"status\":\"Accessible\"},\"id\":\"hj\",\"name\":\"rwgdnqzbrfks\",\"type\":\"zhzmtksjci\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Datastore response = manager.datastores() - .getWithResponse("tjeaahhvjhh", "akz", "bbjjidjksyxk", "xvxevblbjednljla", com.azure.core.util.Context.NONE) + .getWithResponse("ejchcsrlz", "nmzlanru", "dwv", "phcnzqtpj", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("lxunsmjbnkppxy", response.netAppVolume().id()); - Assertions.assertEquals("nlsvxeiz", response.diskPoolVolume().targetId()); - Assertions.assertEquals("gwklnsr", response.diskPoolVolume().lunName()); - Assertions.assertEquals(MountOptionEnum.ATTACH, response.diskPoolVolume().mountOption()); - Assertions.assertEquals("teeammxqiekkkzd", response.elasticSanVolume().targetId()); + Assertions.assertEquals("v", response.properties().netAppVolume().id()); + Assertions.assertEquals("laiwdcxsmlzzh", response.properties().diskPoolVolume().targetId()); + Assertions.assertEquals("dtxetlgydlh", response.properties().diskPoolVolume().lunName()); + Assertions.assertEquals(MountOptionEnum.MOUNT, response.properties().diskPoolVolume().mountOption()); + Assertions.assertEquals("aarbgjekg", response.properties().elasticSanVolume().targetId()); + Assertions.assertEquals("lbyulidwcwvmze", response.properties().pureStorageVolume().storagePoolId()); + Assertions.assertEquals(2074330013, response.properties().pureStorageVolume().sizeGb()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresListMockTests.java index 75858a2a1f23..3bb485eab2a7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresListMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DatastoresListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.Datastore; @@ -23,22 +23,25 @@ public final class DatastoresListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"netAppVolume\":{\"id\":\"uwasqvd\"},\"diskPoolVolume\":{\"targetId\":\"y\",\"lunName\":\"guxak\",\"mountOption\":\"ATTACH\",\"path\":\"hzbezkgi\"},\"elasticSanVolume\":{\"targetId\":\"idxas\"},\"status\":\"DeadOrError\"},\"id\":\"yvvjskgfmo\",\"name\":\"wa\",\"type\":\"pqg\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"netAppVolume\":{\"id\":\"zz\"},\"diskPoolVolume\":{\"targetId\":\"jafi\",\"lunName\":\"lhguyn\",\"mountOption\":\"ATTACH\",\"path\":\"gmltxdw\"},\"elasticSanVolume\":{\"targetId\":\"ozusgz\"},\"pureStorageVolume\":{\"storagePoolId\":\"ns\",\"sizeGb\":411484451},\"status\":\"DeadOrError\"},\"id\":\"pafolp\",\"name\":\"mwamxqzragpgdph\",\"type\":\"vdulajv\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.datastores().list("fegcea", "zxwhcansymoyqhlw", "gdivbkbxg", com.azure.core.util.Context.NONE); + = manager.datastores().list("vhqjwtrhtgvg", "pcrrk", "lawjmjsmwrok", com.azure.core.util.Context.NONE); - Assertions.assertEquals("uwasqvd", response.iterator().next().netAppVolume().id()); - Assertions.assertEquals("y", response.iterator().next().diskPoolVolume().targetId()); - Assertions.assertEquals("guxak", response.iterator().next().diskPoolVolume().lunName()); - Assertions.assertEquals(MountOptionEnum.ATTACH, response.iterator().next().diskPoolVolume().mountOption()); - Assertions.assertEquals("idxas", response.iterator().next().elasticSanVolume().targetId()); + Assertions.assertEquals("zz", response.iterator().next().properties().netAppVolume().id()); + Assertions.assertEquals("jafi", response.iterator().next().properties().diskPoolVolume().targetId()); + Assertions.assertEquals("lhguyn", response.iterator().next().properties().diskPoolVolume().lunName()); + Assertions.assertEquals(MountOptionEnum.ATTACH, + response.iterator().next().properties().diskPoolVolume().mountOption()); + Assertions.assertEquals("ozusgz", response.iterator().next().properties().elasticSanVolume().targetId()); + Assertions.assertEquals("ns", response.iterator().next().properties().pureStorageVolume().storagePoolId()); + Assertions.assertEquals(411484451, response.iterator().next().properties().pureStorageVolume().sizeGb()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DiskPoolVolumeTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DiskPoolVolumeTests.java deleted file mode 100644 index 5b8741a71e30..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/DiskPoolVolumeTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.DiskPoolVolume; -import com.azure.resourcemanager.avs.models.MountOptionEnum; -import org.junit.jupiter.api.Assertions; - -public final class DiskPoolVolumeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiskPoolVolume model = BinaryData.fromString( - "{\"targetId\":\"wgipwhono\",\"lunName\":\"kgshwa\",\"mountOption\":\"ATTACH\",\"path\":\"zbinjeputtm\"}") - .toObject(DiskPoolVolume.class); - Assertions.assertEquals("wgipwhono", model.targetId()); - Assertions.assertEquals("kgshwa", model.lunName()); - Assertions.assertEquals(MountOptionEnum.ATTACH, model.mountOption()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiskPoolVolume model = new DiskPoolVolume().withTargetId("wgipwhono") - .withLunName("kgshwa") - .withMountOption(MountOptionEnum.ATTACH); - model = BinaryData.fromObject(model).toObject(DiskPoolVolume.class); - Assertions.assertEquals("wgipwhono", model.targetId()); - Assertions.assertEquals("kgshwa", model.lunName()); - Assertions.assertEquals(MountOptionEnum.ATTACH, model.mountOption()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ElasticSanVolumeTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ElasticSanVolumeTests.java deleted file mode 100644 index f0706a4ef6ed..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ElasticSanVolumeTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.ElasticSanVolume; -import org.junit.jupiter.api.Assertions; - -public final class ElasticSanVolumeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ElasticSanVolume model = BinaryData.fromString("{\"targetId\":\"ywnuzoq\"}").toObject(ElasticSanVolume.class); - Assertions.assertEquals("ywnuzoq", model.targetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ElasticSanVolume model = new ElasticSanVolume().withTargetId("ywnuzoq"); - model = BinaryData.fromObject(model).toObject(ElasticSanVolume.class); - Assertions.assertEquals("ywnuzoq", model.targetId()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/EndpointsTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/EndpointsTests.java deleted file mode 100644 index 59a651cd08a5..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/EndpointsTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.Endpoints; - -public final class EndpointsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Endpoints model = BinaryData.fromString( - "{\"nsxtManager\":\"tmut\",\"vcsa\":\"qktapspwgcuert\",\"hcxCloudManager\":\"kdosvqw\",\"nsxtManagerIp\":\"mdgbbjfdd\",\"vcenterIp\":\"bmbexppbhtqqro\",\"hcxCloudManagerIp\":\"p\"}") - .toObject(Endpoints.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Endpoints model = new Endpoints(); - model = BinaryData.fromObject(model).toObject(Endpoints.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsDeleteMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsDeleteMockTests.java index 51e04a2a4f26..155223c9bf95 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsDeleteMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/GlobalReachConnectionsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDelete() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.globalReachConnections().delete("lniexz", "rzpgep", "tybbwwpgda", com.azure.core.util.Context.NONE); + manager.globalReachConnections() + .delete("ey", "swlpaugmrmfj", "rxwtoaukhfkvc", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesDeleteWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesDeleteWithResponseMockTests.java index 71dccc3283eb..49818fa6a46f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesDeleteWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/HcxEnterpriseSitesDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.hcxEnterpriseSites() - .deleteWithResponse("raiouaubrjtl", "qxfuojrngif", "rzpasccbiuimzdly", com.azure.core.util.Context.NONE); + .deleteWithResponse("blycsxzujksr", "smdesqplpvmjcd", "ewbidyvteowxv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/HostsGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/HostsGetWithResponseMockTests.java new file mode 100644 index 000000000000..8e63e91ca80f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/HostsGetWithResponseMockTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.avs.AvsManager; +import com.azure.resourcemanager.avs.models.HostMaintenance; +import com.azure.resourcemanager.avs.models.HostModel; +import com.azure.resourcemanager.avs.models.SkuTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HostsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"kind\":\"HostProperties\",\"provisioningState\":\"Failed\",\"displayName\":\"gmxitpfi\",\"moRefId\":\"cpdltkrlg\",\"fqdn\":\"tbdrvcqgue\",\"maintenance\":\"Upgrade\",\"faultDomain\":\"mpheqdur\"},\"zones\":[\"ujlfyoumpcky\",\"clcdigptajbrzmq\",\"ucycijo\",\"lxiutgjcyzyzjdnr\"],\"sku\":{\"name\":\"btxjeaoqaqbzg\",\"tier\":\"Premium\",\"size\":\"wvua\",\"family\":\"wbqamteuliy\",\"capacity\":1691933746},\"id\":\"cvmwfauxxepmy\",\"name\":\"bormcqmiciijqpkz\",\"type\":\"bojxjmcsmy\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + AvsManager manager = AvsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HostModel response = manager.hosts() + .getWithResponse("ead", "rzmwn", "opagttmvmmag", "aqylkjztji", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("gmxitpfi", response.properties().displayName()); + Assertions.assertEquals(HostMaintenance.UPGRADE, response.properties().maintenance()); + Assertions.assertEquals("ujlfyoumpcky", response.zones().get(0)); + Assertions.assertEquals("btxjeaoqaqbzg", response.sku().name()); + Assertions.assertEquals(SkuTier.PREMIUM, response.sku().tier()); + Assertions.assertEquals("wvua", response.sku().size()); + Assertions.assertEquals("wbqamteuliy", response.sku().family()); + Assertions.assertEquals(1691933746, response.sku().capacity()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/HostsListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/HostsListMockTests.java new file mode 100644 index 000000000000..7e885d9d2560 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/HostsListMockTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.avs.AvsManager; +import com.azure.resourcemanager.avs.models.HostMaintenance; +import com.azure.resourcemanager.avs.models.HostModel; +import com.azure.resourcemanager.avs.models.SkuTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HostsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"kind\":\"HostProperties\",\"provisioningState\":\"Succeeded\",\"displayName\":\"zmnhiilialwc\",\"moRefId\":\"ckbbcc\",\"fqdn\":\"zpraoxn\",\"maintenance\":\"Upgrade\",\"faultDomain\":\"a\"},\"zones\":[\"ftipwcxbyubhiq\",\"xyur\"],\"sku\":{\"name\":\"nuhzafccnuh\",\"tier\":\"Basic\",\"size\":\"yl\",\"family\":\"igvxvatvcrk\",\"capacity\":206743911},\"id\":\"bqxvhcsyhzlwxae\",\"name\":\"ov\",\"type\":\"rexdndsbd\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + AvsManager manager = AvsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.hosts().list("iuxegth", "rtudawlpjfel", "erppt", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("zmnhiilialwc", response.iterator().next().properties().displayName()); + Assertions.assertEquals(HostMaintenance.UPGRADE, response.iterator().next().properties().maintenance()); + Assertions.assertEquals("ftipwcxbyubhiq", response.iterator().next().zones().get(0)); + Assertions.assertEquals("nuhzafccnuh", response.iterator().next().sku().name()); + Assertions.assertEquals(SkuTier.BASIC, response.iterator().next().sku().tier()); + Assertions.assertEquals("yl", response.iterator().next().sku().size()); + Assertions.assertEquals("igvxvatvcrk", response.iterator().next().sku().family()); + Assertions.assertEquals(206743911, response.iterator().next().sku().capacity()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathInnerTests.java deleted file mode 100644 index 392d214a0eb3..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.IscsiPathInner; -import org.junit.jupiter.api.Assertions; - -public final class IscsiPathInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IscsiPathInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Failed\",\"networkBlock\":\"mx\"},\"id\":\"kv\",\"name\":\"melmqkrha\",\"type\":\"vljua\"}") - .toObject(IscsiPathInner.class); - Assertions.assertEquals("mx", model.networkBlock()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IscsiPathInner model = new IscsiPathInner().withNetworkBlock("mx"); - model = BinaryData.fromObject(model).toObject(IscsiPathInner.class); - Assertions.assertEquals("mx", model.networkBlock()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathListResultTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathListResultTests.java deleted file mode 100644 index 834ab8c31e80..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathListResultTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.IscsiPathInner; -import com.azure.resourcemanager.avs.models.IscsiPathListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IscsiPathListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IscsiPathListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"networkBlock\":\"z\"},\"id\":\"zka\",\"name\":\"kuwbcrnwb\",\"type\":\"ehhseyvjusrts\"}],\"nextLink\":\"spkdee\"}") - .toObject(IscsiPathListResult.class); - Assertions.assertEquals("z", model.value().get(0).networkBlock()); - Assertions.assertEquals("spkdee", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IscsiPathListResult model - = new IscsiPathListResult().withValue(Arrays.asList(new IscsiPathInner().withNetworkBlock("z"))) - .withNextLink("spkdee"); - model = BinaryData.fromObject(model).toObject(IscsiPathListResult.class); - Assertions.assertEquals("z", model.value().get(0).networkBlock()); - Assertions.assertEquals("spkdee", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathPropertiesTests.java deleted file mode 100644 index 0cc6888a30d7..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.IscsiPathProperties; -import org.junit.jupiter.api.Assertions; - -public final class IscsiPathPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IscsiPathProperties model - = BinaryData.fromString("{\"provisioningState\":\"Canceled\",\"networkBlock\":\"uhcdhm\"}") - .toObject(IscsiPathProperties.class); - Assertions.assertEquals("uhcdhm", model.networkBlock()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IscsiPathProperties model = new IscsiPathProperties().withNetworkBlock("uhcdhm"); - model = BinaryData.fromObject(model).toObject(IscsiPathProperties.class); - Assertions.assertEquals("uhcdhm", model.networkBlock()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsCreateOrUpdateMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsCreateOrUpdateMockTests.java index 5d1d51190756..e0e79de1bb23 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsCreateOrUpdateMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsCreateOrUpdateMockTests.java @@ -1,17 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; -import com.azure.resourcemanager.avs.fluent.models.IscsiPathInner; import com.azure.resourcemanager.avs.models.IscsiPath; +import com.azure.resourcemanager.avs.models.IscsiPathProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -22,19 +22,21 @@ public final class IscsiPathsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"networkBlock\":\"vlgo\"},\"id\":\"mftpmdtz\",\"name\":\"jltfvnzcyjtotpv\",\"type\":\"pvpbdbzqgqqiheds\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"networkBlock\":\"zakuejk\"},\"id\":\"bizt\",\"name\":\"ofqcvovjufycsjm\",\"type\":\"bemyeji\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); IscsiPath response = manager.iscsiPaths() - .createOrUpdate("prlpy", "nuciqdsmexiit", new IscsiPathInner().withNetworkBlock("tyasiibmiybnnust"), - com.azure.core.util.Context.NONE); + .define("wugyx") + .withExistingPrivateCloud("oitpkpztrgdgx", "coqra") + .withProperties(new IscsiPathProperties().withNetworkBlock("we")) + .create(); - Assertions.assertEquals("vlgo", response.networkBlock()); + Assertions.assertEquals("zakuejk", response.properties().networkBlock()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsDeleteMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsDeleteMockTests.java index 95ea5d512479..0e58c3e22d76 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsDeleteMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.iscsiPaths().delete("qwthmky", "bcysih", com.azure.core.util.Context.NONE); + manager.iscsiPaths().delete("ujcngo", "dyedmzrgjfo", "nub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsGetWithResponseMockTests.java index 44fb27305c5e..9a84eba8da41 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsGetWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.IscsiPath; @@ -21,18 +21,19 @@ public final class IscsiPathsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Deleting\",\"networkBlock\":\"cevehjkuyxoafg\"},\"id\":\"qltfaey\",\"name\":\"inmfgvxirp\",\"type\":\"hriypoqeyhlqhy\"}"; + = "{\"properties\":{\"provisioningState\":\"Building\",\"networkBlock\":\"bczsulmdgglmepjp\"},\"id\":\"eykgsangpszngaf\",\"name\":\"g\",\"type\":\"lkvec\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - IscsiPath response - = manager.iscsiPaths().getWithResponse("z", "qqxlajr", com.azure.core.util.Context.NONE).getValue(); + IscsiPath response = manager.iscsiPaths() + .getWithResponse("cvexreuqu", "wtl", "vfwhreagkhyxv", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("cevehjkuyxoafg", response.networkBlock()); + Assertions.assertEquals("bczsulmdgglmepjp", response.properties().networkBlock()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsListByPrivateCloudMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsListByPrivateCloudMockTests.java index 7bd2ad412d84..79a89b3244d7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsListByPrivateCloudMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/IscsiPathsListByPrivateCloudMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.IscsiPath; @@ -22,18 +22,18 @@ public final class IscsiPathsListByPrivateCloudMockTests { @Test public void testListByPrivateCloud() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"networkBlock\":\"vyhyhsgzfc\"},\"id\":\"gomfgbeglq\",\"name\":\"leohibetnluankr\",\"type\":\"fxeeebtijvacvbm\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"networkBlock\":\"ly\"},\"id\":\"luqw\",\"name\":\"ulsutrjbhxy\",\"type\":\"fhyqezvqqugdrft\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.iscsiPaths() - .listByPrivateCloud("fdgugeyzi", "grkyuizabsnmfpph", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.iscsiPaths().listByPrivateCloud("nmgzvyfijdkzuqnw", "it", com.azure.core.util.Context.NONE); - Assertions.assertEquals("vyhyhsgzfc", response.iterator().next().networkBlock()); + Assertions.assertEquals("ly", response.iterator().next().properties().networkBlock()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/LocationsCheckQuotaAvailabilityWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/LocationsCheckQuotaAvailabilityWithResponseMockTests.java index bc86e4ea2674..d61842c10422 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/LocationsCheckQuotaAvailabilityWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/LocationsCheckQuotaAvailabilityWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.Quota; @@ -20,17 +20,17 @@ public final class LocationsCheckQuotaAvailabilityWithResponseMockTests { @Test public void testCheckQuotaAvailabilityWithResponse() throws Exception { String responseStr - = "{\"hostsRemaining\":{\"uzaofjchvcyyy\":1357028156,\"gdotcubiipuipwo\":915050797,\"nmacj\":567350116,\"nizshqvcim\":167629289},\"quotaEnabled\":\"Disabled\"}"; + = "{\"hostsRemaining\":{\"ntkwcegy\":1729459550,\"lbnseqac\":1790694932,\"vpilg\":967864658},\"quotaEnabled\":\"Enabled\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Quota response = manager.locations() - .checkQuotaAvailabilityWithResponse("dufiq", com.azure.core.util.Context.NONE) + .checkQuotaAvailabilityWithResponse("yjleziunjx", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/LocationsCheckTrialAvailabilityWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/LocationsCheckTrialAvailabilityWithResponseMockTests.java index 5a828bf26aee..4ec34580d815 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/LocationsCheckTrialAvailabilityWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/LocationsCheckTrialAvailabilityWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.Sku; @@ -21,22 +21,22 @@ public final class LocationsCheckTrialAvailabilityWithResponseMockTests { @Test public void testCheckTrialAvailabilityWithResponse() throws Exception { - String responseStr = "{\"status\":\"TrialDisabled\",\"availableHosts\":1759389481}"; + String responseStr = "{\"status\":\"TrialDisabled\",\"availableHosts\":471711560}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Trial response = manager.locations() - .checkTrialAvailabilityWithResponse("fgmblrrilbywdxsm", - new Sku().withName("ccwr") - .withTier(SkuTier.BASIC) - .withSize("jfnynszqujizdvoq") - .withFamily("ibyowbblgyavutp") - .withCapacity(1643251858), + .checkTrialAvailabilityWithResponse("gdlfgt", + new Sku().withName("y") + .withTier(SkuTier.STANDARD) + .withSize("uflqbctq") + .withFamily("mzjr") + .withCapacity(1644832574), com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ManagementClusterTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ManagementClusterTests.java deleted file mode 100644 index 45d1edb05341..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ManagementClusterTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.ManagementCluster; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ManagementClusterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagementCluster model = BinaryData.fromString( - "{\"clusterSize\":223251370,\"provisioningState\":\"Succeeded\",\"clusterId\":1278778169,\"hosts\":[\"feusnhut\",\"eltmrldhugjzzdat\"],\"vsanDatastoreName\":\"hocdgeab\"}") - .toObject(ManagementCluster.class); - Assertions.assertEquals(223251370, model.clusterSize()); - Assertions.assertEquals("feusnhut", model.hosts().get(0)); - Assertions.assertEquals("hocdgeab", model.vsanDatastoreName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagementCluster model = new ManagementCluster().withClusterSize(223251370) - .withHosts(Arrays.asList("feusnhut", "eltmrldhugjzzdat")) - .withVsanDatastoreName("hocdgeab"); - model = BinaryData.fromObject(model).toObject(ManagementCluster.class); - Assertions.assertEquals(223251370, model.clusterSize()); - Assertions.assertEquals("feusnhut", model.hosts().get(0)); - Assertions.assertEquals("hocdgeab", model.vsanDatastoreName()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/NetAppVolumeTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/NetAppVolumeTests.java deleted file mode 100644 index 415cb3d09c42..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/NetAppVolumeTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.NetAppVolume; -import org.junit.jupiter.api.Assertions; - -public final class NetAppVolumeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetAppVolume model = BinaryData.fromString("{\"id\":\"deyeamdphagalpbu\"}").toObject(NetAppVolume.class); - Assertions.assertEquals("deyeamdphagalpbu", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetAppVolume model = new NetAppVolume().withId("deyeamdphagalpbu"); - model = BinaryData.fromObject(model).toObject(NetAppVolume.class); - Assertions.assertEquals("deyeamdphagalpbu", model.id()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationDisplayTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationDisplayTests.java deleted file mode 100644 index 0d0402ab63ec..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationInnerTests.java deleted file mode 100644 index 3d33485b4cbd..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.OperationInner; -import com.azure.resourcemanager.avs.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationListResultTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationListResultTests.java deleted file mode 100644 index 5d49245bc54b..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationsListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationsListMockTests.java index 8eeb878d109a..b4206fe3c0e5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationsListMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/OperationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.Operation; @@ -21,14 +21,14 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"unvmnnr\",\"isDataAction\":false,\"display\":{\"provider\":\"rk\",\"resource\":\"lywjhh\",\"operation\":\"nhxmsi\",\"description\":\"omi\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"uhxu\",\"isDataAction\":false,\"display\":{\"provider\":\"wmrswnjlxuzrh\",\"resource\":\"usxjbaqehg\",\"operation\":\"ohzjqatucoigeb\",\"description\":\"cnwfepbnwgfmxjg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesCreateOrUpdateMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesCreateOrUpdateMockTests.java index ede0dafbb856..d301564047b4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesCreateOrUpdateMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.PlacementPolicy; @@ -23,23 +23,23 @@ public final class PlacementPoliciesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"type\":\"PlacementPolicyProperties\",\"state\":\"Enabled\",\"displayName\":\"kpn\",\"provisioningState\":\"Succeeded\"},\"id\":\"pmudqmeqwig\",\"name\":\"ibudqwy\",\"type\":\"eb\"}"; + = "{\"properties\":{\"type\":\"PlacementPolicyProperties\",\"state\":\"Disabled\",\"displayName\":\"uhpsprkzyaupia\",\"provisioningState\":\"Succeeded\"},\"id\":\"afbwqroohtuovmao\",\"name\":\"urjtumghi\",\"type\":\"pv\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PlacementPolicy response = manager.placementPolicies() - .define("emwmdxmebwjs") - .withExistingCluster("cjmeislstvasy", "wxdzaumweoohgu", "fuzboyjathwtzolb") - .withProperties( - new PlacementPolicyProperties().withState(PlacementPolicyState.DISABLED).withDisplayName("lxveabfqx")) + .define("jjjavfqnvhnq") + .withExistingCluster("cvogygzyvne", "zaifghtmoqqtlff", "zbkr") + .withProperties(new PlacementPolicyProperties().withState(PlacementPolicyState.DISABLED) + .withDisplayName("giyetesypvidbz")) .create(); - Assertions.assertEquals(PlacementPolicyState.ENABLED, response.properties().state()); - Assertions.assertEquals("kpn", response.properties().displayName()); + Assertions.assertEquals(PlacementPolicyState.DISABLED, response.properties().state()); + Assertions.assertEquals("uhpsprkzyaupia", response.properties().displayName()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesDeleteMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesDeleteMockTests.java index 7bad5f2a4a32..2d4adf510c1a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesDeleteMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDelete() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.placementPolicies() - .delete("a", "ankjpdnjzh", "joylh", "lmuoyxprimrsopte", com.azure.core.util.Context.NONE); + .delete("hiqfyuttdiy", "b", "vnwsw", "txkyctwwgzwxjlm", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesGetWithResponseMockTests.java index 8fb3e60ee2f1..46fe2fae5d09 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesGetWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.PlacementPolicy; @@ -22,20 +22,20 @@ public final class PlacementPoliciesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"type\":\"PlacementPolicyProperties\",\"state\":\"Enabled\",\"displayName\":\"q\",\"provisioningState\":\"Building\"},\"id\":\"wsldrizetpwbr\",\"name\":\"lllibph\",\"type\":\"qzmiza\"}"; + = "{\"properties\":{\"type\":\"PlacementPolicyProperties\",\"state\":\"Disabled\",\"displayName\":\"nbnxwcdomm\",\"provisioningState\":\"Failed\"},\"id\":\"awz\",\"name\":\"gbrt\",\"type\":\"uiaclkiexhajlfn\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PlacementPolicy response = manager.placementPolicies() - .getWithResponse("eafidltugsresm", "ssjhoiftxfkf", "egprhptil", "ucb", com.azure.core.util.Context.NONE) + .getWithResponse("wvqsgny", "uuzivensrpmeyyvp", "patlbijp", "gsksrfhf", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(PlacementPolicyState.ENABLED, response.properties().state()); - Assertions.assertEquals("q", response.properties().displayName()); + Assertions.assertEquals(PlacementPolicyState.DISABLED, response.properties().state()); + Assertions.assertEquals("nbnxwcdomm", response.properties().displayName()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesListMockTests.java index 6e0f17dcd444..c21cf059db96 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesListMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.PlacementPolicy; @@ -23,19 +23,19 @@ public final class PlacementPoliciesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"type\":\"PlacementPolicyProperties\",\"state\":\"Disabled\",\"displayName\":\"lwxezwzhokvbwnh\",\"provisioningState\":\"Failed\"},\"id\":\"gehgppi\",\"name\":\"ifhpf\",\"type\":\"oajvgcxtxjcs\"}]}"; + = "{\"value\":[{\"properties\":{\"type\":\"PlacementPolicyProperties\",\"state\":\"Disabled\",\"displayName\":\"vvf\",\"provisioningState\":\"Deleting\"},\"id\":\"lghktuidvrm\",\"name\":\"zlpdwwex\",\"type\":\"mzvlazipbh\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.placementPolicies() - .list("fedxihchrphkm", "rjdqnsdfzp", "gtgkylkdghr", com.azure.core.util.Context.NONE); + .list("rduczkgofxyfs", "uc", "crrpcjttbstvje", com.azure.core.util.Context.NONE); Assertions.assertEquals(PlacementPolicyState.DISABLED, response.iterator().next().properties().state()); - Assertions.assertEquals("lwxezwzhokvbwnh", response.iterator().next().properties().displayName()); + Assertions.assertEquals("vvf", response.iterator().next().properties().displayName()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesListTests.java deleted file mode 100644 index c28c45fd5302..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPoliciesListTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.PlacementPolicyInner; -import com.azure.resourcemanager.avs.models.PlacementPoliciesList; -import com.azure.resourcemanager.avs.models.PlacementPolicyProperties; -import com.azure.resourcemanager.avs.models.PlacementPolicyState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PlacementPoliciesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlacementPoliciesList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"type\":\"PlacementPolicyProperties\",\"state\":\"Disabled\",\"displayName\":\"ebrjcxe\",\"provisioningState\":\"Failed\"},\"id\":\"utttxfvjrbirp\",\"name\":\"xepcyvahfn\",\"type\":\"jky\"},{\"properties\":{\"type\":\"PlacementPolicyProperties\",\"state\":\"Enabled\",\"displayName\":\"ujqgidok\",\"provisioningState\":\"Failed\"},\"id\":\"yoxgvcltbgsnc\",\"name\":\"hkjeszzhbi\",\"type\":\"htxfvgxbfsmxnehm\"}],\"nextLink\":\"ec\"}") - .toObject(PlacementPoliciesList.class); - Assertions.assertEquals(PlacementPolicyState.DISABLED, model.value().get(0).properties().state()); - Assertions.assertEquals("ebrjcxe", model.value().get(0).properties().displayName()); - Assertions.assertEquals("ec", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PlacementPoliciesList model = new PlacementPoliciesList().withValue(Arrays.asList( - new PlacementPolicyInner().withProperties( - new PlacementPolicyProperties().withState(PlacementPolicyState.DISABLED).withDisplayName("ebrjcxe")), - new PlacementPolicyInner().withProperties( - new PlacementPolicyProperties().withState(PlacementPolicyState.ENABLED).withDisplayName("ujqgidok")))) - .withNextLink("ec"); - model = BinaryData.fromObject(model).toObject(PlacementPoliciesList.class); - Assertions.assertEquals(PlacementPolicyState.DISABLED, model.value().get(0).properties().state()); - Assertions.assertEquals("ebrjcxe", model.value().get(0).properties().displayName()); - Assertions.assertEquals("ec", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyInnerTests.java deleted file mode 100644 index 2bec107de976..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyInnerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.PlacementPolicyInner; -import com.azure.resourcemanager.avs.models.PlacementPolicyProperties; -import com.azure.resourcemanager.avs.models.PlacementPolicyState; -import org.junit.jupiter.api.Assertions; - -public final class PlacementPolicyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlacementPolicyInner model = BinaryData.fromString( - "{\"properties\":{\"type\":\"PlacementPolicyProperties\",\"state\":\"Disabled\",\"displayName\":\"bfqkkr\",\"provisioningState\":\"Succeeded\"},\"id\":\"kgriwflzlfbx\",\"name\":\"puz\",\"type\":\"cispnqzahmgkbr\"}") - .toObject(PlacementPolicyInner.class); - Assertions.assertEquals(PlacementPolicyState.DISABLED, model.properties().state()); - Assertions.assertEquals("bfqkkr", model.properties().displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PlacementPolicyInner model = new PlacementPolicyInner().withProperties( - new PlacementPolicyProperties().withState(PlacementPolicyState.DISABLED).withDisplayName("bfqkkr")); - model = BinaryData.fromObject(model).toObject(PlacementPolicyInner.class); - Assertions.assertEquals(PlacementPolicyState.DISABLED, model.properties().state()); - Assertions.assertEquals("bfqkkr", model.properties().displayName()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyPropertiesTests.java deleted file mode 100644 index c90311ecb18f..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.PlacementPolicyProperties; -import com.azure.resourcemanager.avs.models.PlacementPolicyState; -import org.junit.jupiter.api.Assertions; - -public final class PlacementPolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlacementPolicyProperties model = BinaryData.fromString( - "{\"type\":\"PlacementPolicyProperties\",\"state\":\"Enabled\",\"displayName\":\"hibnuqqkpika\",\"provisioningState\":\"Updating\"}") - .toObject(PlacementPolicyProperties.class); - Assertions.assertEquals(PlacementPolicyState.ENABLED, model.state()); - Assertions.assertEquals("hibnuqqkpika", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PlacementPolicyProperties model - = new PlacementPolicyProperties().withState(PlacementPolicyState.ENABLED).withDisplayName("hibnuqqkpika"); - model = BinaryData.fromObject(model).toObject(PlacementPolicyProperties.class); - Assertions.assertEquals(PlacementPolicyState.ENABLED, model.state()); - Assertions.assertEquals("hibnuqqkpika", model.displayName()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyUpdatePropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyUpdatePropertiesTests.java deleted file mode 100644 index 6ea4e32a75c0..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyUpdatePropertiesTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.PlacementPolicyUpdateProperties; -import com.azure.resourcemanager.avs.models.AffinityStrength; -import com.azure.resourcemanager.avs.models.AzureHybridBenefitType; -import com.azure.resourcemanager.avs.models.PlacementPolicyState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PlacementPolicyUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlacementPolicyUpdateProperties model = BinaryData.fromString( - "{\"state\":\"Disabled\",\"vmMembers\":[\"pnazzm\",\"jrunmpxtt\"],\"hostMembers\":[\"rbnlankxmyskp\",\"henbtkcxywnytn\",\"synlqidybyxczfc\",\"haaxdbabphl\"],\"affinityStrength\":\"Must\",\"azureHybridBenefitType\":\"SqlHost\"}") - .toObject(PlacementPolicyUpdateProperties.class); - Assertions.assertEquals(PlacementPolicyState.DISABLED, model.state()); - Assertions.assertEquals("pnazzm", model.vmMembers().get(0)); - Assertions.assertEquals("rbnlankxmyskp", model.hostMembers().get(0)); - Assertions.assertEquals(AffinityStrength.MUST, model.affinityStrength()); - Assertions.assertEquals(AzureHybridBenefitType.SQL_HOST, model.azureHybridBenefitType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PlacementPolicyUpdateProperties model - = new PlacementPolicyUpdateProperties().withState(PlacementPolicyState.DISABLED) - .withVmMembers(Arrays.asList("pnazzm", "jrunmpxtt")) - .withHostMembers(Arrays.asList("rbnlankxmyskp", "henbtkcxywnytn", "synlqidybyxczfc", "haaxdbabphl")) - .withAffinityStrength(AffinityStrength.MUST) - .withAzureHybridBenefitType(AzureHybridBenefitType.SQL_HOST); - model = BinaryData.fromObject(model).toObject(PlacementPolicyUpdateProperties.class); - Assertions.assertEquals(PlacementPolicyState.DISABLED, model.state()); - Assertions.assertEquals("pnazzm", model.vmMembers().get(0)); - Assertions.assertEquals("rbnlankxmyskp", model.hostMembers().get(0)); - Assertions.assertEquals(AffinityStrength.MUST, model.affinityStrength()); - Assertions.assertEquals(AzureHybridBenefitType.SQL_HOST, model.azureHybridBenefitType()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyUpdateTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyUpdateTests.java deleted file mode 100644 index d1f80d3e9f38..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PlacementPolicyUpdateTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.AffinityStrength; -import com.azure.resourcemanager.avs.models.AzureHybridBenefitType; -import com.azure.resourcemanager.avs.models.PlacementPolicyState; -import com.azure.resourcemanager.avs.models.PlacementPolicyUpdate; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PlacementPolicyUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlacementPolicyUpdate model = BinaryData.fromString( - "{\"properties\":{\"state\":\"Enabled\",\"vmMembers\":[\"n\",\"uynhijg\"],\"hostMembers\":[\"bfs\"],\"affinityStrength\":\"Should\",\"azureHybridBenefitType\":\"SqlHost\"}}") - .toObject(PlacementPolicyUpdate.class); - Assertions.assertEquals(PlacementPolicyState.ENABLED, model.state()); - Assertions.assertEquals("n", model.vmMembers().get(0)); - Assertions.assertEquals("bfs", model.hostMembers().get(0)); - Assertions.assertEquals(AffinityStrength.SHOULD, model.affinityStrength()); - Assertions.assertEquals(AzureHybridBenefitType.SQL_HOST, model.azureHybridBenefitType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PlacementPolicyUpdate model = new PlacementPolicyUpdate().withState(PlacementPolicyState.ENABLED) - .withVmMembers(Arrays.asList("n", "uynhijg")) - .withHostMembers(Arrays.asList("bfs")) - .withAffinityStrength(AffinityStrength.SHOULD) - .withAzureHybridBenefitType(AzureHybridBenefitType.SQL_HOST); - model = BinaryData.fromObject(model).toObject(PlacementPolicyUpdate.class); - Assertions.assertEquals(PlacementPolicyState.ENABLED, model.state()); - Assertions.assertEquals("n", model.vmMembers().get(0)); - Assertions.assertEquals("bfs", model.hostMembers().get(0)); - Assertions.assertEquals(AffinityStrength.SHOULD, model.affinityStrength()); - Assertions.assertEquals(AzureHybridBenefitType.SQL_HOST, model.azureHybridBenefitType()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PrivateCloudIdentityTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PrivateCloudIdentityTests.java deleted file mode 100644 index 3c379d8bdeae..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PrivateCloudIdentityTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.PrivateCloudIdentity; -import com.azure.resourcemanager.avs.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class PrivateCloudIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateCloudIdentity model - = BinaryData.fromString("{\"principalId\":\"s\",\"tenantId\":\"gbquxigj\",\"type\":\"SystemAssigned\"}") - .toObject(PrivateCloudIdentity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateCloudIdentity model = new PrivateCloudIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(PrivateCloudIdentity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PrivateCloudsDeleteMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PrivateCloudsDeleteMockTests.java index f3bb3d0a40ac..5b67781fb278 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PrivateCloudsDeleteMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/PrivateCloudsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.privateClouds().delete("y", "pgogtqxepny", com.azure.core.util.Context.NONE); + manager.privateClouds().delete("kyfede", "jboslcqxypok", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksGetWithResponseMockTests.java new file mode 100644 index 000000000000..8bee8cfdd3d4 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.avs.AvsManager; +import com.azure.resourcemanager.avs.models.ProvisionedNetwork; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProvisionedNetworksGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Failed\",\"addressPrefix\":\"wwhnhjtfvpn\",\"networkType\":\"esxManagement\"},\"id\":\"ljpnwynudqll\",\"name\":\"sauzpjlx\",\"type\":\"ehuxiqhzlraym\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + AvsManager manager = AvsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ProvisionedNetwork response = manager.provisionedNetworks() + .getWithResponse("weryekzk", "hmeott", "w", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksListMockTests.java new file mode 100644 index 000000000000..2babb4a3c0b0 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ProvisionedNetworksListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.avs.AvsManager; +import com.azure.resourcemanager.avs.models.ProvisionedNetwork; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProvisionedNetworksListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"rwzawnvs\",\"networkType\":\"hcxManagement\"},\"id\":\"zagxnvhycvdi\",\"name\":\"wrzregzgyufu\",\"type\":\"rw\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + AvsManager manager = AvsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.provisionedNetworks() + .list("wixvcpwnkwywzw", "falickduoiqtamty", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/QuotaInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/QuotaInnerTests.java deleted file mode 100644 index 79536256a255..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/QuotaInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.QuotaInner; - -public final class QuotaInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaInner model - = BinaryData.fromString("{\"hostsRemaining\":{\"ithxqhabifpi\":758913948},\"quotaEnabled\":\"Enabled\"}") - .toObject(QuotaInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaInner model = new QuotaInner(); - model = BinaryData.fromObject(model).toObject(QuotaInner.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletInnerTests.java deleted file mode 100644 index 08ae1b922013..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner; - -public final class ScriptCmdletInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptCmdletInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Failed\",\"description\":\"hos\",\"timeout\":\"dqrhzoymib\",\"audience\":\"Automation\",\"parameters\":[{\"type\":\"Float\",\"name\":\"wfluszdt\",\"description\":\"rkwofyyvoqa\",\"visibility\":\"Hidden\",\"optional\":\"Required\"},{\"type\":\"SecureString\",\"name\":\"giwbwoenwa\",\"description\":\"rtdtkcnqxw\",\"visibility\":\"Hidden\",\"optional\":\"Optional\"},{\"type\":\"Float\",\"name\":\"ujw\",\"description\":\"sipqii\",\"visibility\":\"Visible\",\"optional\":\"Required\"}]},\"id\":\"rpqlp\",\"name\":\"wcciuqgbdbu\",\"type\":\"auvfbtkuwhhmhyk\"}") - .toObject(ScriptCmdletInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptCmdletInner model = new ScriptCmdletInner(); - model = BinaryData.fromObject(model).toObject(ScriptCmdletInner.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletPropertiesTests.java deleted file mode 100644 index eabbdfdd0414..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletProperties; - -public final class ScriptCmdletPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptCmdletProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Failed\",\"description\":\"afnn\",\"timeout\":\"pichkoymkcdy\",\"audience\":\"Automation\",\"parameters\":[{\"type\":\"Int\",\"name\":\"reqnovvqfov\",\"description\":\"xywsuws\",\"visibility\":\"Visible\",\"optional\":\"Required\"}]}") - .toObject(ScriptCmdletProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptCmdletProperties model = new ScriptCmdletProperties(); - model = BinaryData.fromObject(model).toObject(ScriptCmdletProperties.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsGetWithResponseMockTests.java index 2dc42cc9a0cf..4e1ab0b8dd96 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsGetWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.ScriptCmdlet; @@ -20,17 +20,18 @@ public final class ScriptCmdletsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"description\":\"swokm\",\"timeout\":\"hl\",\"audience\":\"Any\",\"parameters\":[{\"type\":\"Bool\",\"name\":\"qkzszuwiwtglxxh\",\"description\":\"fpgpicrmnzhrgm\",\"visibility\":\"Visible\",\"optional\":\"Optional\"},{\"type\":\"Int\",\"name\":\"cbfrm\",\"description\":\"dths\",\"visibility\":\"Hidden\",\"optional\":\"Required\"},{\"type\":\"Bool\",\"name\":\"a\",\"description\":\"lacjfrnxo\",\"visibility\":\"Hidden\",\"optional\":\"Required\"}]},\"id\":\"lwvsgm\",\"name\":\"ohqfzizv\",\"type\":\"xmmkjs\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"description\":\"oypmbltoorm\",\"timeout\":\"qlwxldyka\",\"audience\":\"Any\",\"parameters\":[{\"type\":\"Credential\",\"name\":\"jpnnbmjksibjgsj\",\"description\":\"xahmrnadzyqegxy\",\"visibility\":\"Hidden\",\"optional\":\"Optional\"},{\"type\":\"SecureString\",\"name\":\"wbjijkgq\",\"description\":\"h\",\"visibility\":\"Hidden\",\"optional\":\"Optional\"},{\"type\":\"Int\",\"name\":\"ujvaannggi\",\"description\":\"wkdtaawxwf\",\"visibility\":\"Hidden\",\"optional\":\"Required\"}]},\"id\":\"rq\",\"name\":\"bzmqkratbn\",\"type\":\"wbjsidbirkf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ScriptCmdlet response = manager.scriptCmdlets() - .getWithResponse("r", "govfgpikqmhhaow", "rmzvupo", "qzdfuydzvkfvxcn", com.azure.core.util.Context.NONE) + .getWithResponse("mrdixtreki", "swyskbruffg", "lukkutvlxhrpqhvm", "lcouqehbhbcdszir", + com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsListMockTests.java index 093a063e6338..d058dcb76e6b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsListMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.ScriptCmdlet; @@ -21,17 +21,17 @@ public final class ScriptCmdletsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"description\":\"kfkyjp\",\"timeout\":\"pbpssdfpp\",\"audience\":\"Automation\",\"parameters\":[{\"type\":\"Bool\",\"name\":\"jtvczkcnyxrxmun\",\"description\":\"xvglnkvxlxp\",\"visibility\":\"Hidden\",\"optional\":\"Optional\"},{\"type\":\"Float\",\"name\":\"kc\",\"description\":\"hpzvuqdflvoniyp\",\"visibility\":\"Hidden\",\"optional\":\"Required\"}]},\"id\":\"zgp\",\"name\":\"tivhjknidibgqjx\",\"type\":\"p\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"description\":\"jwy\",\"timeout\":\"kmbtsuahx\",\"audience\":\"Any\",\"parameters\":[{\"type\":\"String\",\"name\":\"rrscubiwsdrnp\",\"description\":\"wodiffjxc\",\"visibility\":\"Visible\",\"optional\":\"Required\"},{\"type\":\"Bool\",\"name\":\"ibvjogjonmcy\",\"description\":\"oyzbamwineofvf\",\"visibility\":\"Hidden\",\"optional\":\"Required\"}]},\"id\":\"dt\",\"name\":\"evboclzhzjknyuxg\",\"type\":\"ttxpnrupza\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.scriptCmdlets() - .list("iwhxqszdtmaajq", "huxy", "rjvmtygjbmzyosp", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.scriptCmdlets().list("bvjhvefgwbmqj", "hntasfaymx", "ulpzealb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsListTests.java deleted file mode 100644 index 4a750a744883..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptCmdletsListTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner; -import com.azure.resourcemanager.avs.models.ScriptCmdletsList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScriptCmdletsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptCmdletsList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"description\":\"ikdowwquuvx\",\"timeout\":\"clvit\",\"audience\":\"Any\",\"parameters\":[{\"type\":\"Float\",\"name\":\"ggbhcohfwds\",\"description\":\"ka\",\"visibility\":\"Hidden\",\"optional\":\"Required\"}]},\"id\":\"swacffgdkzz\",\"name\":\"wkfvhqcrailvp\",\"type\":\"ppfufl\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"description\":\"dlxyjrxs\",\"timeout\":\"afcnih\",\"audience\":\"Any\",\"parameters\":[{\"type\":\"Int\",\"name\":\"gfbcvkcv\",\"description\":\"pkeqdcvdrhvoo\",\"visibility\":\"Hidden\",\"optional\":\"Required\"},{\"type\":\"Bool\",\"name\":\"dopcjwvnh\",\"description\":\"d\",\"visibility\":\"Visible\",\"optional\":\"Required\"}]},\"id\":\"rslpmutwuoeg\",\"name\":\"pkhjwni\",\"type\":\"qsluicp\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"description\":\"zl\",\"timeout\":\"bmpaxmodfvu\",\"audience\":\"Automation\",\"parameters\":[{\"type\":\"Float\",\"name\":\"vmwy\",\"description\":\"fouyf\",\"visibility\":\"Visible\",\"optional\":\"Optional\"},{\"type\":\"SecureString\",\"name\":\"yzvqt\",\"description\":\"ubex\",\"visibility\":\"Visible\",\"optional\":\"Optional\"},{\"type\":\"Credential\",\"name\":\"djmq\",\"description\":\"vypomgkopkwho\",\"visibility\":\"Hidden\",\"optional\":\"Optional\"}]},\"id\":\"gxysmocmbqfqvm\",\"name\":\"cxozapvhelxp\",\"type\":\"glyatddckcbcuej\"}],\"nextLink\":\"xgc\"}") - .toObject(ScriptCmdletsList.class); - Assertions.assertEquals("xgc", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptCmdletsList model = new ScriptCmdletsList() - .withValue(Arrays.asList(new ScriptCmdletInner(), new ScriptCmdletInner(), new ScriptCmdletInner())) - .withNextLink("xgc"); - model = BinaryData.fromObject(model).toObject(ScriptCmdletsList.class); - Assertions.assertEquals("xgc", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionInnerTests.java deleted file mode 100644 index 75a7ab111362..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionInnerTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ScriptExecutionInner; -import com.azure.resourcemanager.avs.models.ScriptExecutionParameter; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ScriptExecutionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptExecutionInner model = BinaryData.fromString( - "{\"properties\":{\"scriptCmdletId\":\"txmedj\",\"parameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"lynqwwncwzzh\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"gktrmgucnapkte\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"ellwptfdy\"}],\"hiddenParameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"qbuaceopzfqr\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"huaoppp\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"qeqxo\"}],\"failureReason\":\"dahzxctobg\",\"timeout\":\"kdmoi\",\"retention\":\"ostmgrcf\",\"submittedAt\":\"2021-06-18T12:29:32Z\",\"startedAt\":\"2021-06-08T13:34:15Z\",\"finishedAt\":\"2021-07-20T04:26:41Z\",\"provisioningState\":\"Canceled\",\"output\":[\"xbpvjymjhx\",\"j\"],\"namedOutputs\":{\"ivkrtsw\":\"datau\",\"vjfdx\":\"dataxqzvszjfa\",\"qtdo\":\"dataivetvtcq\",\"bhsfxob\":\"datamcbxvwvxysl\"},\"information\":[\"k\",\"lmpewwwfbkr\",\"rn\"],\"warnings\":[\"hqjohxcrsbfova\",\"rruvwbhsq\",\"sub\"],\"errors\":[\"birx\"]},\"id\":\"ybsrfbjfdtwss\",\"name\":\"t\",\"type\":\"tpvjzbexilzznfqq\"}") - .toObject(ScriptExecutionInner.class); - Assertions.assertEquals("txmedj", model.scriptCmdletId()); - Assertions.assertEquals("lynqwwncwzzh", model.parameters().get(0).name()); - Assertions.assertEquals("qbuaceopzfqr", model.hiddenParameters().get(0).name()); - Assertions.assertEquals("dahzxctobg", model.failureReason()); - Assertions.assertEquals("kdmoi", model.timeout()); - Assertions.assertEquals("ostmgrcf", model.retention()); - Assertions.assertEquals("xbpvjymjhx", model.output().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptExecutionInner model = new ScriptExecutionInner().withScriptCmdletId("txmedj") - .withParameters(Arrays.asList(new ScriptExecutionParameter().withName("lynqwwncwzzh"), - new ScriptExecutionParameter().withName("gktrmgucnapkte"), - new ScriptExecutionParameter().withName("ellwptfdy"))) - .withHiddenParameters(Arrays.asList(new ScriptExecutionParameter().withName("qbuaceopzfqr"), - new ScriptExecutionParameter().withName("huaoppp"), new ScriptExecutionParameter().withName("qeqxo"))) - .withFailureReason("dahzxctobg") - .withTimeout("kdmoi") - .withRetention("ostmgrcf") - .withOutput(Arrays.asList("xbpvjymjhx", "j")) - .withNamedOutputs(mapOf("ivkrtsw", "datau", "vjfdx", "dataxqzvszjfa", "qtdo", "dataivetvtcq", "bhsfxob", - "datamcbxvwvxysl")); - model = BinaryData.fromObject(model).toObject(ScriptExecutionInner.class); - Assertions.assertEquals("txmedj", model.scriptCmdletId()); - Assertions.assertEquals("lynqwwncwzzh", model.parameters().get(0).name()); - Assertions.assertEquals("qbuaceopzfqr", model.hiddenParameters().get(0).name()); - Assertions.assertEquals("dahzxctobg", model.failureReason()); - Assertions.assertEquals("kdmoi", model.timeout()); - Assertions.assertEquals("ostmgrcf", model.retention()); - Assertions.assertEquals("xbpvjymjhx", model.output().get(0)); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionParameterTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionParameterTests.java deleted file mode 100644 index 474df6cd02a3..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionParameterTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.ScriptExecutionParameter; -import org.junit.jupiter.api.Assertions; - -public final class ScriptExecutionParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptExecutionParameter model - = BinaryData.fromString("{\"type\":\"ScriptExecutionParameter\",\"name\":\"gaokonzmnsikv\"}") - .toObject(ScriptExecutionParameter.class); - Assertions.assertEquals("gaokonzmnsikv", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptExecutionParameter model = new ScriptExecutionParameter().withName("gaokonzmnsikv"); - model = BinaryData.fromObject(model).toObject(ScriptExecutionParameter.class); - Assertions.assertEquals("gaokonzmnsikv", model.name()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionPropertiesTests.java deleted file mode 100644 index e59334b3c0d2..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionPropertiesTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ScriptExecutionProperties; -import com.azure.resourcemanager.avs.models.ScriptExecutionParameter; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ScriptExecutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptExecutionProperties model = BinaryData.fromString( - "{\"scriptCmdletId\":\"wpmqt\",\"parameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"oujmkcjhwqytj\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"ybn\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"jewgdrjerv\"}],\"hiddenParameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"nqpeh\"}],\"failureReason\":\"doy\",\"timeout\":\"mifthnzdnd\",\"retention\":\"gnayqigynduh\",\"submittedAt\":\"2021-02-07T07:32:59Z\",\"startedAt\":\"2021-02-05T08:21:04Z\",\"finishedAt\":\"2021-06-18T10:05:08Z\",\"provisioningState\":\"Failed\",\"output\":[\"qolbgyc\",\"uie\",\"tgccymvaolpss\",\"qlfmmdnbb\"],\"namedOutputs\":{\"dxssadbzm\":\"datapswiydmcwyh\",\"cblylpstdbhhxsr\":\"datavdfznudaodvxzb\",\"erscdntne\":\"datadzu\"},\"information\":[\"wjmy\",\"tdss\",\"s\"],\"warnings\":[\"weriofzpyqsem\",\"abnetshh\",\"zhedplvwiw\"],\"errors\":[\"wmbesldnkw\",\"tppjflcx\"]}") - .toObject(ScriptExecutionProperties.class); - Assertions.assertEquals("wpmqt", model.scriptCmdletId()); - Assertions.assertEquals("oujmkcjhwqytj", model.parameters().get(0).name()); - Assertions.assertEquals("nqpeh", model.hiddenParameters().get(0).name()); - Assertions.assertEquals("doy", model.failureReason()); - Assertions.assertEquals("mifthnzdnd", model.timeout()); - Assertions.assertEquals("gnayqigynduh", model.retention()); - Assertions.assertEquals("qolbgyc", model.output().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptExecutionProperties model = new ScriptExecutionProperties().withScriptCmdletId("wpmqt") - .withParameters(Arrays.asList(new ScriptExecutionParameter().withName("oujmkcjhwqytj"), - new ScriptExecutionParameter().withName("ybn"), new ScriptExecutionParameter().withName("jewgdrjerv"))) - .withHiddenParameters(Arrays.asList(new ScriptExecutionParameter().withName("nqpeh"))) - .withFailureReason("doy") - .withTimeout("mifthnzdnd") - .withRetention("gnayqigynduh") - .withOutput(Arrays.asList("qolbgyc", "uie", "tgccymvaolpss", "qlfmmdnbb")) - .withNamedOutputs( - mapOf("dxssadbzm", "datapswiydmcwyh", "cblylpstdbhhxsr", "datavdfznudaodvxzb", "erscdntne", "datadzu")); - model = BinaryData.fromObject(model).toObject(ScriptExecutionProperties.class); - Assertions.assertEquals("wpmqt", model.scriptCmdletId()); - Assertions.assertEquals("oujmkcjhwqytj", model.parameters().get(0).name()); - Assertions.assertEquals("nqpeh", model.hiddenParameters().get(0).name()); - Assertions.assertEquals("doy", model.failureReason()); - Assertions.assertEquals("mifthnzdnd", model.timeout()); - Assertions.assertEquals("gnayqigynduh", model.retention()); - Assertions.assertEquals("qolbgyc", model.output().get(0)); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsCreateOrUpdateMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsCreateOrUpdateMockTests.java index 11d1730153df..c04eff25bec6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsCreateOrUpdateMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsCreateOrUpdateMockTests.java @@ -1,17 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.ScriptExecution; import com.azure.resourcemanager.avs.models.ScriptExecutionParameter; +import com.azure.resourcemanager.avs.models.ScriptExecutionProperties; +import com.azure.resourcemanager.avs.models.ScriptExecutionPropertiesNamedOutput; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -25,37 +27,37 @@ public final class ScriptExecutionsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"scriptCmdletId\":\"hndvnoamldsehao\",\"parameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"hhflzo\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"xcoxpelnjet\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"gltsxoat\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"tgzpnpb\"}],\"hiddenParameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"e\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"loccsrmozihm\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"pgawtxxpkyjcxcjx\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"rytfmpcycil\"}],\"failureReason\":\"caykggnoxuz\",\"timeout\":\"rksxwpndfc\",\"retention\":\"nznthjtw\",\"submittedAt\":\"2021-04-10T21:21:13Z\",\"startedAt\":\"2021-06-06T01:38:06Z\",\"finishedAt\":\"2021-07-22T12:28:11Z\",\"provisioningState\":\"Succeeded\",\"output\":[\"amktcqiosmgbzah\",\"xqdlyrtltlapr\"],\"namedOutputs\":{\"nnbsoqeqa\":\"datakatbhjm\",\"febwlnbmhyreeudz\":\"dataarvlagunbt\"},\"information\":[\"bpdqmjxlyy\",\"glgou\",\"tlmj\",\"yuojqtobaxk\"],\"warnings\":[\"tu\",\"lbfjkwr\",\"snkq\"],\"errors\":[\"y\"]},\"id\":\"unjqh\",\"name\":\"enx\",\"type\":\"ulkpakd\"}"; + = "{\"properties\":{\"scriptCmdletId\":\"selpkpbaf\",\"parameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"hlbylccbevxr\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"yzd\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"wrso\"}],\"hiddenParameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"td\"}],\"failureReason\":\"airrhvhfnracw\",\"timeout\":\"pqigtuujwouhd\",\"retention\":\"s\",\"submittedAt\":\"2021-09-12T08:30:14Z\",\"startedAt\":\"2021-03-06T17:38:31Z\",\"finishedAt\":\"2021-07-09T10:35:13Z\",\"provisioningState\":\"Succeeded\",\"output\":[\"vitvqkjyaz\",\"umtggmuwdchozfn\",\"fexl\"],\"namedOutputs\":{\"oakizvoai\":{},\"naqln\":{}},\"information\":[\"guyxlyk\",\"phvxz\",\"wxh\"],\"warnings\":[\"jtlkexaonwivkcqh\",\"xhxknlc\"],\"errors\":[\"mkyupijub\",\"qjfkakfqfrkemyi\"]},\"id\":\"udxjascowv\",\"name\":\"djkpdxph\",\"type\":\"kk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ScriptExecution response = manager.scriptExecutions() - .define("elfwy") - .withExistingPrivateCloud("fy", "sgcrpfbcunezzce") - .withScriptCmdletId("wx") - .withParameters(Arrays.asList(new ScriptExecutionParameter().withName("tnpsihclaf"), - new ScriptExecutionParameter().withName("va"), new ScriptExecutionParameter().withName("lpt"))) - .withHiddenParameters(Arrays.asList(new ScriptExecutionParameter().withName("qwztcmwqkc"), - new ScriptExecutionParameter().withName("cxwaxfewz"))) - .withFailureReason("jexfdeqvhp") - .withTimeout("ylkkshkbffmbm") - .withRetention("jrgywwpgjxsn") - .withOutput(Arrays.asList("o", "pttaqutd", "wemxswvruunzz", "gehkfkimrtixokff")) - .withNamedOutputs(mapOf("shiy", "datanljqepqwhixmons", "du", "datagvelfc", "rds", "datacb", "b", "datauwc")) + .define("xjd") + .withExistingPrivateCloud("orvvmqfloygbdgw", "mgxdgdhpabgd") + .withProperties(new ScriptExecutionProperties().withScriptCmdletId("saq") + .withParameters(Arrays.asList(new ScriptExecutionParameter().withName("mmwllc"))) + .withHiddenParameters(Arrays.asList(new ScriptExecutionParameter().withName("rsxaptefh"), + new ScriptExecutionParameter().withName("xcgjokjljnhvlq"), + new ScriptExecutionParameter().withName("bekpeeksnbksdqhj"))) + .withFailureReason("klxesl") + .withTimeout("hhus") + .withRetention("poq") + .withOutput(Arrays.asList("nlejjjkxybwf", "bkjbz", "ensvkzykjtj", "nsxfwu")) + .withNamedOutputs(mapOf("dpkupnqrmgjf", new ScriptExecutionPropertiesNamedOutput()))) .create(); - Assertions.assertEquals("hndvnoamldsehao", response.scriptCmdletId()); - Assertions.assertEquals("hhflzo", response.parameters().get(0).name()); - Assertions.assertEquals("e", response.hiddenParameters().get(0).name()); - Assertions.assertEquals("caykggnoxuz", response.failureReason()); - Assertions.assertEquals("rksxwpndfc", response.timeout()); - Assertions.assertEquals("nznthjtw", response.retention()); - Assertions.assertEquals("amktcqiosmgbzah", response.output().get(0)); + Assertions.assertEquals("selpkpbaf", response.properties().scriptCmdletId()); + Assertions.assertEquals("hlbylccbevxr", response.properties().parameters().get(0).name()); + Assertions.assertEquals("td", response.properties().hiddenParameters().get(0).name()); + Assertions.assertEquals("airrhvhfnracw", response.properties().failureReason()); + Assertions.assertEquals("pqigtuujwouhd", response.properties().timeout()); + Assertions.assertEquals("s", response.properties().retention()); + Assertions.assertEquals("vitvqkjyaz", response.properties().output().get(0)); } // Use "Map.of" if available diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsDeleteMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsDeleteMockTests.java index f9b985ce163f..c446863cd114 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsDeleteMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDelete() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.scriptExecutions().delete("puamwabzxr", "xcushs", "haivm", com.azure.core.util.Context.NONE); + manager.scriptExecutions() + .delete("kzzltafhbzf", "ovwmbjlzqsczpgvd", "napfdqwowftpt", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetExecutionLogsWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetExecutionLogsWithResponseMockTests.java index f3aae719e3c6..2122e890179f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetExecutionLogsWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetExecutionLogsWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.ScriptExecution; @@ -23,28 +23,28 @@ public final class ScriptExecutionsGetExecutionLogsWithResponseMockTests { @Test public void testGetExecutionLogsWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"scriptCmdletId\":\"cbm\",\"parameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"xmvwfg\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"ayxonsupeujl\"}],\"hiddenParameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"hcvsqltnzoi\"}],\"failureReason\":\"sxgnx\",\"timeout\":\"yqo\",\"retention\":\"p\",\"submittedAt\":\"2021-05-25T17:04:08Z\",\"startedAt\":\"2021-08-14T04:57:20Z\",\"finishedAt\":\"2021-04-29T21:53:48Z\",\"provisioningState\":\"Cancelled\",\"output\":[\"qxeiiqbimhtmwwi\",\"h\",\"hfqpofv\"],\"namedOutputs\":{\"vqihebwtswbzuwf\":\"datablembnkbwvqvxkd\",\"felisdjub\":\"dataduragegizvc\",\"kxkbsazgakgacyr\":\"datagbqi\"},\"information\":[\"dmspof\",\"pv\",\"hryl\",\"iofrzgbzjedmstk\"],\"warnings\":[\"v\"],\"errors\":[\"uiiznktwfansnvpd\"]},\"id\":\"mik\",\"name\":\"stbz\",\"type\":\"kiwbuqnyoph\"}"; + = "{\"properties\":{\"scriptCmdletId\":\"otjvdkwiswskukjt\",\"parameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"vwisp\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"xkdtxfkndlqvtwkn\"}],\"hiddenParameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"mb\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"gtywatmqaqkue\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"tgroesh\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"ygzc\"}],\"failureReason\":\"fqxkfaoyteh\",\"timeout\":\"puvjmvqmtd\",\"retention\":\"kygroejnndljdj\",\"submittedAt\":\"2021-06-10T12:23:34Z\",\"startedAt\":\"2021-10-05T05:25:57Z\",\"finishedAt\":\"2021-09-03T14:10:55Z\",\"provisioningState\":\"Cancelled\",\"output\":[\"ceysfaqeg\",\"lwryshwddkvbxgkq\",\"sybwptdaca\",\"vvlfntymtp\"],\"namedOutputs\":{\"enazerohzrsqals\":{},\"kdnwqapfgsdpcve\":{}},\"information\":[\"zhhkuuipldqqc\",\"ekvalblhtjq\",\"qyv\",\"eh\"],\"warnings\":[\"mxhzzysevus\",\"ivzrrryveimipsk\"],\"errors\":[\"atvfuzkaftj\",\"vru\",\"wigsyeipqdsm\"]},\"id\":\"grq\",\"name\":\"dgkkile\",\"type\":\"lkcsmknhwtbbae\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ScriptExecution response = manager.scriptExecutions() - .getExecutionLogsWithResponse("yasflvgsgzwy", "akoi", "knsmjblmljhlnymz", - Arrays.asList(ScriptOutputStreamType.ERROR, ScriptOutputStreamType.WARNING, - ScriptOutputStreamType.OUTPUT, ScriptOutputStreamType.ERROR), + .getExecutionLogsWithResponse("uwjtks", "h", "cgqyhleseyq", + Arrays.asList(ScriptOutputStreamType.WARNING, ScriptOutputStreamType.INFORMATION, + ScriptOutputStreamType.WARNING), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("cbm", response.scriptCmdletId()); - Assertions.assertEquals("xmvwfg", response.parameters().get(0).name()); - Assertions.assertEquals("hcvsqltnzoi", response.hiddenParameters().get(0).name()); - Assertions.assertEquals("sxgnx", response.failureReason()); - Assertions.assertEquals("yqo", response.timeout()); - Assertions.assertEquals("p", response.retention()); - Assertions.assertEquals("qxeiiqbimhtmwwi", response.output().get(0)); + Assertions.assertEquals("otjvdkwiswskukjt", response.properties().scriptCmdletId()); + Assertions.assertEquals("vwisp", response.properties().parameters().get(0).name()); + Assertions.assertEquals("mb", response.properties().hiddenParameters().get(0).name()); + Assertions.assertEquals("fqxkfaoyteh", response.properties().failureReason()); + Assertions.assertEquals("puvjmvqmtd", response.properties().timeout()); + Assertions.assertEquals("kygroejnndljdj", response.properties().retention()); + Assertions.assertEquals("ceysfaqeg", response.properties().output().get(0)); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetWithResponseMockTests.java index afa3eddb1527..2d7210749e8e 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.ScriptExecution; @@ -21,25 +21,25 @@ public final class ScriptExecutionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"scriptCmdletId\":\"ajqglcf\",\"parameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"rqryxynqn\"}],\"hiddenParameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"p\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"ovw\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"zn\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"tgoe\"}],\"failureReason\":\"bbabp\",\"timeout\":\"hv\",\"retention\":\"lkvn\",\"submittedAt\":\"2021-08-17T19:10:03Z\",\"startedAt\":\"2021-02-17T02:46:23Z\",\"finishedAt\":\"2021-08-14T15:24:28Z\",\"provisioningState\":\"Succeeded\",\"output\":[\"rioov\"],\"namedOutputs\":{\"frygznmmax\":\"datasxwaabzm\",\"xlhslnel\":\"dataizkzobgo\"},\"information\":[\"ixynllxecwcrojp\",\"slhcawjutifd\",\"fmvigorqjbttzh\",\"aglkafhon\"],\"warnings\":[\"jeick\",\"zvcpopm\"],\"errors\":[\"nwcl\",\"yjede\",\"xm\"]},\"id\":\"mkqscaz\",\"name\":\"awx\",\"type\":\"z\"}"; + = "{\"properties\":{\"scriptCmdletId\":\"lvdjjukyr\",\"parameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"odxahhxhqf\"}],\"hiddenParameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"vzoqgyipemchgavs\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"zuejd\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"xptlghwzho\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"ewj\"}],\"failureReason\":\"tl\",\"timeout\":\"uhqawmoaianc\",\"retention\":\"vodrrslblxydkxr\",\"submittedAt\":\"2021-11-26T07:47:59Z\",\"startedAt\":\"2021-08-18T06:28:23Z\",\"finishedAt\":\"2021-11-22T19:16:48Z\",\"provisioningState\":\"Succeeded\",\"output\":[\"qljnqkhychoco\"],\"namedOutputs\":{\"ehurqlr\":{}},\"information\":[\"aweyur\",\"phyjdxravj\"],\"warnings\":[\"brxmrgch\",\"apx\"],\"errors\":[\"fjjkbajb\"]},\"id\":\"cgduusio\",\"name\":\"cblevpmc\",\"type\":\"ujyxkyxlzgsj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ScriptExecution response = manager.scriptExecutions() - .getWithResponse("qxtbjwgnyf", "sf", "svtui", com.azure.core.util.Context.NONE) + .getWithResponse("nlzafwxudgnh", "ookrtalvnbw", "pbeme", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ajqglcf", response.scriptCmdletId()); - Assertions.assertEquals("rqryxynqn", response.parameters().get(0).name()); - Assertions.assertEquals("p", response.hiddenParameters().get(0).name()); - Assertions.assertEquals("bbabp", response.failureReason()); - Assertions.assertEquals("hv", response.timeout()); - Assertions.assertEquals("lkvn", response.retention()); - Assertions.assertEquals("rioov", response.output().get(0)); + Assertions.assertEquals("lvdjjukyr", response.properties().scriptCmdletId()); + Assertions.assertEquals("odxahhxhqf", response.properties().parameters().get(0).name()); + Assertions.assertEquals("vzoqgyipemchgavs", response.properties().hiddenParameters().get(0).name()); + Assertions.assertEquals("tl", response.properties().failureReason()); + Assertions.assertEquals("uhqawmoaianc", response.properties().timeout()); + Assertions.assertEquals("vodrrslblxydkxr", response.properties().retention()); + Assertions.assertEquals("qljnqkhychoco", response.properties().output().get(0)); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsListMockTests.java index dd51099709c6..34e519fd3df7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsListMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.ScriptExecution; @@ -22,24 +22,25 @@ public final class ScriptExecutionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"scriptCmdletId\":\"hdxbzlm\",\"parameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"apcvhdbe\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"wqqxeysko\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"qzinkfkbg\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"z\"}],\"hiddenParameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"xeqoc\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"jmygvk\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"qkjjeokbz\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"fezrx\"}],\"failureReason\":\"zurtleipqxbkwvz\",\"timeout\":\"nzvdfbzdixzmq\",\"retention\":\"odawopqhewjptmcg\",\"submittedAt\":\"2021-04-24T18:57:19Z\",\"startedAt\":\"2021-03-17T12:43:28Z\",\"finishedAt\":\"2021-01-11T18:38:59Z\",\"provisioningState\":\"Cancelling\",\"output\":[\"atutmzlbiojlvfhr\"],\"namedOutputs\":{\"hppr\":\"dataneqvcwwyyurmo\"},\"information\":[\"nmokayzejnhlbk\",\"bzpcpiljhahzvec\",\"ndbnwieh\"],\"warnings\":[\"wjwiuub\",\"efqsfapaqtferrqw\",\"x\"],\"errors\":[\"fxapjwogqqnobpu\",\"cdabtqwpwya\",\"bzasqbucljgkyexa\",\"guyaip\"]},\"id\":\"sdaultxij\",\"name\":\"um\",\"type\":\"qwazlnqnmcjngzq\"}]}"; + = "{\"value\":[{\"properties\":{\"scriptCmdletId\":\"ijymrhbguzozky\",\"parameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"f\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"zhhh\"}],\"hiddenParameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"mffjkutycyarn\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"oohguabzoghkt\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"pyc\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"hcoeocnhzq\"}],\"failureReason\":\"ttjzcfyjzpt\",\"timeout\":\"rl\",\"retention\":\"apqinf\",\"submittedAt\":\"2021-03-15T02:08:03Z\",\"startedAt\":\"2021-04-28T11:21:26Z\",\"finishedAt\":\"2021-04-17T18:39:17Z\",\"provisioningState\":\"Cancelled\",\"output\":[\"jzralc\",\"pjby\"],\"namedOutputs\":{\"joqcjenkyhfqzvsq\":{},\"fxjelg\":{},\"mpzqjhhhq\":{},\"uwyvcacoyvi\":{}},\"information\":[\"izus\"],\"warnings\":[\"lbscmnlz\",\"jiu\",\"ehgmvflnwyv\"],\"errors\":[\"rerlniy\",\"yl\",\"fwxzutg\",\"ztwhghmupg\"]},\"id\":\"jtcdxabbujftaben\",\"name\":\"bklqpxz\",\"type\":\"cafeddw\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.scriptExecutions().list("gqcwdhohsdtmc", "zsu", com.azure.core.util.Context.NONE); + = manager.scriptExecutions().list("kso", "dgo", com.azure.core.util.Context.NONE); - Assertions.assertEquals("hdxbzlm", response.iterator().next().scriptCmdletId()); - Assertions.assertEquals("apcvhdbe", response.iterator().next().parameters().get(0).name()); - Assertions.assertEquals("xeqoc", response.iterator().next().hiddenParameters().get(0).name()); - Assertions.assertEquals("zurtleipqxbkwvz", response.iterator().next().failureReason()); - Assertions.assertEquals("nzvdfbzdixzmq", response.iterator().next().timeout()); - Assertions.assertEquals("odawopqhewjptmcg", response.iterator().next().retention()); - Assertions.assertEquals("atutmzlbiojlvfhr", response.iterator().next().output().get(0)); + Assertions.assertEquals("ijymrhbguzozky", response.iterator().next().properties().scriptCmdletId()); + Assertions.assertEquals("f", response.iterator().next().properties().parameters().get(0).name()); + Assertions.assertEquals("mffjkutycyarn", + response.iterator().next().properties().hiddenParameters().get(0).name()); + Assertions.assertEquals("ttjzcfyjzpt", response.iterator().next().properties().failureReason()); + Assertions.assertEquals("rl", response.iterator().next().properties().timeout()); + Assertions.assertEquals("apqinf", response.iterator().next().properties().retention()); + Assertions.assertEquals("jzralc", response.iterator().next().properties().output().get(0)); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsListTests.java deleted file mode 100644 index 3e23344774b9..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptExecutionsListTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ScriptExecutionInner; -import com.azure.resourcemanager.avs.models.ScriptExecutionParameter; -import com.azure.resourcemanager.avs.models.ScriptExecutionsList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ScriptExecutionsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptExecutionsList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"scriptCmdletId\":\"sgwbnbbeld\",\"parameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"zbaliourqha\"}],\"hiddenParameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"hashsfwxosow\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"xcug\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"cjooxdjebwpucwwf\"}],\"failureReason\":\"vbvmeu\",\"timeout\":\"civyhzceuo\",\"retention\":\"jrwjueiotwm\",\"submittedAt\":\"2021-01-06T11:18:17Z\",\"startedAt\":\"2021-05-06T08:04:17Z\",\"finishedAt\":\"2021-09-27T21:02:03Z\",\"provisioningState\":\"Pending\",\"output\":[\"rjaw\",\"qwgxhniskx\",\"bkpyc\"],\"namedOutputs\":{\"auwhvylwzbtdhx\":\"datawndnhj\"},\"information\":[\"nbmpowuwprzq\",\"veual\",\"pjmkhfxobbc\",\"wsrtjriplrbpbe\"],\"warnings\":[\"hfgblc\"],\"errors\":[\"zvlvqhjkbegib\",\"nmxiebwwaloayqc\",\"wrtz\",\"uzgwyzmhtx\"]},\"id\":\"gmtsavjcbpwxqpsr\",\"name\":\"nftguvriuhpr\",\"type\":\"mdyvxqtayriw\"},{\"properties\":{\"scriptCmdletId\":\"yqbexrmcqibycno\",\"parameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"nmefqsgzvahapj\"}],\"hiddenParameters\":[{\"type\":\"ScriptExecutionParameter\",\"name\":\"pvgqzcjrvxdjzlm\"},{\"type\":\"ScriptExecutionParameter\",\"name\":\"lxkvu\"}],\"failureReason\":\"hzovawjvzunlut\",\"timeout\":\"nnprn\",\"retention\":\"peilpjzuaejxdu\",\"submittedAt\":\"2021-04-04T06:42:49Z\",\"startedAt\":\"2021-07-28T02:16:26Z\",\"finishedAt\":\"2021-11-26T08:31:17Z\",\"provisioningState\":\"Running\",\"output\":[\"mv\",\"ekg\",\"wozuhkf\",\"bsjyofdx\"],\"namedOutputs\":{\"touwaboekqv\":\"datasd\"},\"information\":[\"nsmvbxwyj\"],\"warnings\":[\"hhcaal\"],\"errors\":[\"xisxyawjoyaqcsl\",\"jpkiidzyexznelix\",\"nr\"]},\"id\":\"folhbnxknal\",\"name\":\"ulppggdtpnapnyir\",\"type\":\"pu\"}],\"nextLink\":\"igvpgylg\"}") - .toObject(ScriptExecutionsList.class); - Assertions.assertEquals("sgwbnbbeld", model.value().get(0).scriptCmdletId()); - Assertions.assertEquals("zbaliourqha", model.value().get(0).parameters().get(0).name()); - Assertions.assertEquals("hashsfwxosow", model.value().get(0).hiddenParameters().get(0).name()); - Assertions.assertEquals("vbvmeu", model.value().get(0).failureReason()); - Assertions.assertEquals("civyhzceuo", model.value().get(0).timeout()); - Assertions.assertEquals("jrwjueiotwm", model.value().get(0).retention()); - Assertions.assertEquals("rjaw", model.value().get(0).output().get(0)); - Assertions.assertEquals("igvpgylg", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptExecutionsList model = new ScriptExecutionsList().withValue(Arrays.asList( - new ScriptExecutionInner().withScriptCmdletId("sgwbnbbeld") - .withParameters(Arrays.asList(new ScriptExecutionParameter().withName("zbaliourqha"))) - .withHiddenParameters(Arrays.asList(new ScriptExecutionParameter().withName("hashsfwxosow"), - new ScriptExecutionParameter().withName("xcug"), - new ScriptExecutionParameter().withName("cjooxdjebwpucwwf"))) - .withFailureReason("vbvmeu") - .withTimeout("civyhzceuo") - .withRetention("jrwjueiotwm") - .withOutput(Arrays.asList("rjaw", "qwgxhniskx", "bkpyc")) - .withNamedOutputs(mapOf("auwhvylwzbtdhx", "datawndnhj")), - new ScriptExecutionInner().withScriptCmdletId("yqbexrmcqibycno") - .withParameters(Arrays.asList(new ScriptExecutionParameter().withName("nmefqsgzvahapj"))) - .withHiddenParameters(Arrays.asList(new ScriptExecutionParameter().withName("pvgqzcjrvxdjzlm"), - new ScriptExecutionParameter().withName("lxkvu"))) - .withFailureReason("hzovawjvzunlut") - .withTimeout("nnprn") - .withRetention("peilpjzuaejxdu") - .withOutput(Arrays.asList("mv", "ekg", "wozuhkf", "bsjyofdx")) - .withNamedOutputs(mapOf("touwaboekqv", "datasd")))) - .withNextLink("igvpgylg"); - model = BinaryData.fromObject(model).toObject(ScriptExecutionsList.class); - Assertions.assertEquals("sgwbnbbeld", model.value().get(0).scriptCmdletId()); - Assertions.assertEquals("zbaliourqha", model.value().get(0).parameters().get(0).name()); - Assertions.assertEquals("hashsfwxosow", model.value().get(0).hiddenParameters().get(0).name()); - Assertions.assertEquals("vbvmeu", model.value().get(0).failureReason()); - Assertions.assertEquals("civyhzceuo", model.value().get(0).timeout()); - Assertions.assertEquals("jrwjueiotwm", model.value().get(0).retention()); - Assertions.assertEquals("rjaw", model.value().get(0).output().get(0)); - Assertions.assertEquals("igvpgylg", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackageInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackageInnerTests.java deleted file mode 100644 index e1cd4408dcbc..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackageInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner; - -public final class ScriptPackageInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptPackageInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Failed\",\"description\":\"mubyynt\",\"version\":\"rbqtkoie\",\"company\":\"eotg\",\"uri\":\"l\"},\"id\":\"muwlauwzizxbm\",\"name\":\"gcj\",\"type\":\"fuzmuvpbtt\"}") - .toObject(ScriptPackageInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptPackageInner model = new ScriptPackageInner(); - model = BinaryData.fromObject(model).toObject(ScriptPackageInner.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagePropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagePropertiesTests.java deleted file mode 100644 index d579be12e0fa..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagePropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ScriptPackageProperties; - -public final class ScriptPackagePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptPackageProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Canceled\",\"description\":\"rp\",\"version\":\"ebmnzbtbhjpglk\",\"company\":\"ohdneuel\",\"uri\":\"hsd\"}") - .toObject(ScriptPackageProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptPackageProperties model = new ScriptPackageProperties(); - model = BinaryData.fromObject(model).toObject(ScriptPackageProperties.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagesGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagesGetWithResponseMockTests.java index 4d79e04b9388..5d06668d40d3 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagesGetWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.ScriptPackage; @@ -20,17 +20,17 @@ public final class ScriptPackagesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Canceled\",\"description\":\"nfsm\",\"version\":\"ttuxuuyilflqoiqu\",\"company\":\"ehmrn\",\"uri\":\"vsujztczytqjtwh\"},\"id\":\"unfprnjletlxs\",\"name\":\"rpddouifamo\",\"type\":\"aziynknlqwzdv\"}"; + = "{\"properties\":{\"provisioningState\":\"Canceled\",\"description\":\"czhupeukni\",\"version\":\"uyyes\",\"company\":\"djfbocyv\",\"uri\":\"ulrtywikdmh\"},\"id\":\"kuflgbh\",\"name\":\"auacdixmxufrsr\",\"type\":\"jqgdkfnozoeo\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ScriptPackage response = manager.scriptPackages() - .getWithResponse("hkwfbkgozxwop", "bydpizqaclnapxb", "yg", com.azure.core.util.Context.NONE) + .getWithResponse("stacsjvhrweftkwq", "jp", "vssehaepw", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagesListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagesListMockTests.java index 38cfcf153f91..f61c4fc56d7b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagesListMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.ScriptPackage; @@ -21,17 +21,17 @@ public final class ScriptPackagesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"description\":\"eyirdhlisngw\",\"version\":\"qqmpizruwnpqx\",\"company\":\"iwfcngjsa\",\"uri\":\"iixtmkzj\"},\"id\":\"viirhgfgrws\",\"name\":\"pgratzvzbglbyvi\",\"type\":\"tctbrxkjzwrgxffm\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"description\":\"ctmgxuupbezqccy\",\"version\":\"tce\",\"company\":\"d\",\"uri\":\"ky\"},\"id\":\"ztgeqmgqzgwld\",\"name\":\"ychillcecfe\",\"type\":\"uwaoaguhicqlli\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.scriptPackages().list("ifmjnn", "wtqabpxuckp", com.azure.core.util.Context.NONE); + = manager.scriptPackages().list("cmslclblyjxltbs", "uscv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagesListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagesListTests.java deleted file mode 100644 index db5ccd6bd32d..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptPackagesListTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner; -import com.azure.resourcemanager.avs.models.ScriptPackagesList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScriptPackagesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptPackagesList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"description\":\"qkdltfz\",\"version\":\"hhvh\",\"company\":\"r\",\"uri\":\"dkwobdagx\"},\"id\":\"bqdxbx\",\"name\":\"akbogqxndlkzgxh\",\"type\":\"ripl\"}],\"nextLink\":\"odxun\"}") - .toObject(ScriptPackagesList.class); - Assertions.assertEquals("odxun", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptPackagesList model - = new ScriptPackagesList().withValue(Arrays.asList(new ScriptPackageInner())).withNextLink("odxun"); - model = BinaryData.fromObject(model).toObject(ScriptPackagesList.class); - Assertions.assertEquals("odxun", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptParameterTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptParameterTests.java deleted file mode 100644 index 08e056ab07d8..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptParameterTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.ScriptParameter; -import org.junit.jupiter.api.Assertions; - -public final class ScriptParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptParameter model = BinaryData.fromString( - "{\"type\":\"Bool\",\"name\":\"g\",\"description\":\"gvraeaen\",\"visibility\":\"Visible\",\"optional\":\"Optional\"}") - .toObject(ScriptParameter.class); - Assertions.assertEquals("g", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptParameter model = new ScriptParameter().withName("g"); - model = BinaryData.fromObject(model).toObject(ScriptParameter.class); - Assertions.assertEquals("g", model.name()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptSecureStringExecutionParameterTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptSecureStringExecutionParameterTests.java deleted file mode 100644 index 4b65f6a7881c..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptSecureStringExecutionParameterTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.ScriptSecureStringExecutionParameter; -import org.junit.jupiter.api.Assertions; - -public final class ScriptSecureStringExecutionParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptSecureStringExecutionParameter model - = BinaryData.fromString("{\"type\":\"SecureValue\",\"secureValue\":\"kq\",\"name\":\"bqgzslesjcbhern\"}") - .toObject(ScriptSecureStringExecutionParameter.class); - Assertions.assertEquals("bqgzslesjcbhern", model.name()); - Assertions.assertEquals("kq", model.secureValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptSecureStringExecutionParameter model - = new ScriptSecureStringExecutionParameter().withName("bqgzslesjcbhern").withSecureValue("kq"); - model = BinaryData.fromObject(model).toObject(ScriptSecureStringExecutionParameter.class); - Assertions.assertEquals("bqgzslesjcbhern", model.name()); - Assertions.assertEquals("kq", model.secureValue()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptStringExecutionParameterTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptStringExecutionParameterTests.java deleted file mode 100644 index e0aa3dd6f303..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/ScriptStringExecutionParameterTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.ScriptStringExecutionParameter; -import org.junit.jupiter.api.Assertions; - -public final class ScriptStringExecutionParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptStringExecutionParameter model - = BinaryData.fromString("{\"type\":\"Value\",\"value\":\"iew\",\"name\":\"jcvb\"}") - .toObject(ScriptStringExecutionParameter.class); - Assertions.assertEquals("jcvb", model.name()); - Assertions.assertEquals("iew", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptStringExecutionParameter model = new ScriptStringExecutionParameter().withName("jcvb").withValue("iew"); - model = BinaryData.fromObject(model).toObject(ScriptStringExecutionParameter.class); - Assertions.assertEquals("jcvb", model.name()); - Assertions.assertEquals("iew", model.value()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/SkuTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/SkuTests.java deleted file mode 100644 index 536a8abe5018..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/SkuTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.Sku; -import com.azure.resourcemanager.avs.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = BinaryData.fromString( - "{\"name\":\"czbysc\",\"tier\":\"Free\",\"size\":\"uhivyqniw\",\"family\":\"br\",\"capacity\":519347031}") - .toObject(Sku.class); - Assertions.assertEquals("czbysc", model.name()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - Assertions.assertEquals("uhivyqniw", model.size()); - Assertions.assertEquals("br", model.family()); - Assertions.assertEquals(519347031, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("czbysc") - .withTier(SkuTier.FREE) - .withSize("uhivyqniw") - .withFamily("br") - .withCapacity(519347031); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("czbysc", model.name()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - Assertions.assertEquals("uhivyqniw", model.size()); - Assertions.assertEquals("br", model.family()); - Assertions.assertEquals(519347031, model.capacity()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/TrialInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/TrialInnerTests.java deleted file mode 100644 index 3d9530316030..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/TrialInnerTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.TrialInner; - -public final class TrialInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrialInner model = BinaryData.fromString("{\"status\":\"TrialAvailable\",\"availableHosts\":920256064}") - .toObject(TrialInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrialInner model = new TrialInner(); - model = BinaryData.fromObject(model).toObject(TrialInner.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachineInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachineInnerTests.java deleted file mode 100644 index 2508dde3170b..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachineInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.VirtualMachineInner; - -public final class VirtualMachineInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"lxotogtwrupq\",\"moRefId\":\"vnm\",\"folderPath\":\"ykvceoveil\",\"restrictMovement\":\"Disabled\"},\"id\":\"tyfjfcnjbkcnxdhb\",\"name\":\"tkphywpnvjtoqn\",\"type\":\"rmclfplphoxu\"}") - .toObject(VirtualMachineInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineInner model = new VirtualMachineInner(); - model = BinaryData.fromObject(model).toObject(VirtualMachineInner.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinePropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinePropertiesTests.java deleted file mode 100644 index 816a8d121b98..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinePropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.VirtualMachineProperties; - -public final class VirtualMachinePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Canceled\",\"displayName\":\"abgy\",\"moRefId\":\"sbj\",\"folderPath\":\"zq\",\"restrictMovement\":\"Disabled\"}") - .toObject(VirtualMachineProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineProperties model = new VirtualMachineProperties(); - model = BinaryData.fromObject(model).toObject(VirtualMachineProperties.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachineRestrictMovementTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachineRestrictMovementTests.java deleted file mode 100644 index 064ea77aaede..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachineRestrictMovementTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.VirtualMachineRestrictMovement; -import com.azure.resourcemanager.avs.models.VirtualMachineRestrictMovementState; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineRestrictMovementTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineRestrictMovement model = BinaryData.fromString("{\"restrictMovement\":\"Enabled\"}") - .toObject(VirtualMachineRestrictMovement.class); - Assertions.assertEquals(VirtualMachineRestrictMovementState.ENABLED, model.restrictMovement()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineRestrictMovement model - = new VirtualMachineRestrictMovement().withRestrictMovement(VirtualMachineRestrictMovementState.ENABLED); - model = BinaryData.fromObject(model).toObject(VirtualMachineRestrictMovement.class); - Assertions.assertEquals(VirtualMachineRestrictMovementState.ENABLED, model.restrictMovement()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinesGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinesGetWithResponseMockTests.java index a13cf26c3d0e..3743f52474b6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinesGetWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.VirtualMachine; @@ -20,17 +20,17 @@ public final class VirtualMachinesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"ljeamu\",\"moRefId\":\"zmlovuanash\",\"folderPath\":\"lpmjerb\",\"restrictMovement\":\"Disabled\"},\"id\":\"vidizozsdb\",\"name\":\"cxjmonfdgnwncyp\",\"type\":\"uwwltvuqjctz\"}"; + = "{\"properties\":{\"provisioningState\":\"Canceled\",\"displayName\":\"antuygdhgaqipirp\",\"moRefId\":\"rqofulopmjnlexwh\",\"folderPath\":\"jpib\",\"restrictMovement\":\"Disabled\"},\"id\":\"uuuercta\",\"name\":\"oyin\",\"type\":\"qpbrlc\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); VirtualMachine response = manager.virtualMachines() - .getWithResponse("gnl", "zonzlrpiqywnc", "jtszcof", "zehtdhgb", com.azure.core.util.Context.NONE) + .getWithResponse("apucygvo", "vyuns", "xlghieegj", "gvvpasek", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinesListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinesListMockTests.java index 5b8016283b78..d7d3be81fcba 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinesListMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.VirtualMachine; @@ -21,17 +21,17 @@ public final class VirtualMachinesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"displayName\":\"qlsismjqfrddg\",\"moRefId\":\"quhiosrsjuivf\",\"folderPath\":\"is\",\"restrictMovement\":\"Enabled\"},\"id\":\"xzhczexrxz\",\"name\":\"ujrtrhqvwr\",\"type\":\"vk\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"sunwqrjzfrgqhaoh\",\"moRefId\":\"buocnjr\",\"folderPath\":\"mbpyryxamebly\",\"restrictMovement\":\"Enabled\"},\"id\":\"fkmroc\",\"name\":\"nehvsmt\",\"type\":\"dlfp\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.virtualMachines() - .list("ybpmzznrtffyaq", "tmhheioqa", "hvseufuqyrx", com.azure.core.util.Context.NONE); + .list("vgbgatzuuvbxng", "ebwgga", "ttzlswvajqfutlx", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinesListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinesListTests.java deleted file mode 100644 index 3131db239c98..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VirtualMachinesListTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.avs.models.VirtualMachinesList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachinesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachinesList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"displayName\":\"sucocmnyyazttbtw\",\"moRefId\":\"qpuedckzywbiex\",\"folderPath\":\"eyueaxibxujwb\",\"restrictMovement\":\"Enabled\"},\"id\":\"lmuzy\",\"name\":\"xaepdkzjancuxr\",\"type\":\"d\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"bniwdj\",\"moRefId\":\"zt\",\"folderPath\":\"bpg\",\"restrictMovement\":\"Enabled\"},\"id\":\"x\",\"name\":\"pzxbz\",\"type\":\"fzab\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"xwtctyqiklbbovpl\",\"moRefId\":\"bhvgy\",\"folderPath\":\"uosvmkfssxqukk\",\"restrictMovement\":\"Enabled\"},\"id\":\"mg\",\"name\":\"xnkjzkdesl\",\"type\":\"vlopwiyighx\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"displayName\":\"baiuebbaumny\",\"moRefId\":\"ped\",\"folderPath\":\"jn\",\"restrictMovement\":\"Disabled\"},\"id\":\"hsmtxpsiebtfhvp\",\"name\":\"sapskr\",\"type\":\"qmhjjdhtld\"}],\"nextLink\":\"yzxuutkncw\"}") - .toObject(VirtualMachinesList.class); - Assertions.assertEquals("yzxuutkncw", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachinesList model - = new VirtualMachinesList() - .withValue(Arrays.asList(new VirtualMachineInner(), new VirtualMachineInner(), - new VirtualMachineInner(), new VirtualMachineInner())) - .withNextLink("yzxuutkncw"); - model = BinaryData.fromObject(model).toObject(VirtualMachinesList.class); - Assertions.assertEquals("yzxuutkncw", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VmHostPlacementPolicyPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VmHostPlacementPolicyPropertiesTests.java deleted file mode 100644 index 21b83a458f32..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VmHostPlacementPolicyPropertiesTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.AffinityStrength; -import com.azure.resourcemanager.avs.models.AffinityType; -import com.azure.resourcemanager.avs.models.AzureHybridBenefitType; -import com.azure.resourcemanager.avs.models.PlacementPolicyState; -import com.azure.resourcemanager.avs.models.VmHostPlacementPolicyProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VmHostPlacementPolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VmHostPlacementPolicyProperties model = BinaryData.fromString( - "{\"type\":\"VmHost\",\"vmMembers\":[\"wr\",\"ehwagoh\",\"uffkmrqemvvh\"],\"hostMembers\":[\"tdrjfutacoebj\"],\"affinityType\":\"AntiAffinity\",\"affinityStrength\":\"Must\",\"azureHybridBenefitType\":\"None\",\"state\":\"Enabled\",\"displayName\":\"wcpmguaadraufac\",\"provisioningState\":\"Succeeded\"}") - .toObject(VmHostPlacementPolicyProperties.class); - Assertions.assertEquals(PlacementPolicyState.ENABLED, model.state()); - Assertions.assertEquals("wcpmguaadraufac", model.displayName()); - Assertions.assertEquals("wr", model.vmMembers().get(0)); - Assertions.assertEquals("tdrjfutacoebj", model.hostMembers().get(0)); - Assertions.assertEquals(AffinityType.ANTI_AFFINITY, model.affinityType()); - Assertions.assertEquals(AffinityStrength.MUST, model.affinityStrength()); - Assertions.assertEquals(AzureHybridBenefitType.NONE, model.azureHybridBenefitType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VmHostPlacementPolicyProperties model - = new VmHostPlacementPolicyProperties().withState(PlacementPolicyState.ENABLED) - .withDisplayName("wcpmguaadraufac") - .withVmMembers(Arrays.asList("wr", "ehwagoh", "uffkmrqemvvh")) - .withHostMembers(Arrays.asList("tdrjfutacoebj")) - .withAffinityType(AffinityType.ANTI_AFFINITY) - .withAffinityStrength(AffinityStrength.MUST) - .withAzureHybridBenefitType(AzureHybridBenefitType.NONE); - model = BinaryData.fromObject(model).toObject(VmHostPlacementPolicyProperties.class); - Assertions.assertEquals(PlacementPolicyState.ENABLED, model.state()); - Assertions.assertEquals("wcpmguaadraufac", model.displayName()); - Assertions.assertEquals("wr", model.vmMembers().get(0)); - Assertions.assertEquals("tdrjfutacoebj", model.hostMembers().get(0)); - Assertions.assertEquals(AffinityType.ANTI_AFFINITY, model.affinityType()); - Assertions.assertEquals(AffinityStrength.MUST, model.affinityStrength()); - Assertions.assertEquals(AzureHybridBenefitType.NONE, model.azureHybridBenefitType()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VmPlacementPolicyPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VmPlacementPolicyPropertiesTests.java deleted file mode 100644 index fb669c60c547..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/VmPlacementPolicyPropertiesTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.AffinityType; -import com.azure.resourcemanager.avs.models.PlacementPolicyState; -import com.azure.resourcemanager.avs.models.VmPlacementPolicyProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VmPlacementPolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VmPlacementPolicyProperties model = BinaryData.fromString( - "{\"type\":\"VmVm\",\"vmMembers\":[\"zov\",\"jjziuxxpsh\"],\"affinityType\":\"AntiAffinity\",\"state\":\"Enabled\",\"displayName\":\"lfg\",\"provisioningState\":\"Failed\"}") - .toObject(VmPlacementPolicyProperties.class); - Assertions.assertEquals(PlacementPolicyState.ENABLED, model.state()); - Assertions.assertEquals("lfg", model.displayName()); - Assertions.assertEquals("zov", model.vmMembers().get(0)); - Assertions.assertEquals(AffinityType.ANTI_AFFINITY, model.affinityType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VmPlacementPolicyProperties model = new VmPlacementPolicyProperties().withState(PlacementPolicyState.ENABLED) - .withDisplayName("lfg") - .withVmMembers(Arrays.asList("zov", "jjziuxxpsh")) - .withAffinityType(AffinityType.ANTI_AFFINITY); - model = BinaryData.fromObject(model).toObject(VmPlacementPolicyProperties.class); - Assertions.assertEquals(PlacementPolicyState.ENABLED, model.state()); - Assertions.assertEquals("lfg", model.displayName()); - Assertions.assertEquals("zov", model.vmMembers().get(0)); - Assertions.assertEquals(AffinityType.ANTI_AFFINITY, model.affinityType()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpEntityTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpEntityTests.java deleted file mode 100644 index 1b3a538acecb..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpEntityTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpEntity; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkDhcpEntityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkDhcpEntity model = BinaryData.fromString( - "{\"dhcpType\":\"WorkloadNetworkDhcpEntity\",\"displayName\":\"beddgssofw\",\"segments\":[\"qal\",\"rmnjijpx\",\"cqqudf\",\"byxbaaabjy\"],\"provisioningState\":\"Canceled\",\"revision\":6883789734469105291}") - .toObject(WorkloadNetworkDhcpEntity.class); - Assertions.assertEquals("beddgssofw", model.displayName()); - Assertions.assertEquals(6883789734469105291L, model.revision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkDhcpEntity model - = new WorkloadNetworkDhcpEntity().withDisplayName("beddgssofw").withRevision(6883789734469105291L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkDhcpEntity.class); - Assertions.assertEquals("beddgssofw", model.displayName()); - Assertions.assertEquals(6883789734469105291L, model.revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpInnerTests.java deleted file mode 100644 index 09ef2eba5da7..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpEntity; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkDhcpInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkDhcpInner model = BinaryData.fromString( - "{\"properties\":{\"dhcpType\":\"WorkloadNetworkDhcpEntity\",\"displayName\":\"t\",\"segments\":[\"lr\",\"cyjmoadsuvarmy\",\"dmjsjqb\"],\"provisioningState\":\"Building\",\"revision\":1070182178135164646},\"id\":\"wlycoduhpkxkg\",\"name\":\"mareqnajxqugj\",\"type\":\"ky\"}") - .toObject(WorkloadNetworkDhcpInner.class); - Assertions.assertEquals("t", model.properties().displayName()); - Assertions.assertEquals(1070182178135164646L, model.properties().revision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkDhcpInner model = new WorkloadNetworkDhcpInner() - .withProperties(new WorkloadNetworkDhcpEntity().withDisplayName("t").withRevision(1070182178135164646L)); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkDhcpInner.class); - Assertions.assertEquals("t", model.properties().displayName()); - Assertions.assertEquals(1070182178135164646L, model.properties().revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpListTests.java deleted file mode 100644 index 1af73a3b4b0e..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpListTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpEntity; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkDhcpListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkDhcpList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"dhcpType\":\"WorkloadNetworkDhcpEntity\",\"displayName\":\"xdy\",\"segments\":[\"y\",\"cogjltdtbn\",\"hadoocrk\",\"cikhnv\"],\"provisioningState\":\"Succeeded\",\"revision\":1095041786802242377},\"id\":\"queziky\",\"name\":\"ggxkallatmelwuip\",\"type\":\"ccjzkzivgvv\"},{\"properties\":{\"dhcpType\":\"WorkloadNetworkDhcpEntity\",\"displayName\":\"y\",\"segments\":[\"rnxxmueed\",\"drd\",\"stkwqqtch\"],\"provisioningState\":\"Canceled\",\"revision\":6465025791585269802},\"id\":\"d\",\"name\":\"aygdvwvgpioh\",\"type\":\"wxrt\"},{\"properties\":{\"dhcpType\":\"WorkloadNetworkDhcpEntity\",\"displayName\":\"xepxgyqagvrvmn\",\"segments\":[\"kghimdblxgwimfnj\",\"fjxwmsz\",\"kfoqreyfkzikfj\"],\"provisioningState\":\"Succeeded\",\"revision\":488040231209258224},\"id\":\"xwczelpcire\",\"name\":\"sfeaenwabfat\",\"type\":\"lddxbjhwua\"},{\"properties\":{\"dhcpType\":\"WorkloadNetworkDhcpEntity\",\"displayName\":\"zjosp\",\"segments\":[\"ulpjr\",\"xagl\"],\"provisioningState\":\"Updating\",\"revision\":7892134745945256266},\"id\":\"sytxitcskfcktqum\",\"name\":\"ekkezzikhlyfjh\",\"type\":\"gqggebdunygae\"}],\"nextLink\":\"db\"}") - .toObject(WorkloadNetworkDhcpList.class); - Assertions.assertEquals("xdy", model.value().get(0).properties().displayName()); - Assertions.assertEquals(1095041786802242377L, model.value().get(0).properties().revision()); - Assertions.assertEquals("db", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkDhcpList model = new WorkloadNetworkDhcpList().withValue(Arrays.asList( - new WorkloadNetworkDhcpInner().withProperties( - new WorkloadNetworkDhcpEntity().withDisplayName("xdy").withRevision(1095041786802242377L)), - new WorkloadNetworkDhcpInner().withProperties( - new WorkloadNetworkDhcpEntity().withDisplayName("y").withRevision(6465025791585269802L)), - new WorkloadNetworkDhcpInner().withProperties( - new WorkloadNetworkDhcpEntity().withDisplayName("xepxgyqagvrvmn").withRevision(488040231209258224L)), - new WorkloadNetworkDhcpInner().withProperties( - new WorkloadNetworkDhcpEntity().withDisplayName("zjosp").withRevision(7892134745945256266L)))) - .withNextLink("db"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkDhcpList.class); - Assertions.assertEquals("xdy", model.value().get(0).properties().displayName()); - Assertions.assertEquals(1095041786802242377L, model.value().get(0).properties().revision()); - Assertions.assertEquals("db", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpRelayTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpRelayTests.java deleted file mode 100644 index 6be232352d03..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpRelayTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpRelay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkDhcpRelayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkDhcpRelay model = BinaryData.fromString( - "{\"dhcpType\":\"RELAY\",\"serverAddresses\":[\"kwdlenrdsutujba\",\"pjuohminyfl\",\"orwmduvwpklv\"],\"displayName\":\"mygdxpgpqch\",\"segments\":[\"epn\"],\"provisioningState\":\"Updating\",\"revision\":7502230535508252511}") - .toObject(WorkloadNetworkDhcpRelay.class); - Assertions.assertEquals("mygdxpgpqch", model.displayName()); - Assertions.assertEquals(7502230535508252511L, model.revision()); - Assertions.assertEquals("kwdlenrdsutujba", model.serverAddresses().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkDhcpRelay model = new WorkloadNetworkDhcpRelay().withDisplayName("mygdxpgpqch") - .withRevision(7502230535508252511L) - .withServerAddresses(Arrays.asList("kwdlenrdsutujba", "pjuohminyfl", "orwmduvwpklv")); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkDhcpRelay.class); - Assertions.assertEquals("mygdxpgpqch", model.displayName()); - Assertions.assertEquals(7502230535508252511L, model.revision()); - Assertions.assertEquals("kwdlenrdsutujba", model.serverAddresses().get(0)); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpServerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpServerTests.java deleted file mode 100644 index 5ce2ec6fd127..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDhcpServerTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpServer; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkDhcpServerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkDhcpServer model = BinaryData.fromString( - "{\"dhcpType\":\"SERVER\",\"serverAddress\":\"ibbdaxconfoza\",\"leaseTime\":3754579921352518306,\"displayName\":\"kokwbqplhlvnu\",\"segments\":[\"zlrphwzs\",\"l\"],\"provisioningState\":\"Canceled\",\"revision\":6472514649626093953}") - .toObject(WorkloadNetworkDhcpServer.class); - Assertions.assertEquals("kokwbqplhlvnu", model.displayName()); - Assertions.assertEquals(6472514649626093953L, model.revision()); - Assertions.assertEquals("ibbdaxconfoza", model.serverAddress()); - Assertions.assertEquals(3754579921352518306L, model.leaseTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkDhcpServer model = new WorkloadNetworkDhcpServer().withDisplayName("kokwbqplhlvnu") - .withRevision(6472514649626093953L) - .withServerAddress("ibbdaxconfoza") - .withLeaseTime(3754579921352518306L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkDhcpServer.class); - Assertions.assertEquals("kokwbqplhlvnu", model.displayName()); - Assertions.assertEquals(6472514649626093953L, model.revision()); - Assertions.assertEquals("ibbdaxconfoza", model.serverAddress()); - Assertions.assertEquals(3754579921352518306L, model.leaseTime()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsServiceInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsServiceInnerTests.java deleted file mode 100644 index e7b00b498d51..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsServiceInnerTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; -import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkDnsServiceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkDnsServiceInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"odko\",\"dnsServiceIp\":\"bw\",\"defaultDnsZone\":\"jhemms\",\"fqdnZones\":[\"kcrodtjinfw\",\"lfltka\"],\"logLevel\":\"FATAL\",\"status\":\"SUCCESS\",\"provisioningState\":\"Canceled\",\"revision\":6193547240906523394},\"id\":\"kggkfpa\",\"name\":\"ao\",\"type\":\"pulpqblylsyxk\"}") - .toObject(WorkloadNetworkDnsServiceInner.class); - Assertions.assertEquals("odko", model.displayName()); - Assertions.assertEquals("bw", model.dnsServiceIp()); - Assertions.assertEquals("jhemms", model.defaultDnsZone()); - Assertions.assertEquals("kcrodtjinfw", model.fqdnZones().get(0)); - Assertions.assertEquals(DnsServiceLogLevelEnum.FATAL, model.logLevel()); - Assertions.assertEquals(6193547240906523394L, model.revision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkDnsServiceInner model = new WorkloadNetworkDnsServiceInner().withDisplayName("odko") - .withDnsServiceIp("bw") - .withDefaultDnsZone("jhemms") - .withFqdnZones(Arrays.asList("kcrodtjinfw", "lfltka")) - .withLogLevel(DnsServiceLogLevelEnum.FATAL) - .withRevision(6193547240906523394L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkDnsServiceInner.class); - Assertions.assertEquals("odko", model.displayName()); - Assertions.assertEquals("bw", model.dnsServiceIp()); - Assertions.assertEquals("jhemms", model.defaultDnsZone()); - Assertions.assertEquals("kcrodtjinfw", model.fqdnZones().get(0)); - Assertions.assertEquals(DnsServiceLogLevelEnum.FATAL, model.logLevel()); - Assertions.assertEquals(6193547240906523394L, model.revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsServicePropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsServicePropertiesTests.java deleted file mode 100644 index 5f19649acdb0..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsServicePropertiesTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceProperties; -import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkDnsServicePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkDnsServiceProperties model = BinaryData.fromString( - "{\"displayName\":\"nsj\",\"dnsServiceIp\":\"vti\",\"defaultDnsZone\":\"xsdszuempsb\",\"fqdnZones\":[\"z\"],\"logLevel\":\"INFO\",\"status\":\"SUCCESS\",\"provisioningState\":\"Building\",\"revision\":8978245391305162368}") - .toObject(WorkloadNetworkDnsServiceProperties.class); - Assertions.assertEquals("nsj", model.displayName()); - Assertions.assertEquals("vti", model.dnsServiceIp()); - Assertions.assertEquals("xsdszuempsb", model.defaultDnsZone()); - Assertions.assertEquals("z", model.fqdnZones().get(0)); - Assertions.assertEquals(DnsServiceLogLevelEnum.INFO, model.logLevel()); - Assertions.assertEquals(8978245391305162368L, model.revision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkDnsServiceProperties model = new WorkloadNetworkDnsServiceProperties().withDisplayName("nsj") - .withDnsServiceIp("vti") - .withDefaultDnsZone("xsdszuempsb") - .withFqdnZones(Arrays.asList("z")) - .withLogLevel(DnsServiceLogLevelEnum.INFO) - .withRevision(8978245391305162368L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkDnsServiceProperties.class); - Assertions.assertEquals("nsj", model.displayName()); - Assertions.assertEquals("vti", model.dnsServiceIp()); - Assertions.assertEquals("xsdszuempsb", model.defaultDnsZone()); - Assertions.assertEquals("z", model.fqdnZones().get(0)); - Assertions.assertEquals(DnsServiceLogLevelEnum.INFO, model.logLevel()); - Assertions.assertEquals(8978245391305162368L, model.revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsServicesListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsServicesListTests.java deleted file mode 100644 index e6ee3fd49450..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsServicesListTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; -import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServicesList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkDnsServicesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkDnsServicesList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"rtuzqogs\",\"dnsServiceIp\":\"nevfdnw\",\"defaultDnsZone\":\"mewzsyyc\",\"fqdnZones\":[\"soibjudpfrx\",\"rthzvaytdwkqbrqu\",\"paxh\",\"xiilivpdtiirqt\"],\"logLevel\":\"ERROR\",\"status\":\"FAILURE\",\"provisioningState\":\"Canceled\",\"revision\":3650504881751090055},\"id\":\"squyfxrxxlep\",\"name\":\"ramxjezwlwnw\",\"type\":\"uqlcvydy\"}],\"nextLink\":\"tdooaoj\"}") - .toObject(WorkloadNetworkDnsServicesList.class); - Assertions.assertEquals("rtuzqogs", model.value().get(0).displayName()); - Assertions.assertEquals("nevfdnw", model.value().get(0).dnsServiceIp()); - Assertions.assertEquals("mewzsyyc", model.value().get(0).defaultDnsZone()); - Assertions.assertEquals("soibjudpfrx", model.value().get(0).fqdnZones().get(0)); - Assertions.assertEquals(DnsServiceLogLevelEnum.ERROR, model.value().get(0).logLevel()); - Assertions.assertEquals(3650504881751090055L, model.value().get(0).revision()); - Assertions.assertEquals("tdooaoj", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkDnsServicesList model = new WorkloadNetworkDnsServicesList() - .withValue(Arrays.asList(new WorkloadNetworkDnsServiceInner().withDisplayName("rtuzqogs") - .withDnsServiceIp("nevfdnw") - .withDefaultDnsZone("mewzsyyc") - .withFqdnZones(Arrays.asList("soibjudpfrx", "rthzvaytdwkqbrqu", "paxh", "xiilivpdtiirqt")) - .withLogLevel(DnsServiceLogLevelEnum.ERROR) - .withRevision(3650504881751090055L))) - .withNextLink("tdooaoj"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkDnsServicesList.class); - Assertions.assertEquals("rtuzqogs", model.value().get(0).displayName()); - Assertions.assertEquals("nevfdnw", model.value().get(0).dnsServiceIp()); - Assertions.assertEquals("mewzsyyc", model.value().get(0).defaultDnsZone()); - Assertions.assertEquals("soibjudpfrx", model.value().get(0).fqdnZones().get(0)); - Assertions.assertEquals(DnsServiceLogLevelEnum.ERROR, model.value().get(0).logLevel()); - Assertions.assertEquals(3650504881751090055L, model.value().get(0).revision()); - Assertions.assertEquals("tdooaoj", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsZoneInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsZoneInnerTests.java deleted file mode 100644 index fc0a0428f299..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsZoneInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkDnsZoneInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkDnsZoneInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"whccs\",\"domain\":[\"aivwitqscywu\",\"gwol\"],\"dnsServerIps\":[\"zbwemh\",\"i\",\"sbrgz\",\"wmsweypqwd\"],\"sourceIp\":\"gicccnxqhuex\",\"dnsServices\":5852678166783434118,\"provisioningState\":\"Building\",\"revision\":3065309169479098927},\"id\":\"ywemhzrn\",\"name\":\"sdtclusiypbs\",\"type\":\"gytguslfead\"}") - .toObject(WorkloadNetworkDnsZoneInner.class); - Assertions.assertEquals("whccs", model.displayName()); - Assertions.assertEquals("aivwitqscywu", model.domain().get(0)); - Assertions.assertEquals("zbwemh", model.dnsServerIps().get(0)); - Assertions.assertEquals("gicccnxqhuex", model.sourceIp()); - Assertions.assertEquals(5852678166783434118L, model.dnsServices()); - Assertions.assertEquals(3065309169479098927L, model.revision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkDnsZoneInner model = new WorkloadNetworkDnsZoneInner().withDisplayName("whccs") - .withDomain(Arrays.asList("aivwitqscywu", "gwol")) - .withDnsServerIps(Arrays.asList("zbwemh", "i", "sbrgz", "wmsweypqwd")) - .withSourceIp("gicccnxqhuex") - .withDnsServices(5852678166783434118L) - .withRevision(3065309169479098927L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkDnsZoneInner.class); - Assertions.assertEquals("whccs", model.displayName()); - Assertions.assertEquals("aivwitqscywu", model.domain().get(0)); - Assertions.assertEquals("zbwemh", model.dnsServerIps().get(0)); - Assertions.assertEquals("gicccnxqhuex", model.sourceIp()); - Assertions.assertEquals(5852678166783434118L, model.dnsServices()); - Assertions.assertEquals(3065309169479098927L, model.revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsZonePropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsZonePropertiesTests.java deleted file mode 100644 index 639bf2e4eaab..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsZonePropertiesTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkDnsZonePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkDnsZoneProperties model = BinaryData.fromString( - "{\"displayName\":\"gq\",\"domain\":[\"hejhzisx\",\"fpel\",\"lppvksrpq\"],\"dnsServerIps\":[\"zraehtwd\",\"r\",\"tswiby\"],\"sourceIp\":\"dl\",\"dnsServices\":6608655504184346105,\"provisioningState\":\"Updating\",\"revision\":397353475814237502}") - .toObject(WorkloadNetworkDnsZoneProperties.class); - Assertions.assertEquals("gq", model.displayName()); - Assertions.assertEquals("hejhzisx", model.domain().get(0)); - Assertions.assertEquals("zraehtwd", model.dnsServerIps().get(0)); - Assertions.assertEquals("dl", model.sourceIp()); - Assertions.assertEquals(6608655504184346105L, model.dnsServices()); - Assertions.assertEquals(397353475814237502L, model.revision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkDnsZoneProperties model = new WorkloadNetworkDnsZoneProperties().withDisplayName("gq") - .withDomain(Arrays.asList("hejhzisx", "fpel", "lppvksrpq")) - .withDnsServerIps(Arrays.asList("zraehtwd", "r", "tswiby")) - .withSourceIp("dl") - .withDnsServices(6608655504184346105L) - .withRevision(397353475814237502L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkDnsZoneProperties.class); - Assertions.assertEquals("gq", model.displayName()); - Assertions.assertEquals("hejhzisx", model.domain().get(0)); - Assertions.assertEquals("zraehtwd", model.dnsServerIps().get(0)); - Assertions.assertEquals("dl", model.sourceIp()); - Assertions.assertEquals(6608655504184346105L, model.dnsServices()); - Assertions.assertEquals(397353475814237502L, model.revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsZonesListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsZonesListTests.java deleted file mode 100644 index fec8471f7271..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkDnsZonesListTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZonesList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkDnsZonesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkDnsZonesList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"kjj\",\"domain\":[\"rbuukzclewyhmlwp\",\"ztzp\",\"fn\"],\"dnsServerIps\":[\"wyfzqwhxxbuyqa\",\"zfeqztppri\",\"lxorjaltolmncws\",\"bqwcsdbnwdcf\"],\"sourceIp\":\"cqdpfuv\",\"dnsServices\":4684256943455156597,\"provisioningState\":\"Updating\",\"revision\":4256204448914480797},\"id\":\"xbvtvudu\",\"name\":\"ncormrlxqtvcof\",\"type\":\"dflvkg\"},{\"properties\":{\"displayName\":\"gdknnqv\",\"domain\":[\"nqntorudsgsahm\",\"yc\"],\"dnsServerIps\":[\"uwjuetaeburuvdmo\",\"s\",\"zlxwabmqoefkifr\"],\"sourceIp\":\"puqujmqlgkfbtn\",\"dnsServices\":6879764245530477433,\"provisioningState\":\"Failed\",\"revision\":6198658030660554635},\"id\":\"tujitcjedft\",\"name\":\"waezkojvd\",\"type\":\"pzfoqoui\"},{\"properties\":{\"displayName\":\"xarzgszufoxciq\",\"domain\":[\"doamciodhkha\",\"xkhnzbonlwnto\",\"gokdwbwhks\",\"zcmrvexztvb\"],\"dnsServerIps\":[\"sfraoyzko\",\"wtl\",\"nguxawqaldsy\"],\"sourceIp\":\"ximerqfobwyznk\",\"dnsServices\":5942973397791682441,\"provisioningState\":\"Updating\",\"revision\":6293103125482065030},\"id\":\"a\",\"name\":\"m\",\"type\":\"r\"},{\"properties\":{\"displayName\":\"snfdsdoakgtdl\",\"domain\":[\"zev\",\"l\",\"ewpusdsttwvogvb\",\"ejdcngqqmoakuf\"],\"dnsServerIps\":[\"zr\",\"rdgrtw\",\"enuuzkopbm\"],\"sourceIp\":\"rfdwoyu\",\"dnsServices\":4568735292262817818,\"provisioningState\":\"Canceled\",\"revision\":8625951963291223470},\"id\":\"bhdmsmlmzqhof\",\"name\":\"rmaequ\",\"type\":\"ah\"}],\"nextLink\":\"cslfaoqzpiyylha\"}") - .toObject(WorkloadNetworkDnsZonesList.class); - Assertions.assertEquals("kjj", model.value().get(0).displayName()); - Assertions.assertEquals("rbuukzclewyhmlwp", model.value().get(0).domain().get(0)); - Assertions.assertEquals("wyfzqwhxxbuyqa", model.value().get(0).dnsServerIps().get(0)); - Assertions.assertEquals("cqdpfuv", model.value().get(0).sourceIp()); - Assertions.assertEquals(4684256943455156597L, model.value().get(0).dnsServices()); - Assertions.assertEquals(4256204448914480797L, model.value().get(0).revision()); - Assertions.assertEquals("cslfaoqzpiyylha", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkDnsZonesList model - = new WorkloadNetworkDnsZonesList() - .withValue(Arrays.asList( - new WorkloadNetworkDnsZoneInner().withDisplayName("kjj") - .withDomain(Arrays.asList("rbuukzclewyhmlwp", "ztzp", "fn")) - .withDnsServerIps( - Arrays.asList("wyfzqwhxxbuyqa", "zfeqztppri", "lxorjaltolmncws", "bqwcsdbnwdcf")) - .withSourceIp("cqdpfuv") - .withDnsServices(4684256943455156597L) - .withRevision(4256204448914480797L), - new WorkloadNetworkDnsZoneInner().withDisplayName("gdknnqv") - .withDomain(Arrays.asList("nqntorudsgsahm", "yc")) - .withDnsServerIps(Arrays.asList("uwjuetaeburuvdmo", "s", "zlxwabmqoefkifr")) - .withSourceIp("puqujmqlgkfbtn") - .withDnsServices(6879764245530477433L) - .withRevision(6198658030660554635L), - new WorkloadNetworkDnsZoneInner().withDisplayName("xarzgszufoxciq") - .withDomain(Arrays.asList("doamciodhkha", "xkhnzbonlwnto", "gokdwbwhks", "zcmrvexztvb")) - .withDnsServerIps(Arrays.asList("sfraoyzko", "wtl", "nguxawqaldsy")) - .withSourceIp("ximerqfobwyznk") - .withDnsServices(5942973397791682441L) - .withRevision(6293103125482065030L), - new WorkloadNetworkDnsZoneInner().withDisplayName("snfdsdoakgtdl") - .withDomain(Arrays.asList("zev", "l", "ewpusdsttwvogvb", "ejdcngqqmoakuf")) - .withDnsServerIps(Arrays.asList("zr", "rdgrtw", "enuuzkopbm")) - .withSourceIp("rfdwoyu") - .withDnsServices(4568735292262817818L) - .withRevision(8625951963291223470L))) - .withNextLink("cslfaoqzpiyylha"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkDnsZonesList.class); - Assertions.assertEquals("kjj", model.value().get(0).displayName()); - Assertions.assertEquals("rbuukzclewyhmlwp", model.value().get(0).domain().get(0)); - Assertions.assertEquals("wyfzqwhxxbuyqa", model.value().get(0).dnsServerIps().get(0)); - Assertions.assertEquals("cqdpfuv", model.value().get(0).sourceIp()); - Assertions.assertEquals(4684256943455156597L, model.value().get(0).dnsServices()); - Assertions.assertEquals(4256204448914480797L, model.value().get(0).revision()); - Assertions.assertEquals("cslfaoqzpiyylha", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkGatewayInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkGatewayInnerTests.java deleted file mode 100644 index bd97ad598c46..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkGatewayInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkGatewayInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkGatewayInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"displayName\":\"fajpjorwk\",\"path\":\"yhgbijtjivfx\"},\"id\":\"jabibsystawf\",\"name\":\"djpvkvpbjxbkz\",\"type\":\"zkdvncja\"}") - .toObject(WorkloadNetworkGatewayInner.class); - Assertions.assertEquals("fajpjorwk", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkGatewayInner model = new WorkloadNetworkGatewayInner().withDisplayName("fajpjorwk"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkGatewayInner.class); - Assertions.assertEquals("fajpjorwk", model.displayName()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkGatewayListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkGatewayListTests.java deleted file mode 100644 index 8a774492d728..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkGatewayListTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; -import com.azure.resourcemanager.avs.models.WorkloadNetworkGatewayList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkGatewayListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkGatewayList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Building\",\"displayName\":\"ty\",\"path\":\"evxccedcp\"},\"id\":\"dyodnwzxltj\",\"name\":\"vnhltiugcx\",\"type\":\"avvwxqi\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"displayName\":\"y\",\"path\":\"xwlmdjr\"},\"id\":\"fgbvfvpdbo\",\"name\":\"acizsjqlhkrr\",\"type\":\"bdeibqipqk\"}],\"nextLink\":\"vxndz\"}") - .toObject(WorkloadNetworkGatewayList.class); - Assertions.assertEquals("ty", model.value().get(0).displayName()); - Assertions.assertEquals("vxndz", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkGatewayList model = new WorkloadNetworkGatewayList() - .withValue(Arrays.asList(new WorkloadNetworkGatewayInner().withDisplayName("ty"), - new WorkloadNetworkGatewayInner().withDisplayName("y"))) - .withNextLink("vxndz"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkGatewayList.class); - Assertions.assertEquals("ty", model.value().get(0).displayName()); - Assertions.assertEquals("vxndz", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkGatewayPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkGatewayPropertiesTests.java deleted file mode 100644 index 2f310cda9b74..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkGatewayPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayProperties; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkGatewayPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkGatewayProperties model = BinaryData - .fromString("{\"provisioningState\":\"Deleting\",\"displayName\":\"r\",\"path\":\"akmokzhjjklf\"}") - .toObject(WorkloadNetworkGatewayProperties.class); - Assertions.assertEquals("r", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkGatewayProperties model = new WorkloadNetworkGatewayProperties().withDisplayName("r"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkGatewayProperties.class); - Assertions.assertEquals("r", model.displayName()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkInnerTests.java deleted file mode 100644 index e63c38744bda..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkInner; - -public final class WorkloadNetworkInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Building\"},\"id\":\"mnzgmwznmabi\",\"name\":\"nsorgjhxbldt\",\"type\":\"wwrlkdmtncv\"}") - .toObject(WorkloadNetworkInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkInner model = new WorkloadNetworkInner(); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkInner.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkListTests.java deleted file mode 100644 index 3d8cbcacbefd..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkListTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkInner; -import com.azure.resourcemanager.avs.models.WorkloadNetworkList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"uu\",\"name\":\"jfqka\",\"type\":\"e\"},{\"properties\":{\"provisioningState\":\"Deleting\"},\"id\":\"pubjibw\",\"name\":\"iftohqkvpu\",\"type\":\"ksgplsa\"},{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"synljphuopxodl\",\"name\":\"iyntorzihle\",\"type\":\"sjswsrms\"},{\"properties\":{\"provisioningState\":\"Updating\"},\"id\":\"zbchckqqzqioxiy\",\"name\":\"uiizynke\",\"type\":\"yatrwy\"}],\"nextLink\":\"mibzyhwitsmypyyn\"}") - .toObject(WorkloadNetworkList.class); - Assertions.assertEquals("mibzyhwitsmypyyn", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkList model - = new WorkloadNetworkList() - .withValue(Arrays.asList(new WorkloadNetworkInner(), new WorkloadNetworkInner(), - new WorkloadNetworkInner(), new WorkloadNetworkInner())) - .withNextLink("mibzyhwitsmypyyn"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkList.class); - Assertions.assertEquals("mibzyhwitsmypyyn", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPortMirroringInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPortMirroringInnerTests.java deleted file mode 100644 index 491d5319bb9a..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPortMirroringInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; -import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkPortMirroringInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkPortMirroringInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"vdkfwynwcvtbvk\",\"direction\":\"BIDIRECTIONAL\",\"source\":\"tnvyqiatkzwp\",\"destination\":\"p\",\"status\":\"FAILURE\",\"provisioningState\":\"Updating\",\"revision\":5044236127047100720},\"id\":\"v\",\"name\":\"ccyajg\",\"type\":\"qfhwyg\"}") - .toObject(WorkloadNetworkPortMirroringInner.class); - Assertions.assertEquals("vdkfwynwcvtbvk", model.displayName()); - Assertions.assertEquals(PortMirroringDirectionEnum.BIDIRECTIONAL, model.direction()); - Assertions.assertEquals("tnvyqiatkzwp", model.source()); - Assertions.assertEquals("p", model.destination()); - Assertions.assertEquals(5044236127047100720L, model.revision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkPortMirroringInner model - = new WorkloadNetworkPortMirroringInner().withDisplayName("vdkfwynwcvtbvk") - .withDirection(PortMirroringDirectionEnum.BIDIRECTIONAL) - .withSource("tnvyqiatkzwp") - .withDestination("p") - .withRevision(5044236127047100720L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkPortMirroringInner.class); - Assertions.assertEquals("vdkfwynwcvtbvk", model.displayName()); - Assertions.assertEquals(PortMirroringDirectionEnum.BIDIRECTIONAL, model.direction()); - Assertions.assertEquals("tnvyqiatkzwp", model.source()); - Assertions.assertEquals("p", model.destination()); - Assertions.assertEquals(5044236127047100720L, model.revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPortMirroringListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPortMirroringListTests.java deleted file mode 100644 index 37b3da15648b..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPortMirroringListTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; -import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkPortMirroringListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkPortMirroringList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"uwqlgzrfzeey\",\"direction\":\"EGRESS\",\"source\":\"ikayuhqlbjbsybb\",\"destination\":\"r\",\"status\":\"FAILURE\",\"provisioningState\":\"Updating\",\"revision\":1497011486595637711},\"id\":\"vm\",\"name\":\"ipaslthaqfxssmwu\",\"type\":\"wbdsr\"},{\"properties\":{\"displayName\":\"drhneuyow\",\"direction\":\"EGRESS\",\"source\":\"ytisibir\",\"destination\":\"pikpz\",\"status\":\"SUCCESS\",\"provisioningState\":\"Updating\",\"revision\":3967363356786779271},\"id\":\"zxiavrm\",\"name\":\"zonokixrjqci\",\"type\":\"gzpfrla\"},{\"properties\":{\"displayName\":\"rnwoiindfp\",\"direction\":\"BIDIRECTIONAL\",\"source\":\"lwbtlhf\",\"destination\":\"jcdh\",\"status\":\"FAILURE\",\"provisioningState\":\"Building\",\"revision\":127022258924821579},\"id\":\"feljagrqm\",\"name\":\"hldvriii\",\"type\":\"jnalghf\"},{\"properties\":{\"displayName\":\"vsexsowuelu\",\"direction\":\"BIDIRECTIONAL\",\"source\":\"hhxvrhmzkwpj\",\"destination\":\"wspughftqsxhqx\",\"status\":\"FAILURE\",\"provisioningState\":\"Succeeded\",\"revision\":6381082417075979554},\"id\":\"igrjguufzdm\",\"name\":\"yqtfihwh\",\"type\":\"otzi\"}],\"nextLink\":\"amvpphoszqzudph\"}") - .toObject(WorkloadNetworkPortMirroringList.class); - Assertions.assertEquals("uwqlgzrfzeey", model.value().get(0).displayName()); - Assertions.assertEquals(PortMirroringDirectionEnum.EGRESS, model.value().get(0).direction()); - Assertions.assertEquals("ikayuhqlbjbsybb", model.value().get(0).source()); - Assertions.assertEquals("r", model.value().get(0).destination()); - Assertions.assertEquals(1497011486595637711L, model.value().get(0).revision()); - Assertions.assertEquals("amvpphoszqzudph", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkPortMirroringList model = new WorkloadNetworkPortMirroringList().withValue(Arrays.asList( - new WorkloadNetworkPortMirroringInner().withDisplayName("uwqlgzrfzeey") - .withDirection(PortMirroringDirectionEnum.EGRESS) - .withSource("ikayuhqlbjbsybb") - .withDestination("r") - .withRevision(1497011486595637711L), - new WorkloadNetworkPortMirroringInner().withDisplayName("drhneuyow") - .withDirection(PortMirroringDirectionEnum.EGRESS) - .withSource("ytisibir") - .withDestination("pikpz") - .withRevision(3967363356786779271L), - new WorkloadNetworkPortMirroringInner().withDisplayName("rnwoiindfp") - .withDirection(PortMirroringDirectionEnum.BIDIRECTIONAL) - .withSource("lwbtlhf") - .withDestination("jcdh") - .withRevision(127022258924821579L), - new WorkloadNetworkPortMirroringInner().withDisplayName("vsexsowuelu") - .withDirection(PortMirroringDirectionEnum.BIDIRECTIONAL) - .withSource("hhxvrhmzkwpj") - .withDestination("wspughftqsxhqx") - .withRevision(6381082417075979554L))) - .withNextLink("amvpphoszqzudph"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkPortMirroringList.class); - Assertions.assertEquals("uwqlgzrfzeey", model.value().get(0).displayName()); - Assertions.assertEquals(PortMirroringDirectionEnum.EGRESS, model.value().get(0).direction()); - Assertions.assertEquals("ikayuhqlbjbsybb", model.value().get(0).source()); - Assertions.assertEquals("r", model.value().get(0).destination()); - Assertions.assertEquals(1497011486595637711L, model.value().get(0).revision()); - Assertions.assertEquals("amvpphoszqzudph", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPortMirroringPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPortMirroringPropertiesTests.java deleted file mode 100644 index dc61d7128adb..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPortMirroringPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringProperties; -import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkPortMirroringPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkPortMirroringProperties model = BinaryData.fromString( - "{\"displayName\":\"vdnkfxusem\",\"direction\":\"BIDIRECTIONAL\",\"source\":\"muhapfcqdpsqxqv\",\"destination\":\"vuoy\",\"status\":\"SUCCESS\",\"provisioningState\":\"Succeeded\",\"revision\":4509499977856951739}") - .toObject(WorkloadNetworkPortMirroringProperties.class); - Assertions.assertEquals("vdnkfxusem", model.displayName()); - Assertions.assertEquals(PortMirroringDirectionEnum.BIDIRECTIONAL, model.direction()); - Assertions.assertEquals("muhapfcqdpsqxqv", model.source()); - Assertions.assertEquals("vuoy", model.destination()); - Assertions.assertEquals(4509499977856951739L, model.revision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkPortMirroringProperties model - = new WorkloadNetworkPortMirroringProperties().withDisplayName("vdnkfxusem") - .withDirection(PortMirroringDirectionEnum.BIDIRECTIONAL) - .withSource("muhapfcqdpsqxqv") - .withDestination("vuoy") - .withRevision(4509499977856951739L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkPortMirroringProperties.class); - Assertions.assertEquals("vdnkfxusem", model.displayName()); - Assertions.assertEquals(PortMirroringDirectionEnum.BIDIRECTIONAL, model.direction()); - Assertions.assertEquals("muhapfcqdpsqxqv", model.source()); - Assertions.assertEquals("vuoy", model.destination()); - Assertions.assertEquals(4509499977856951739L, model.revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPropertiesTests.java deleted file mode 100644 index c1c899fcd823..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPropertiesTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkProperties; - -public final class WorkloadNetworkPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkProperties model - = BinaryData.fromString("{\"provisioningState\":\"Succeeded\"}").toObject(WorkloadNetworkProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkProperties model = new WorkloadNetworkProperties(); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkProperties.class); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPublicIPsListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPublicIPsListTests.java deleted file mode 100644 index 03ca42af2954..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPublicIPsListTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner; -import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIPsList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkPublicIPsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkPublicIPsList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"pqlmfe\",\"numberOfPublicIPs\":5076002706235027340,\"publicIPBlock\":\"wkyhkobopgxe\",\"provisioningState\":\"Deleting\"},\"id\":\"epbqpcrfkbw\",\"name\":\"csnjvcdwxlpqekft\",\"type\":\"khtj\"},{\"properties\":{\"displayName\":\"ngwfqatm\",\"numberOfPublicIPs\":6035898469586356847,\"publicIPBlock\":\"dvypgikdgsz\",\"provisioningState\":\"Canceled\"},\"id\":\"irryuzhlh\",\"name\":\"joqrvqqaatj\",\"type\":\"nrvgoupmfiibfgg\"},{\"properties\":{\"displayName\":\"olvrw\",\"numberOfPublicIPs\":639224671106145818,\"publicIPBlock\":\"k\",\"provisioningState\":\"Failed\"},\"id\":\"wjygvjayvblmhvk\",\"name\":\"uhbxvvy\",\"type\":\"gsopbyrqufegxu\"},{\"properties\":{\"displayName\":\"fbn\",\"numberOfPublicIPs\":2314508611274397861,\"publicIPBlock\":\"l\",\"provisioningState\":\"Building\"},\"id\":\"itvgbmhrixkwm\",\"name\":\"ijejvegrhbpn\",\"type\":\"ixexcc\"}],\"nextLink\":\"reaxhcexdr\"}") - .toObject(WorkloadNetworkPublicIPsList.class); - Assertions.assertEquals("pqlmfe", model.value().get(0).displayName()); - Assertions.assertEquals(5076002706235027340L, model.value().get(0).numberOfPublicIPs()); - Assertions.assertEquals("reaxhcexdr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkPublicIPsList model = new WorkloadNetworkPublicIPsList().withValue(Arrays.asList( - new WorkloadNetworkPublicIpInner().withDisplayName("pqlmfe").withNumberOfPublicIPs(5076002706235027340L), - new WorkloadNetworkPublicIpInner().withDisplayName("ngwfqatm").withNumberOfPublicIPs(6035898469586356847L), - new WorkloadNetworkPublicIpInner().withDisplayName("olvrw").withNumberOfPublicIPs(639224671106145818L), - new WorkloadNetworkPublicIpInner().withDisplayName("fbn").withNumberOfPublicIPs(2314508611274397861L))) - .withNextLink("reaxhcexdr"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkPublicIPsList.class); - Assertions.assertEquals("pqlmfe", model.value().get(0).displayName()); - Assertions.assertEquals(5076002706235027340L, model.value().get(0).numberOfPublicIPs()); - Assertions.assertEquals("reaxhcexdr", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPublicIpInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPublicIpInnerTests.java deleted file mode 100644 index a6006fbd73b7..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPublicIpInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkPublicIpInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkPublicIpInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"ahqkg\",\"numberOfPublicIPs\":7920652979146329739,\"publicIPBlock\":\"jnhyjsvf\",\"provisioningState\":\"Deleting\"},\"id\":\"bfvoowvrv\",\"name\":\"t\",\"type\":\"jqppyostronzmy\"}") - .toObject(WorkloadNetworkPublicIpInner.class); - Assertions.assertEquals("ahqkg", model.displayName()); - Assertions.assertEquals(7920652979146329739L, model.numberOfPublicIPs()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkPublicIpInner model - = new WorkloadNetworkPublicIpInner().withDisplayName("ahqkg").withNumberOfPublicIPs(7920652979146329739L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkPublicIpInner.class); - Assertions.assertEquals("ahqkg", model.displayName()); - Assertions.assertEquals(7920652979146329739L, model.numberOfPublicIPs()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPublicIpPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPublicIpPropertiesTests.java deleted file mode 100644 index 678423a8c0e9..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkPublicIpPropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpProperties; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkPublicIpPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkPublicIpProperties model = BinaryData.fromString( - "{\"displayName\":\"fipns\",\"numberOfPublicIPs\":1729044894039608020,\"publicIPBlock\":\"a\",\"provisioningState\":\"Canceled\"}") - .toObject(WorkloadNetworkPublicIpProperties.class); - Assertions.assertEquals("fipns", model.displayName()); - Assertions.assertEquals(1729044894039608020L, model.numberOfPublicIPs()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkPublicIpProperties model = new WorkloadNetworkPublicIpProperties().withDisplayName("fipns") - .withNumberOfPublicIPs(1729044894039608020L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkPublicIpProperties.class); - Assertions.assertEquals("fipns", model.displayName()); - Assertions.assertEquals(1729044894039608020L, model.numberOfPublicIPs()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentInnerTests.java deleted file mode 100644 index 1ac6a1f7a31e..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkSegmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkSegmentInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"tizzronasxif\",\"connectedGateway\":\"zq\",\"subnet\":{\"dhcpRanges\":[\"tw\"],\"gatewayAddress\":\"gogczhonnxkrlgny\"},\"portVif\":[{\"portName\":\"sxkkg\"},{\"portName\":\"rrghxjbdhqxvcxgf\"}],\"status\":\"FAILURE\",\"provisioningState\":\"Succeeded\",\"revision\":4282433214728373807},\"id\":\"rnsvbuswd\",\"name\":\"z\",\"type\":\"ybycnunvj\"}") - .toObject(WorkloadNetworkSegmentInner.class); - Assertions.assertEquals("tizzronasxif", model.displayName()); - Assertions.assertEquals("zq", model.connectedGateway()); - Assertions.assertEquals("tw", model.subnet().dhcpRanges().get(0)); - Assertions.assertEquals("gogczhonnxkrlgny", model.subnet().gatewayAddress()); - Assertions.assertEquals(4282433214728373807L, model.revision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkSegmentInner model = new WorkloadNetworkSegmentInner().withDisplayName("tizzronasxif") - .withConnectedGateway("zq") - .withSubnet(new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("tw")) - .withGatewayAddress("gogczhonnxkrlgny")) - .withRevision(4282433214728373807L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkSegmentInner.class); - Assertions.assertEquals("tizzronasxif", model.displayName()); - Assertions.assertEquals("zq", model.connectedGateway()); - Assertions.assertEquals("tw", model.subnet().dhcpRanges().get(0)); - Assertions.assertEquals("gogczhonnxkrlgny", model.subnet().gatewayAddress()); - Assertions.assertEquals(4282433214728373807L, model.revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentPortVifTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentPortVifTests.java deleted file mode 100644 index 6493004de343..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentPortVifTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentPortVif; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkSegmentPortVifTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkSegmentPortVif model - = BinaryData.fromString("{\"portName\":\"bgj\"}").toObject(WorkloadNetworkSegmentPortVif.class); - Assertions.assertEquals("bgj", model.portName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkSegmentPortVif model = new WorkloadNetworkSegmentPortVif().withPortName("bgj"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkSegmentPortVif.class); - Assertions.assertEquals("bgj", model.portName()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentPropertiesTests.java deleted file mode 100644 index cd8c21883d66..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentProperties; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkSegmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkSegmentProperties model = BinaryData.fromString( - "{\"displayName\":\"tkfa\",\"connectedGateway\":\"opqgikyzirtxdyux\",\"subnet\":{\"dhcpRanges\":[\"tpsew\"],\"gatewayAddress\":\"oi\"},\"portVif\":[{\"portName\":\"rydxtqm\"}],\"status\":\"SUCCESS\",\"provisioningState\":\"Updating\",\"revision\":3407001905687200416}") - .toObject(WorkloadNetworkSegmentProperties.class); - Assertions.assertEquals("tkfa", model.displayName()); - Assertions.assertEquals("opqgikyzirtxdyux", model.connectedGateway()); - Assertions.assertEquals("tpsew", model.subnet().dhcpRanges().get(0)); - Assertions.assertEquals("oi", model.subnet().gatewayAddress()); - Assertions.assertEquals(3407001905687200416L, model.revision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkSegmentProperties model = new WorkloadNetworkSegmentProperties().withDisplayName("tkfa") - .withConnectedGateway("opqgikyzirtxdyux") - .withSubnet( - new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("tpsew")).withGatewayAddress("oi")) - .withRevision(3407001905687200416L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkSegmentProperties.class); - Assertions.assertEquals("tkfa", model.displayName()); - Assertions.assertEquals("opqgikyzirtxdyux", model.connectedGateway()); - Assertions.assertEquals("tpsew", model.subnet().dhcpRanges().get(0)); - Assertions.assertEquals("oi", model.subnet().gatewayAddress()); - Assertions.assertEquals(3407001905687200416L, model.revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentSubnetTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentSubnetTests.java deleted file mode 100644 index 2ad6618995c7..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentSubnetTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkSegmentSubnetTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkSegmentSubnet model - = BinaryData.fromString("{\"dhcpRanges\":[\"hyaomtbghhavgr\"],\"gatewayAddress\":\"ffovjzhpj\"}") - .toObject(WorkloadNetworkSegmentSubnet.class); - Assertions.assertEquals("hyaomtbghhavgr", model.dhcpRanges().get(0)); - Assertions.assertEquals("ffovjzhpj", model.gatewayAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkSegmentSubnet model - = new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("hyaomtbghhavgr")) - .withGatewayAddress("ffovjzhpj"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkSegmentSubnet.class); - Assertions.assertEquals("hyaomtbghhavgr", model.dhcpRanges().get(0)); - Assertions.assertEquals("ffovjzhpj", model.gatewayAddress()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentsListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentsListTests.java deleted file mode 100644 index c675ef55974d..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkSegmentsListTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentsList; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkSegmentsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkSegmentsList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"eafxtsgumhjglikk\",\"connectedGateway\":\"slol\",\"subnet\":{\"dhcpRanges\":[\"uzlm\",\"felfktg\"],\"gatewayAddress\":\"crpw\"},\"portVif\":[{\"portName\":\"noigbrnjwmwk\"},{\"portName\":\"bsazejjoqka\"}],\"status\":\"FAILURE\",\"provisioningState\":\"Succeeded\",\"revision\":1349265341310840343},\"id\":\"gzxnfaazpxdtnk\",\"name\":\"mkqjj\",\"type\":\"wuenvr\"},{\"properties\":{\"displayName\":\"ou\",\"connectedGateway\":\"bre\",\"subnet\":{\"dhcpRanges\":[\"ysjkixqtnqttez\",\"wfff\",\"akpjpqqmtedlt\",\"mjihyeozphv\"],\"gatewayAddress\":\"uyqncygupkvipmd\"},\"portVif\":[{\"portName\":\"qupevzh\"}],\"status\":\"FAILURE\",\"provisioningState\":\"Canceled\",\"revision\":5953574927577101427},\"id\":\"ujbypelmcuvhixb\",\"name\":\"xyfwnylrcool\",\"type\":\"ttpkiwkkbnujrywv\"},{\"properties\":{\"displayName\":\"bfpncurdo\",\"connectedGateway\":\"iithtywu\",\"subnet\":{\"dhcpRanges\":[\"ihwqknfdntwjchr\",\"goihx\",\"mwctondzjluudfd\"],\"gatewayAddress\":\"gg\"},\"portVif\":[{\"portName\":\"wtovvtgsein\"}],\"status\":\"FAILURE\",\"provisioningState\":\"Canceled\",\"revision\":3636581995811123220},\"id\":\"pirgnepttwq\",\"name\":\"sniffc\",\"type\":\"mqnrojlpijnkr\"}],\"nextLink\":\"rddh\"}") - .toObject(WorkloadNetworkSegmentsList.class); - Assertions.assertEquals("eafxtsgumhjglikk", model.value().get(0).displayName()); - Assertions.assertEquals("slol", model.value().get(0).connectedGateway()); - Assertions.assertEquals("uzlm", model.value().get(0).subnet().dhcpRanges().get(0)); - Assertions.assertEquals("crpw", model.value().get(0).subnet().gatewayAddress()); - Assertions.assertEquals(1349265341310840343L, model.value().get(0).revision()); - Assertions.assertEquals("rddh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkSegmentsList model = new WorkloadNetworkSegmentsList().withValue(Arrays.asList( - new WorkloadNetworkSegmentInner().withDisplayName("eafxtsgumhjglikk") - .withConnectedGateway("slol") - .withSubnet(new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("uzlm", "felfktg")) - .withGatewayAddress("crpw")) - .withRevision(1349265341310840343L), - new WorkloadNetworkSegmentInner().withDisplayName("ou") - .withConnectedGateway("bre") - .withSubnet(new WorkloadNetworkSegmentSubnet() - .withDhcpRanges(Arrays.asList("ysjkixqtnqttez", "wfff", "akpjpqqmtedlt", "mjihyeozphv")) - .withGatewayAddress("uyqncygupkvipmd")) - .withRevision(5953574927577101427L), - new WorkloadNetworkSegmentInner().withDisplayName("bfpncurdo") - .withConnectedGateway("iithtywu") - .withSubnet(new WorkloadNetworkSegmentSubnet() - .withDhcpRanges(Arrays.asList("ihwqknfdntwjchr", "goihx", "mwctondzjluudfd")) - .withGatewayAddress("gg")) - .withRevision(3636581995811123220L))) - .withNextLink("rddh"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkSegmentsList.class); - Assertions.assertEquals("eafxtsgumhjglikk", model.value().get(0).displayName()); - Assertions.assertEquals("slol", model.value().get(0).connectedGateway()); - Assertions.assertEquals("uzlm", model.value().get(0).subnet().dhcpRanges().get(0)); - Assertions.assertEquals("crpw", model.value().get(0).subnet().gatewayAddress()); - Assertions.assertEquals(1349265341310840343L, model.value().get(0).revision()); - Assertions.assertEquals("rddh", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVMGroupInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVMGroupInnerTests.java deleted file mode 100644 index 70cda6bb6336..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVMGroupInnerTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkVMGroupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkVMGroupInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"zheydbsdshmk\",\"members\":[\"ehvbbxurip\",\"tfnhtbaxkgxywr\",\"kpyklyhp\"],\"status\":\"FAILURE\",\"provisioningState\":\"Updating\",\"revision\":4054155365384402790},\"id\":\"dlgzibthostgkt\",\"name\":\"tvdxeclzedqb\",\"type\":\"vh\"}") - .toObject(WorkloadNetworkVMGroupInner.class); - Assertions.assertEquals("zheydbsdshmk", model.displayName()); - Assertions.assertEquals("ehvbbxurip", model.members().get(0)); - Assertions.assertEquals(4054155365384402790L, model.revision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkVMGroupInner model = new WorkloadNetworkVMGroupInner().withDisplayName("zheydbsdshmk") - .withMembers(Arrays.asList("ehvbbxurip", "tfnhtbaxkgxywr", "kpyklyhp")) - .withRevision(4054155365384402790L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkVMGroupInner.class); - Assertions.assertEquals("zheydbsdshmk", model.displayName()); - Assertions.assertEquals("ehvbbxurip", model.members().get(0)); - Assertions.assertEquals(4054155365384402790L, model.revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVMGroupPropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVMGroupPropertiesTests.java deleted file mode 100644 index 9fa66b6cd4e0..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVMGroupPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkVMGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkVMGroupProperties model = BinaryData.fromString( - "{\"displayName\":\"h\",\"members\":[\"dqkdlwwqfbu\",\"lkxt\",\"qjfsmlmbtxhw\"],\"status\":\"SUCCESS\",\"provisioningState\":\"Succeeded\",\"revision\":77859916992999912}") - .toObject(WorkloadNetworkVMGroupProperties.class); - Assertions.assertEquals("h", model.displayName()); - Assertions.assertEquals("dqkdlwwqfbu", model.members().get(0)); - Assertions.assertEquals(77859916992999912L, model.revision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkVMGroupProperties model = new WorkloadNetworkVMGroupProperties().withDisplayName("h") - .withMembers(Arrays.asList("dqkdlwwqfbu", "lkxt", "qjfsmlmbtxhw")) - .withRevision(77859916992999912L); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkVMGroupProperties.class); - Assertions.assertEquals("h", model.displayName()); - Assertions.assertEquals("dqkdlwwqfbu", model.members().get(0)); - Assertions.assertEquals(77859916992999912L, model.revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVMGroupsListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVMGroupsListTests.java deleted file mode 100644 index 805688670270..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVMGroupsListTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; -import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupsList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkVMGroupsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkVMGroupsList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"qjzgxmrhublw\",\"members\":[\"sutrgjup\",\"uutpwoqhih\",\"jqgwzp\",\"fqntcyp\"],\"status\":\"SUCCESS\",\"provisioningState\":\"Building\",\"revision\":4546309057929935505},\"id\":\"kslircizjxvydfc\",\"name\":\"acvlhv\",\"type\":\"gdyftumrtwna\"},{\"properties\":{\"displayName\":\"lbiw\",\"members\":[\"gcyztsfmznbae\",\"ph\",\"hqnrn\",\"pxehuwrykqga\"],\"status\":\"SUCCESS\",\"provisioningState\":\"Failed\",\"revision\":1763839992025561679},\"id\":\"dvk\",\"name\":\"bejdznxcv\",\"type\":\"srhnjivo\"},{\"properties\":{\"displayName\":\"novqfzge\",\"members\":[\"ftul\",\"ltducea\",\"tmczuomejwcwwqi\"],\"status\":\"FAILURE\",\"provisioningState\":\"Deleting\",\"revision\":6715076788595047640},\"id\":\"msvpkjpr\",\"name\":\"kwcf\",\"type\":\"ql\"}],\"nextLink\":\"x\"}") - .toObject(WorkloadNetworkVMGroupsList.class); - Assertions.assertEquals("qjzgxmrhublw", model.value().get(0).displayName()); - Assertions.assertEquals("sutrgjup", model.value().get(0).members().get(0)); - Assertions.assertEquals(4546309057929935505L, model.value().get(0).revision()); - Assertions.assertEquals("x", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkVMGroupsList model = new WorkloadNetworkVMGroupsList().withValue(Arrays.asList( - new WorkloadNetworkVMGroupInner().withDisplayName("qjzgxmrhublw") - .withMembers(Arrays.asList("sutrgjup", "uutpwoqhih", "jqgwzp", "fqntcyp")) - .withRevision(4546309057929935505L), - new WorkloadNetworkVMGroupInner().withDisplayName("lbiw") - .withMembers(Arrays.asList("gcyztsfmznbae", "ph", "hqnrn", "pxehuwrykqga")) - .withRevision(1763839992025561679L), - new WorkloadNetworkVMGroupInner().withDisplayName("novqfzge") - .withMembers(Arrays.asList("ftul", "ltducea", "tmczuomejwcwwqi")) - .withRevision(6715076788595047640L))) - .withNextLink("x"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkVMGroupsList.class); - Assertions.assertEquals("qjzgxmrhublw", model.value().get(0).displayName()); - Assertions.assertEquals("sutrgjup", model.value().get(0).members().get(0)); - Assertions.assertEquals(4546309057929935505L, model.value().get(0).revision()); - Assertions.assertEquals("x", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVirtualMachineInnerTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVirtualMachineInnerTests.java deleted file mode 100644 index bae320f3e714..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVirtualMachineInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkVirtualMachineInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkVirtualMachineInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Deleting\",\"displayName\":\"tymoxoftp\",\"vmType\":\"REGULAR\"},\"id\":\"yczuhxacpq\",\"name\":\"lihhyuspskasdvlm\",\"type\":\"wdgzxulucv\"}") - .toObject(WorkloadNetworkVirtualMachineInner.class); - Assertions.assertEquals("tymoxoftp", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkVirtualMachineInner model - = new WorkloadNetworkVirtualMachineInner().withDisplayName("tymoxoftp"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkVirtualMachineInner.class); - Assertions.assertEquals("tymoxoftp", model.displayName()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVirtualMachinePropertiesTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVirtualMachinePropertiesTests.java deleted file mode 100644 index 48c7ac683607..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVirtualMachinePropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineProperties; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkVirtualMachinePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkVirtualMachineProperties model = BinaryData - .fromString( - "{\"provisioningState\":\"Canceled\",\"displayName\":\"sreuzvxurisjnh\",\"vmType\":\"SERVICE\"}") - .toObject(WorkloadNetworkVirtualMachineProperties.class); - Assertions.assertEquals("sreuzvxurisjnh", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkVirtualMachineProperties model - = new WorkloadNetworkVirtualMachineProperties().withDisplayName("sreuzvxurisjnh"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkVirtualMachineProperties.class); - Assertions.assertEquals("sreuzvxurisjnh", model.displayName()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVirtualMachinesListTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVirtualMachinesListTests.java deleted file mode 100644 index 6418492568c3..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworkVirtualMachinesListTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; -import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachinesList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadNetworkVirtualMachinesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadNetworkVirtualMachinesList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"fcluyov\",\"vmType\":\"EDGE\"},\"id\":\"kfezzxscyhwz\",\"name\":\"g\",\"type\":\"rujbzbomvzzbtdc\"},{\"properties\":{\"provisioningState\":\"Failed\",\"displayName\":\"yujviylwdshfssn\",\"vmType\":\"EDGE\"},\"id\":\"efr\",\"name\":\"msgaoj\",\"type\":\"mwn\"}],\"nextLink\":\"tmr\"}") - .toObject(WorkloadNetworkVirtualMachinesList.class); - Assertions.assertEquals("fcluyov", model.value().get(0).displayName()); - Assertions.assertEquals("tmr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadNetworkVirtualMachinesList model = new WorkloadNetworkVirtualMachinesList() - .withValue(Arrays.asList(new WorkloadNetworkVirtualMachineInner().withDisplayName("fcluyov"), - new WorkloadNetworkVirtualMachineInner().withDisplayName("yujviylwdshfssn"))) - .withNextLink("tmr"); - model = BinaryData.fromObject(model).toObject(WorkloadNetworkVirtualMachinesList.class); - Assertions.assertEquals("fcluyov", model.value().get(0).displayName()); - Assertions.assertEquals("tmr", model.nextLink()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDhcpMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDhcpMockTests.java index 1eb6b5d606ee..eaa47dd57cda 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDhcpMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDhcpMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcp; @@ -22,23 +22,23 @@ public final class WorkloadNetworksCreateDhcpMockTests { @Test public void testCreateDhcp() throws Exception { String responseStr - = "{\"properties\":{\"dhcpType\":\"WorkloadNetworkDhcpEntity\",\"displayName\":\"zlanrupdwvnph\",\"segments\":[\"q\",\"pjhmqrhvthl\"],\"provisioningState\":\"Succeeded\",\"revision\":1106480050332233961},\"id\":\"mlzzhzdtxetlgyd\",\"name\":\"hqvlnnpxybafiqg\",\"type\":\"aarbgjekg\"}"; + = "{\"properties\":{\"dhcpType\":\"WorkloadNetworkDhcpEntity\",\"displayName\":\"tsxoatftgz\",\"segments\":[\"bs\",\"vefloccsrmozihmi\",\"g\",\"wtxxpkyjcx\"],\"provisioningState\":\"Succeeded\",\"revision\":2610743825703035126},\"id\":\"fmpcycilrmca\",\"name\":\"kggnoxu\",\"type\":\"t\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkDhcp response = manager.workloadNetworks() - .defineDhcp("dxfzzzwyjaf") - .withExistingPrivateCloud("pcrrk", "lawjmjsmwrok") + .defineDhcp("qbsms") + .withExistingWorkloadNetwork("xlxqzvn", "rsbycucrwn", "mikzeb") .withProperties( - new WorkloadNetworkDhcpEntity().withDisplayName("hguynuchlgmltxdw").withRevision(3582867417304549284L)) + new WorkloadNetworkDhcpEntity().withDisplayName("qgfuhokzru").withRevision(7689884715357447041L)) .create(); - Assertions.assertEquals("zlanrupdwvnph", response.properties().displayName()); - Assertions.assertEquals(1106480050332233961L, response.properties().revision()); + Assertions.assertEquals("tsxoatftgz", response.properties().displayName()); + Assertions.assertEquals(2610743825703035126L, response.properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsServiceMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsServiceMockTests.java index ce74b34ad08d..fb173cf3e99a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsServiceMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsServiceMockTests.java @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsService; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -23,31 +24,31 @@ public final class WorkloadNetworksCreateDnsServiceMockTests { @Test public void testCreateDnsService() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"yrrleaesinuqt\",\"dnsServiceIp\":\"qobbpihehcec\",\"defaultDnsZone\":\"mrqbrjbbmpxdlv\",\"fqdnZones\":[\"rexcrseqwjksghu\",\"gzhxog\",\"ggsvoujkxibdaf\"],\"logLevel\":\"ERROR\",\"status\":\"FAILURE\",\"provisioningState\":\"Succeeded\",\"revision\":5833008112699016304},\"id\":\"bv\",\"name\":\"bhdyir\",\"type\":\"pwpgddei\"}"; + = "{\"properties\":{\"displayName\":\"obaxkjeytu\",\"dnsServiceIp\":\"bfjkw\",\"defaultDnsZone\":\"snkq\",\"fqdnZones\":[\"y\"],\"logLevel\":\"INFO\",\"status\":\"SUCCESS\",\"provisioningState\":\"Succeeded\",\"revision\":3083692456009895216},\"id\":\"aulk\",\"name\":\"akdkifmjnnawtqab\",\"type\":\"xuckpggqoweyir\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkDnsService response = manager.workloadNetworks() - .defineDnsService("hj") - .withExistingPrivateCloud("klbyulidwcw", "mzegjon") - .withDisplayName("gdn") - .withDnsServiceIp("brfkspz") - .withDefaultDnsZone("mtksjcitdigsx") - .withFqdnZones(Arrays.asList("l", "plkeuachtomflryt", "wfpfmdgycx", "mskwhqjjysl")) - .withLogLevel(DnsServiceLogLevelEnum.WARNING) - .withRevision(2457531549139763727L) + .defineDnsService("tcqiosmg") + .withExistingWorkloadNetwork("ksxwpnd", "cpfnznthjtwkja", "srxuzvoam") + .withProperties(new WorkloadNetworkDnsServiceProperties().withDisplayName("hgxqdlyrt") + .withDnsServiceIp("laprlt") + .withDefaultDnsZone("atbhjmznn") + .withFqdnZones(Arrays.asList("qeqala")) + .withLogLevel(DnsServiceLogLevelEnum.ERROR) + .withRevision(9185198515701434959L)) .create(); - Assertions.assertEquals("yrrleaesinuqt", response.displayName()); - Assertions.assertEquals("qobbpihehcec", response.dnsServiceIp()); - Assertions.assertEquals("mrqbrjbbmpxdlv", response.defaultDnsZone()); - Assertions.assertEquals("rexcrseqwjksghu", response.fqdnZones().get(0)); - Assertions.assertEquals(DnsServiceLogLevelEnum.ERROR, response.logLevel()); - Assertions.assertEquals(5833008112699016304L, response.revision()); + Assertions.assertEquals("obaxkjeytu", response.properties().displayName()); + Assertions.assertEquals("bfjkw", response.properties().dnsServiceIp()); + Assertions.assertEquals("snkq", response.properties().defaultDnsZone()); + Assertions.assertEquals("y", response.properties().fqdnZones().get(0)); + Assertions.assertEquals(DnsServiceLogLevelEnum.INFO, response.properties().logLevel()); + Assertions.assertEquals(3083692456009895216L, response.properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsZoneMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsZoneMockTests.java index cc4f4d6dfe80..ec0ccc609b15 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsZoneMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateDnsZoneMockTests.java @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZone; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -22,31 +23,31 @@ public final class WorkloadNetworksCreateDnsZoneMockTests { @Test public void testCreateDnsZone() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"klelssxb\",\"domain\":[\"sxz\"],\"dnsServerIps\":[\"srlsmd\"],\"sourceIp\":\"qplpvmjc\",\"dnsServices\":5106286966538490293,\"provisioningState\":\"Succeeded\",\"revision\":7484843776826385857},\"id\":\"eowxvgpi\",\"name\":\"deugf\",\"type\":\"xzecpaxwkufykhvu\"}"; + = "{\"properties\":{\"displayName\":\"flqo\",\"domain\":[\"vrehmrnjhvsujzt\"],\"dnsServerIps\":[\"tqjtwhauu\"],\"sourceIp\":\"prnjletlxsmr\",\"dnsServices\":1873182568438303490,\"provisioningState\":\"Succeeded\",\"revision\":8833257266764779164},\"id\":\"waziy\",\"name\":\"knlqwzdvpiwhxqsz\",\"type\":\"tmaaj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkDnsZone response = manager.workloadNetworks() - .defineDnsZone("sqowxwc") - .withExistingPrivateCloud("awzovgkk", "muikjcjcaztbws") - .withDisplayName("ikytwvczcswka") - .withDomain(Arrays.asList("jyfdvlv", "b", "rnfxtgddp", "th")) - .withDnsServerIps(Arrays.asList("mnaoy")) - .withSourceIp("kcoeqswank") - .withDnsServices(8917726159881573369L) - .withRevision(5230753304707759039L) + .defineDnsZone("saasiixtmkzj") + .withExistingWorkloadNetwork("hlisngw", "lqqmpiz", "uwnpqxpxiwfcng") + .withProperties(new WorkloadNetworkDnsZoneProperties().withDisplayName("iirhgfgrwsd") + .withDomain(Arrays.asList("atzv")) + .withDnsServerIps(Arrays.asList("lbyvictctbrxkjzw", "gxffmshkwf")) + .withSourceIp("gozxw") + .withDnsServices(2779918745787217831L) + .withRevision(5960879142196125616L)) .create(); - Assertions.assertEquals("klelssxb", response.displayName()); - Assertions.assertEquals("sxz", response.domain().get(0)); - Assertions.assertEquals("srlsmd", response.dnsServerIps().get(0)); - Assertions.assertEquals("qplpvmjc", response.sourceIp()); - Assertions.assertEquals(5106286966538490293L, response.dnsServices()); - Assertions.assertEquals(7484843776826385857L, response.revision()); + Assertions.assertEquals("flqo", response.properties().displayName()); + Assertions.assertEquals("vrehmrnjhvsujzt", response.properties().domain().get(0)); + Assertions.assertEquals("tqjtwhauu", response.properties().dnsServerIps().get(0)); + Assertions.assertEquals("prnjletlxsmr", response.properties().sourceIp()); + Assertions.assertEquals(1873182568438303490L, response.properties().dnsServices()); + Assertions.assertEquals(8833257266764779164L, response.properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePortMirroringMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePortMirroringMockTests.java index dacc34c020c7..1bfcbf472b14 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePortMirroringMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePortMirroringMockTests.java @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroring; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -22,29 +23,29 @@ public final class WorkloadNetworksCreatePortMirroringMockTests { @Test public void testCreatePortMirroring() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"hqlkccuzgygqwaho\",\"direction\":\"INGRESS\",\"source\":\"gniiprglvaw\",\"destination\":\"z\",\"status\":\"SUCCESS\",\"provisioningState\":\"Succeeded\",\"revision\":9015323122044203190},\"id\":\"bbjpmcubkmif\",\"name\":\"xxkubvphavp\",\"type\":\"h\"}"; + = "{\"properties\":{\"displayName\":\"ivhjknidi\",\"direction\":\"INGRESS\",\"source\":\"xgpnr\",\"destination\":\"ov\",\"status\":\"SUCCESS\",\"provisioningState\":\"Succeeded\",\"revision\":4084484216418195821},\"id\":\"ao\",\"name\":\"jrmzvupor\",\"type\":\"zdfuydzvkfvxcnqm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkPortMirroring response = manager.workloadNetworks() - .definePortMirroring("ltymkmvguihywart") - .withExistingPrivateCloud("xepmrut", "nabaobnslujd") - .withDisplayName("hkixkykxdssj") - .withDirection(PortMirroringDirectionEnum.EGRESS) - .withSource("ucfx") - .withDestination("kkflrmymyincqlhr") - .withRevision(6672920695658521113L) + .definePortMirroring("fkyjpmspbpssdfpp") + .withExistingWorkloadNetwork("uhuxylrjvmtyg", "bmzyospsps", "c") + .withProperties(new WorkloadNetworkPortMirroringProperties().withDisplayName("tieyujtvczkcny") + .withDirection(PortMirroringDirectionEnum.EGRESS) + .withSource("unjdx") + .withDestination("lnkvxlx") + .withRevision(2945558992921762538L)) .create(); - Assertions.assertEquals("hqlkccuzgygqwaho", response.displayName()); - Assertions.assertEquals(PortMirroringDirectionEnum.INGRESS, response.direction()); - Assertions.assertEquals("gniiprglvaw", response.source()); - Assertions.assertEquals("z", response.destination()); - Assertions.assertEquals(9015323122044203190L, response.revision()); + Assertions.assertEquals("ivhjknidi", response.properties().displayName()); + Assertions.assertEquals(PortMirroringDirectionEnum.INGRESS, response.properties().direction()); + Assertions.assertEquals("xgpnr", response.properties().source()); + Assertions.assertEquals("ov", response.properties().destination()); + Assertions.assertEquals(4084484216418195821L, response.properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIpMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIPMockTests.java similarity index 51% rename from sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIpMockTests.java rename to sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIPMockTests.java index ad02b75fc1f9..7c3d3e2877e0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIpMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreatePublicIPMockTests.java @@ -1,43 +1,44 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIp; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIpProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class WorkloadNetworksCreatePublicIpMockTests { +public final class WorkloadNetworksCreatePublicIPMockTests { @Test - public void testCreatePublicIp() throws Exception { + public void testCreatePublicIP() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"leeyaswl\",\"numberOfPublicIPs\":6834415054376102740,\"publicIPBlock\":\"rmfjlrxw\",\"provisioningState\":\"Succeeded\"},\"id\":\"khfkvcisi\",\"name\":\"moaedsxj\",\"type\":\"uivedwcgyeewxeiq\"}"; + = "{\"properties\":{\"displayName\":\"kjsvthnwpzteko\",\"numberOfPublicIPs\":3649264392762822171,\"publicIPBlock\":\"iattgplu\",\"provisioningState\":\"Succeeded\"},\"id\":\"angcfhnykz\",\"name\":\"ugswvx\",\"type\":\"lmzqwmvtxnjmx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkPublicIp response = manager.workloadNetworks() - .definePublicIp("nssqyzqed") - .withExistingPrivateCloud("rbqgvgov", "bbttefjo") - .withDisplayName("frdbiqmrjgeihf") - .withNumberOfPublicIPs(7863102201954371556L) + .definePublicIP("iwtglxxhljfpg") + .withExistingWorkloadNetwork("qpswokmvkhlggdhb", "mzqkz", "zu") + .withProperties(new WorkloadNetworkPublicIpProperties().withDisplayName("rmnzhr") + .withNumberOfPublicIPs(8472302435377854037L)) .create(); - Assertions.assertEquals("leeyaswl", response.displayName()); - Assertions.assertEquals(6834415054376102740L, response.numberOfPublicIPs()); + Assertions.assertEquals("kjsvthnwpzteko", response.properties().displayName()); + Assertions.assertEquals(3649264392762822171L, response.properties().numberOfPublicIPs()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentMockTests.java new file mode 100644 index 000000000000..30dceedf0db3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentMockTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.avs.AvsManager; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProperties; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkloadNetworksCreateSegmentMockTests { + @Test + public void testCreateSegment() throws Exception { + String responseStr + = "{\"properties\":{\"displayName\":\"xhk\",\"connectedGateway\":\"qirwrweoox\",\"subnet\":{\"dhcpRanges\":[\"hx\",\"rsnewmozqvbubqma\"],\"gatewayAddress\":\"sycxhxzgaz\"},\"portVif\":[{\"portName\":\"o\"}],\"status\":\"FAILURE\",\"provisioningState\":\"Succeeded\",\"revision\":8461418072958127143},\"id\":\"ubowsepdfgkm\",\"name\":\"dherngbtcj\",\"type\":\"ahokqtobkauxofsh\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + AvsManager manager = AvsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkloadNetworkSegment response = manager.workloadNetworks() + .defineSegment("ibuz") + .withExistingWorkloadNetwork("cuqudtcvclxy", "pdkvg", "abuiy") + .withProperties(new WorkloadNetworkSegmentProperties().withDisplayName("ugneikn") + .withConnectedGateway("oxgjiuqhibt") + .withSubnet(new WorkloadNetworkSegmentSubnet().withDhcpRanges(Arrays.asList("qw", "edmurrxxge")) + .withGatewayAddress("ktvqylkmqpzoy")) + .withRevision(4330938782418553364L)) + .create(); + + Assertions.assertEquals("xhk", response.properties().displayName()); + Assertions.assertEquals("qirwrweoox", response.properties().connectedGateway()); + Assertions.assertEquals("hx", response.properties().subnet().dhcpRanges().get(0)); + Assertions.assertEquals("sycxhxzgaz", response.properties().subnet().gatewayAddress()); + Assertions.assertEquals(8461418072958127143L, response.properties().revision()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentsMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentsMockTests.java deleted file mode 100644 index 364f1215664f..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateSegmentsMockTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.avs.AvsManager; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; -import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkloadNetworksCreateSegmentsMockTests { - @Test - public void testCreateSegments() throws Exception { - String responseStr - = "{\"properties\":{\"displayName\":\"zydmxzjijpvuaurk\",\"connectedGateway\":\"ci\",\"subnet\":{\"dhcpRanges\":[\"fx\",\"dcoxnbk\",\"ja\"],\"gatewayAddress\":\"rnnqb\"},\"portVif\":[{\"portName\":\"izxqltgrd\"},{\"portName\":\"ypxrx\"},{\"portName\":\"fihwu\"}],\"status\":\"FAILURE\",\"provisioningState\":\"Succeeded\",\"revision\":277871752472439784},\"id\":\"xrblmliowxihs\",\"name\":\"nxw\",\"type\":\"agnepzwaklsb\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AvsManager manager = AvsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - WorkloadNetworkSegment response = manager.workloadNetworks() - .defineSegments("l") - .withExistingPrivateCloud("psmgo", "guamlj") - .withDisplayName("splzga") - .withConnectedGateway("cshhv") - .withSubnet(new WorkloadNetworkSegmentSubnet() - .withDhcpRanges(Arrays.asList("nxkympqanxrjk", "xtwbta", "ypnyghshxc")) - .withGatewayAddress("hkgmnsg")) - .withRevision(4535170373281810468L) - .create(); - - Assertions.assertEquals("zydmxzjijpvuaurk", response.displayName()); - Assertions.assertEquals("ci", response.connectedGateway()); - Assertions.assertEquals("fx", response.subnet().dhcpRanges().get(0)); - Assertions.assertEquals("rnnqb", response.subnet().gatewayAddress()); - Assertions.assertEquals(277871752472439784L, response.revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateVMGroupMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateVMGroupMockTests.java index 6c321c70075f..5e24ddf678ac 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateVMGroupMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksCreateVMGroupMockTests.java @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroup; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -22,25 +23,25 @@ public final class WorkloadNetworksCreateVMGroupMockTests { @Test public void testCreateVMGroup() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"iidlop\",\"members\":[\"wdpyq\",\"ybxubmdna\",\"cbq\"],\"status\":\"SUCCESS\",\"provisioningState\":\"Succeeded\",\"revision\":1864803261739962895},\"id\":\"acigel\",\"name\":\"ohdbvqvwzkj\",\"type\":\"pwbeonr\"}"; + = "{\"properties\":{\"displayName\":\"ixjawrtm\",\"members\":[\"myccx\",\"zhcoxovnekhe\",\"lusfnrdtjxtxrdcq\",\"jvidttge\"],\"status\":\"FAILURE\",\"provisioningState\":\"Succeeded\",\"revision\":6495670141929066462},\"id\":\"vuwkasiziesfuugh\",\"name\":\"uqfecj\",\"type\":\"ey\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkVMGroup response = manager.workloadNetworks() - .defineVMGroup("sgl") - .withExistingPrivateCloud("bqqqagwwrxa", "mz") - .withDisplayName("zezkhhltnjadh") - .withMembers(Arrays.asList("wjqo")) - .withRevision(5714887426369504206L) + .defineVMGroup("rpqaf") + .withExistingWorkloadNetwork("phwpnulaiywzej", "whslwkoj", "llndnpd") + .withProperties(new WorkloadNetworkVMGroupProperties().withDisplayName("gsnnf") + .withMembers(Arrays.asList("tefypococtfjgti")) + .withRevision(418846037583136212L)) .create(); - Assertions.assertEquals("iidlop", response.displayName()); - Assertions.assertEquals("wdpyq", response.members().get(0)); - Assertions.assertEquals(1864803261739962895L, response.revision()); + Assertions.assertEquals("ixjawrtm", response.properties().displayName()); + Assertions.assertEquals("myccx", response.properties().members().get(0)); + Assertions.assertEquals(6495670141929066462L, response.properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDhcpMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDhcpMockTests.java index bb207b061733..ab71aca93c15 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDhcpMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDhcpMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDeleteDhcp() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.workloadNetworks().deleteDhcp("ycxhxzgaztta", "o", "dvmfqhppub", com.azure.core.util.Context.NONE); + manager.workloadNetworks() + .deleteDhcp("eb", "ybpmzznrtffyaq", "tmhheioqa", "hvseufuqyrx", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsServiceMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsServiceMockTests.java index 8bc7015e678b..ffda2fd87834 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsServiceMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsServiceMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteDnsService() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.workloadNetworks() - .deleteDnsService("uhxu", "cbuewmrswnjlxuz", "hwpusxj", com.azure.core.util.Context.NONE); + .deleteDnsService("nomdrkywuhpsv", "uurutlwexxwlalni", "xzsrzpge", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsZoneMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsZoneMockTests.java index e0e008dff4dc..074870ec5b99 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsZoneMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteDnsZoneMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDeleteDnsZone() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.workloadNetworks() - .deleteDnsZone("ttvwkpqh", "penuy", "bqeqqekewvnqvcd", com.azure.core.util.Context.NONE); + manager.workloadNetworks().deleteDnsZone("mq", "bqqxlaj", "nw", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePortMirroringMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePortMirroringMockTests.java index 6b7c10c00d29..62afc0a137d7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePortMirroringMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePortMirroringMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeletePortMirroring() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.workloadNetworks() - .deletePortMirroring("qecrqctmxx", "tddmf", "huytxzvtzn", com.azure.core.util.Context.NONE); + .deletePortMirroring("utmzlbiojlvfhrbb", "neqvcwwyyurmo", "hppr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePublicIpMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePublicIPMockTests.java similarity index 68% rename from sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePublicIpMockTests.java rename to sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePublicIPMockTests.java index 83c043e71a99..daebc27f51c4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePublicIpMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeletePublicIPMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -15,9 +15,9 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class WorkloadNetworksDeletePublicIpMockTests { +public final class WorkloadNetworksDeletePublicIPMockTests { @Test - public void testDeletePublicIp() throws Exception { + public void testDeletePublicIP() throws Exception { String responseStr = "{}"; HttpClient httpClient @@ -25,9 +25,10 @@ public void testDeletePublicIp() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.workloadNetworks().deletePublicIp("hmwffplfmuv", "pckc", "rrvwey", com.azure.core.util.Context.NONE); + manager.workloadNetworks() + .deletePublicIP("bjwgnyfus", "zsvtuikzhajqgl", "fh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteSegmentMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteSegmentMockTests.java index 0cbb6449fd26..31427022fd85 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteSegmentMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteSegmentMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDeleteSegment() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.workloadNetworks().deleteSegment("yych", "nsjlpjrtws", "hv", com.azure.core.util.Context.NONE); + manager.workloadNetworks().deleteSegment("yqo", "mpqoxw", "o", "dbxiqx", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteVMGroupMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteVMGroupMockTests.java index ba1fdccc37c2..2e8272c988d0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteVMGroupMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksDeleteVMGroupMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteVMGroup() throws Exception { AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.workloadNetworks() - .deleteVMGroup("tjklntikyjuzk", "bqzolxr", "vhqjwtrhtgvg", com.azure.core.util.Context.NONE); + .deleteVMGroup("vuwcobiegstmnin", "jizcilnghgs", "ejjtbxqmul", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDhcpWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDhcpWithResponseMockTests.java index 79792a68f92b..0e93498cadc3 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDhcpWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDhcpWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcp; @@ -21,20 +21,20 @@ public final class WorkloadNetworksGetDhcpWithResponseMockTests { @Test public void testGetDhcpWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"dhcpType\":\"WorkloadNetworkDhcpEntity\",\"displayName\":\"rtvtiukye\",\"segments\":[\"nmnahmnx\",\"k\",\"jqirwrw\"],\"provisioningState\":\"Canceled\",\"revision\":6305545466909412711},\"id\":\"fhxwrsne\",\"name\":\"mozqv\",\"type\":\"ubqmamh\"}"; + = "{\"properties\":{\"dhcpType\":\"WorkloadNetworkDhcpEntity\",\"displayName\":\"xnmwmqtibxyijddt\",\"segments\":[\"ttadijae\",\"kmr\"],\"provisioningState\":\"Canceled\",\"revision\":2783014338857793552},\"id\":\"dzaapmudqme\",\"name\":\"wig\",\"type\":\"ibudqwy\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkDhcp response = manager.workloadNetworks() - .getDhcpWithResponse("yjwpfilkmkkh", "l", "dndviauogp", com.azure.core.util.Context.NONE) + .getDhcpWithResponse("fuzboyjathwtzolb", "emwmdxmebwjs", "jpahlxvea", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("rtvtiukye", response.properties().displayName()); - Assertions.assertEquals(6305545466909412711L, response.properties().revision()); + Assertions.assertEquals("xnmwmqtibxyijddt", response.properties().displayName()); + Assertions.assertEquals(2783014338857793552L, response.properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsServiceWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsServiceWithResponseMockTests.java index c1bb4cbe611e..2116f07ead84 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsServiceWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsServiceWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; @@ -22,24 +22,25 @@ public final class WorkloadNetworksGetDnsServiceWithResponseMockTests { @Test public void testGetDnsServiceWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"myccx\",\"dnsServiceIp\":\"hcoxov\",\"defaultDnsZone\":\"khenlus\",\"fqdnZones\":[\"dtjxtxrdcqt\"],\"logLevel\":\"ERROR\",\"status\":\"FAILURE\",\"provisioningState\":\"Updating\",\"revision\":7902462386564610802},\"id\":\"lvyjtcvuwkas\",\"name\":\"zies\",\"type\":\"uughtuqfecjxeyg\"}"; + = "{\"properties\":{\"displayName\":\"if\",\"dnsServiceIp\":\"hmkdasvfl\",\"defaultDnsZone\":\"bxcudchx\",\"fqdnZones\":[\"boldforobwj\"],\"logLevel\":\"ERROR\",\"status\":\"FAILURE\",\"provisioningState\":\"Building\",\"revision\":279663713560569136},\"id\":\"acqpbtuodxesza\",\"name\":\"belawumuaslzkwr\",\"type\":\"woycqucwyha\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkDnsService response = manager.workloadNetworks() - .getDnsServiceWithResponse("nszonwpngaj", "n", "ixjawrtm", com.azure.core.util.Context.NONE) + .getDnsServiceWithResponse("lvidizozs", "bccxjmonfdgn", "n", "ypuuwwltvuqjctze", + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("myccx", response.displayName()); - Assertions.assertEquals("hcoxov", response.dnsServiceIp()); - Assertions.assertEquals("khenlus", response.defaultDnsZone()); - Assertions.assertEquals("dtjxtxrdcqt", response.fqdnZones().get(0)); - Assertions.assertEquals(DnsServiceLogLevelEnum.ERROR, response.logLevel()); - Assertions.assertEquals(7902462386564610802L, response.revision()); + Assertions.assertEquals("if", response.properties().displayName()); + Assertions.assertEquals("hmkdasvfl", response.properties().dnsServiceIp()); + Assertions.assertEquals("bxcudchx", response.properties().defaultDnsZone()); + Assertions.assertEquals("boldforobwj", response.properties().fqdnZones().get(0)); + Assertions.assertEquals(DnsServiceLogLevelEnum.ERROR, response.properties().logLevel()); + Assertions.assertEquals(279663713560569136L, response.properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsZoneWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsZoneWithResponseMockTests.java index 0d8b396066c2..dc8ef54fc119 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsZoneWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetDnsZoneWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZone; @@ -21,24 +21,24 @@ public final class WorkloadNetworksGetDnsZoneWithResponseMockTests { @Test public void testGetDnsZoneWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"bnfxofvc\",\"domain\":[\"dirazf\",\"xejw\"],\"dnsServerIps\":[\"dujtmvcope\",\"c\",\"jurbuhhlkyqltqsr\",\"gtuwkff\"],\"sourceIp\":\"ktsysidfvclglxn\",\"dnsServices\":3628505387353206788,\"provisioningState\":\"Updating\",\"revision\":5581473704457781073},\"id\":\"ogsf\",\"name\":\"kayi\",\"type\":\"nsharujtjiqxfzyj\"}"; + = "{\"properties\":{\"displayName\":\"ctfnmdxotng\",\"domain\":[\"ugeyzihgrkyuiza\",\"snmfpphojeevy\"],\"dnsServerIps\":[\"sgzfczbg\"],\"sourceIp\":\"fgbegl\",\"dnsServices\":7540927851450246514,\"provisioningState\":\"Deleting\",\"revision\":7412816327094264147},\"id\":\"nlu\",\"name\":\"nkrrf\",\"type\":\"eeebtijvacv\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkDnsZone response = manager.workloadNetworks() - .getDnsZoneWithResponse("ueio", "kjbsah", "tdtpdelqacslmo", com.azure.core.util.Context.NONE) + .getDnsZoneWithResponse("rzpasccbiuimzdly", "dfqwmkyoq", "fdvruz", "lzo", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("bnfxofvc", response.displayName()); - Assertions.assertEquals("dirazf", response.domain().get(0)); - Assertions.assertEquals("dujtmvcope", response.dnsServerIps().get(0)); - Assertions.assertEquals("ktsysidfvclglxn", response.sourceIp()); - Assertions.assertEquals(3628505387353206788L, response.dnsServices()); - Assertions.assertEquals(5581473704457781073L, response.revision()); + Assertions.assertEquals("ctfnmdxotng", response.properties().displayName()); + Assertions.assertEquals("ugeyzihgrkyuiza", response.properties().domain().get(0)); + Assertions.assertEquals("sgzfczbg", response.properties().dnsServerIps().get(0)); + Assertions.assertEquals("fgbegl", response.properties().sourceIp()); + Assertions.assertEquals(7540927851450246514L, response.properties().dnsServices()); + Assertions.assertEquals(7412816327094264147L, response.properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetGatewayWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetGatewayWithResponseMockTests.java index 11d053a05448..373b27784a10 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetGatewayWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetGatewayWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkGateway; @@ -21,19 +21,19 @@ public final class WorkloadNetworksGetGatewayWithResponseMockTests { @Test public void testGetGatewayWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Building\",\"displayName\":\"mtrwah\",\"path\":\"mu\"},\"id\":\"tb\",\"name\":\"r\",\"type\":\"lrohkpig\"}"; + = "{\"properties\":{\"provisioningState\":\"Updating\",\"displayName\":\"pundmbxhug\",\"path\":\"jkavl\"},\"id\":\"rb\",\"name\":\"ftpmdtzfjltfv\",\"type\":\"zcyjtot\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkGateway response = manager.workloadNetworks() - .getGatewayWithResponse("nchrszizoyu", "lyetndnbfqygg", "g", com.azure.core.util.Context.NONE) + .getGatewayWithResponse("nlj", "nmgixh", "mavmq", "oudorhcgyyp", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("mtrwah", response.displayName()); + Assertions.assertEquals("pundmbxhug", response.properties().displayName()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPortMirroringWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPortMirroringWithResponseMockTests.java index ee522e181c1e..4d51a0b572b8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPortMirroringWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPortMirroringWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; @@ -22,23 +22,23 @@ public final class WorkloadNetworksGetPortMirroringWithResponseMockTests { @Test public void testGetPortMirroringWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"q\",\"direction\":\"EGRESS\",\"source\":\"renlvhhtklnvnafv\",\"destination\":\"yfedevjbo\",\"status\":\"FAILURE\",\"provisioningState\":\"Deleting\",\"revision\":41375191452971631},\"id\":\"khminqcymc\",\"name\":\"ngnbdxxew\",\"type\":\"ninvudbchaqdt\"}"; + = "{\"properties\":{\"displayName\":\"xbkwv\",\"direction\":\"INGRESS\",\"source\":\"v\",\"destination\":\"bzdixzmq\",\"status\":\"FAILURE\",\"provisioningState\":\"Updating\",\"revision\":2317307583598027540},\"id\":\"hewjptmcgsbost\",\"name\":\"eln\",\"type\":\"la\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkPortMirroring response = manager.workloadNetworks() - .getPortMirroringWithResponse("evrh", "ljyoogwx", "nsduugwbsre", com.azure.core.util.Context.NONE) + .getPortMirroringWithResponse("ygvkzqkjj", "okbzef", "zrxcczurt", "e", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("q", response.displayName()); - Assertions.assertEquals(PortMirroringDirectionEnum.EGRESS, response.direction()); - Assertions.assertEquals("renlvhhtklnvnafv", response.source()); - Assertions.assertEquals("yfedevjbo", response.destination()); - Assertions.assertEquals(41375191452971631L, response.revision()); + Assertions.assertEquals("xbkwv", response.properties().displayName()); + Assertions.assertEquals(PortMirroringDirectionEnum.INGRESS, response.properties().direction()); + Assertions.assertEquals("v", response.properties().source()); + Assertions.assertEquals("bzdixzmq", response.properties().destination()); + Assertions.assertEquals(2317307583598027540L, response.properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPublicIpWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPublicIPWithResponseMockTests.java similarity index 57% rename from sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPublicIpWithResponseMockTests.java rename to sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPublicIPWithResponseMockTests.java index 10dfecadc420..d9a0daf9fbac 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPublicIpWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetPublicIPWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIp; @@ -17,24 +17,25 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class WorkloadNetworksGetPublicIpWithResponseMockTests { +public final class WorkloadNetworksGetPublicIPWithResponseMockTests { @Test - public void testGetPublicIpWithResponse() throws Exception { + public void testGetPublicIPWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"fg\",\"numberOfPublicIPs\":1524478115165309750,\"publicIPBlock\":\"pcbbnzqcykna\",\"provisioningState\":\"Deleting\"},\"id\":\"yuicdhzbdy\",\"name\":\"wwgbdv\",\"type\":\"bid\"}"; + = "{\"properties\":{\"displayName\":\"exaoguya\",\"numberOfPublicIPs\":3143366093760834812,\"publicIPBlock\":\"daultxijjumfq\",\"provisioningState\":\"Deleting\"},\"id\":\"nqnm\",\"name\":\"jng\",\"type\":\"qdqx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkPublicIp response = manager.workloadNetworks() - .getPublicIpWithResponse("vfxzopjh", "zxlioh", "d", com.azure.core.util.Context.NONE) + .getPublicIPWithResponse("wexjkmfxapjwogq", "nobpudcdabtqwpw", "awbzasqb", "clj", + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("fg", response.displayName()); - Assertions.assertEquals(1524478115165309750L, response.numberOfPublicIPs()); + Assertions.assertEquals("exaoguya", response.properties().displayName()); + Assertions.assertEquals(3143366093760834812L, response.properties().numberOfPublicIPs()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetSegmentWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetSegmentWithResponseMockTests.java index 2007fb126b20..a3bc9df11f83 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetSegmentWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetSegmentWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; @@ -21,24 +21,23 @@ public final class WorkloadNetworksGetSegmentWithResponseMockTests { @Test public void testGetSegmentWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"stmhqykizmd\",\"connectedGateway\":\"aoaf\",\"subnet\":{\"dhcpRanges\":[\"v\",\"xmycjimryvwgcw\"],\"gatewayAddress\":\"bmzgwes\"},\"portVif\":[{\"portName\":\"wefohecbvo\"},{\"portName\":\"ndyqleal\"}],\"status\":\"FAILURE\",\"provisioningState\":\"Deleting\",\"revision\":5841187732800294671},\"id\":\"wkxxpvbrdfjmzs\",\"name\":\"zfhotlh\",\"type\":\"k\"}"; + = "{\"properties\":{\"displayName\":\"opmx\",\"connectedGateway\":\"nwcl\",\"subnet\":{\"dhcpRanges\":[\"dexxmlfmkqscazua\",\"xtzx\",\"uamwabzxrvxc\"],\"gatewayAddress\":\"hsphaivmxyas\"},\"portVif\":[{\"portName\":\"sgzwywakoihknsm\"},{\"portName\":\"lmljhlnymzotq\"},{\"portName\":\"yuzcbmqqvxmvw\"},{\"portName\":\"tayx\"}],\"status\":\"SUCCESS\",\"provisioningState\":\"Deleting\",\"revision\":6087848653261385297},\"id\":\"zqn\",\"name\":\"cvsql\",\"type\":\"nzoibgsxgnx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkSegment response = manager.workloadNetworks() - .getSegmentWithResponse("aabeolhbhlvbmxuq", "bsxtkcudfbsfarfs", "owlkjxnqpv", - com.azure.core.util.Context.NONE) + .getSegmentWithResponse("fmvigorqjbttzh", "aglkafhon", "juj", "ickpz", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("stmhqykizmd", response.displayName()); - Assertions.assertEquals("aoaf", response.connectedGateway()); - Assertions.assertEquals("v", response.subnet().dhcpRanges().get(0)); - Assertions.assertEquals("bmzgwes", response.subnet().gatewayAddress()); - Assertions.assertEquals(5841187732800294671L, response.revision()); + Assertions.assertEquals("opmx", response.properties().displayName()); + Assertions.assertEquals("nwcl", response.properties().connectedGateway()); + Assertions.assertEquals("dexxmlfmkqscazua", response.properties().subnet().dhcpRanges().get(0)); + Assertions.assertEquals("hsphaivmxyas", response.properties().subnet().gatewayAddress()); + Assertions.assertEquals(6087848653261385297L, response.properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVMGroupWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVMGroupWithResponseMockTests.java index 8d288d6e8b53..8912b22ae913 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVMGroupWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVMGroupWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroup; @@ -21,21 +21,21 @@ public final class WorkloadNetworksGetVMGroupWithResponseMockTests { @Test public void testGetVMGroupWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"vjfn\",\"members\":[\"vlwyzg\"],\"status\":\"FAILURE\",\"provisioningState\":\"Succeeded\",\"revision\":7387831702993633483},\"id\":\"fojuidjpuuyj\",\"name\":\"c\",\"type\":\"jikzoeovvtzej\"}"; + = "{\"properties\":{\"displayName\":\"snptfujgicgaao\",\"members\":[\"taqutdewem\",\"swvr\",\"unzzjgehk\"],\"status\":\"SUCCESS\",\"provisioningState\":\"Succeeded\",\"revision\":1525323814581678348},\"id\":\"kffqyinljqepqwh\",\"name\":\"xmonstshi\",\"type\":\"xgvelfclduccbird\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkVMGroup response = manager.workloadNetworks() - .getVMGroupWithResponse("sfuztlvtmv", "gbwidqlvh", "koveof", com.azure.core.util.Context.NONE) + .getVMGroupWithResponse("xfdeqvhpsyl", "ksh", "bffmbmxz", "rgywwp", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vjfn", response.displayName()); - Assertions.assertEquals("vlwyzg", response.members().get(0)); - Assertions.assertEquals(7387831702993633483L, response.revision()); + Assertions.assertEquals("snptfujgicgaao", response.properties().displayName()); + Assertions.assertEquals("taqutdewem", response.properties().members().get(0)); + Assertions.assertEquals(1525323814581678348L, response.properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVirtualMachineWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVirtualMachineWithResponseMockTests.java index 395224f8ec74..2042b5d1ea14 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVirtualMachineWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetVirtualMachineWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachine; @@ -21,19 +21,20 @@ public final class WorkloadNetworksGetVirtualMachineWithResponseMockTests { @Test public void testGetVirtualMachineWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Deleting\",\"displayName\":\"tjewlpxuzzj\",\"vmType\":\"SERVICE\"},\"id\":\"fqyhqoto\",\"name\":\"hiqakydiwfbrk\",\"type\":\"pzdqtvhcspod\"}"; + = "{\"properties\":{\"provisioningState\":\"Failed\",\"displayName\":\"spofapvuhry\",\"vmType\":\"SERVICE\"},\"id\":\"frzgbzjed\",\"name\":\"st\",\"type\":\"vnlvxbcuiiznktwf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetworkVirtualMachine response = manager.workloadNetworks() - .getVirtualMachineWithResponse("jk", "mykyujxsglhs", "rryejylmbkzudnig", com.azure.core.util.Context.NONE) + .getVirtualMachineWithResponse("izvcjfe", "isdju", "ggbqi", "kxkbsazgakgacyr", + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("tjewlpxuzzj", response.displayName()); + Assertions.assertEquals("spofapvuhry", response.properties().displayName()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetWithResponseMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetWithResponseMockTests.java index f53a8ab48b98..71e1f14787dd 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetWithResponseMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetwork; @@ -20,17 +20,17 @@ public final class WorkloadNetworksGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Updating\"},\"id\":\"uiyjib\",\"name\":\"zphdugneiknp\",\"type\":\"oxgjiuqhibt\"}"; + = "{\"properties\":{\"provisioningState\":\"Canceled\"},\"id\":\"riz\",\"name\":\"tpwb\",\"type\":\"a\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkloadNetwork response = manager.workloadNetworks() - .getWithResponse("jmxmcuqud", "cvclxynpdk", com.azure.core.util.Context.NONE) + .getWithResponse("tillucbiqtg", "q", "hm", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDhcpMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDhcpMockTests.java index c2d98f9b8b23..9c03c2ed163d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDhcpMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDhcpMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcp; @@ -22,19 +22,19 @@ public final class WorkloadNetworksListDhcpMockTests { @Test public void testListDhcp() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"dhcpType\":\"WorkloadNetworkDhcpEntity\",\"displayName\":\"xxgewpk\",\"segments\":[\"ylkmqp\",\"o\",\"hlfbcgwgc\",\"oxoebqi\"],\"provisioningState\":\"Building\",\"revision\":4976347516464596123},\"id\":\"fujqlafcba\",\"name\":\"hpzpo\",\"type\":\"o\"}]}"; + = "{\"value\":[{\"properties\":{\"dhcpType\":\"WorkloadNetworkDhcpEntity\",\"displayName\":\"ajoylhjl\",\"segments\":[\"y\",\"primr\"],\"provisioningState\":\"Canceled\",\"revision\":8340931436954401177},\"id\":\"jme\",\"name\":\"slstvasy\",\"type\":\"wxdzaumweoohgu\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.workloadNetworks().listDhcp("z", "pqwjedm", com.azure.core.util.Context.NONE); + = manager.workloadNetworks().listDhcp("llibphbqzmizak", "kan", "jpdn", com.azure.core.util.Context.NONE); - Assertions.assertEquals("xxgewpk", response.iterator().next().properties().displayName()); - Assertions.assertEquals(4976347516464596123L, response.iterator().next().properties().revision()); + Assertions.assertEquals("ajoylhjl", response.iterator().next().properties().displayName()); + Assertions.assertEquals(8340931436954401177L, response.iterator().next().properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServiceMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServiceMockTests.java new file mode 100644 index 000000000000..ad84e24d52fa --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServiceMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.avs.AvsManager; +import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsService; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkloadNetworksListDnsServiceMockTests { + @Test + public void testListDnsService() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"displayName\":\"zexrxzbujrt\",\"dnsServiceIp\":\"qvwre\",\"defaultDnsZone\":\"h\",\"fqdnZones\":[\"nzonzl\",\"piqywnc\",\"jtszcof\",\"zehtdhgb\"],\"logLevel\":\"FATAL\",\"status\":\"FAILURE\",\"provisioningState\":\"Updating\",\"revision\":5299106895755673529},\"id\":\"rvzmlovuana\",\"name\":\"hcxlpm\",\"type\":\"erbdk\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + AvsManager manager = AvsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.workloadNetworks() + .listDnsService("dlcgqlsismjqfr", "dgamquhiosrsj", "ivfcdisyirnx", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("zexrxzbujrt", response.iterator().next().properties().displayName()); + Assertions.assertEquals("qvwre", response.iterator().next().properties().dnsServiceIp()); + Assertions.assertEquals("h", response.iterator().next().properties().defaultDnsZone()); + Assertions.assertEquals("nzonzl", response.iterator().next().properties().fqdnZones().get(0)); + Assertions.assertEquals(DnsServiceLogLevelEnum.FATAL, response.iterator().next().properties().logLevel()); + Assertions.assertEquals(5299106895755673529L, response.iterator().next().properties().revision()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServicesMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServicesMockTests.java deleted file mode 100644 index 579156dc1b72..000000000000 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsServicesMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.avs.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.avs.AvsManager; -import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; -import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsService; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkloadNetworksListDnsServicesMockTests { - @Test - public void testListDnsServices() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"juahokqto\",\"dnsServiceIp\":\"auxofshfph\",\"defaultDnsZone\":\"nulaiywzejywhsl\",\"fqdnZones\":[\"jpllndnpdwrpq\",\"fgf\",\"gsnnf\",\"yetefyp\"],\"logLevel\":\"WARNING\",\"status\":\"SUCCESS\",\"provisioningState\":\"Building\",\"revision\":3540682391497785966},\"id\":\"rjvzuyt\",\"name\":\"rmlmuowo\",\"type\":\"bauiropi\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AvsManager manager = AvsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.workloadNetworks().listDnsServices("w", "epdfgkmtdherng", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("juahokqto", response.iterator().next().displayName()); - Assertions.assertEquals("auxofshfph", response.iterator().next().dnsServiceIp()); - Assertions.assertEquals("nulaiywzejywhsl", response.iterator().next().defaultDnsZone()); - Assertions.assertEquals("jpllndnpdwrpq", response.iterator().next().fqdnZones().get(0)); - Assertions.assertEquals(DnsServiceLogLevelEnum.WARNING, response.iterator().next().logLevel()); - Assertions.assertEquals(3540682391497785966L, response.iterator().next().revision()); - } -} diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsZonesMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsZonesMockTests.java index 3096cc96bca5..5ca58f3efbb5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsZonesMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListDnsZonesMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZone; @@ -22,23 +22,23 @@ public final class WorkloadNetworksListDnsZonesMockTests { @Test public void testListDnsZones() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"coi\",\"domain\":[\"xncnwfe\",\"bnwgfmxj\",\"cgbjbgdlfgt\"],\"dnsServerIps\":[\"naquflq\",\"ctqhamzjrwdk\"],\"sourceIp\":\"eqyj\",\"dnsServices\":1498559377448823995,\"provisioningState\":\"Deleting\",\"revision\":345184952591350162},\"id\":\"zantkwceg\",\"name\":\"amlbnseqacjjvpil\",\"type\":\"uooqjagmdit\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"cxkjibnxmysuxswq\",\"domain\":[\"vl\",\"ijpstte\",\"oqq\",\"wcyyufmhruncu\"],\"dnsServerIps\":[\"spkcdqzh\",\"ctddun\",\"ndy\",\"pchrqbn\"],\"sourceIp\":\"rcgegydcwboxjum\",\"dnsServices\":4609344180627239101,\"provisioningState\":\"Updating\",\"revision\":778654076106405962},\"id\":\"iouaubrjt\",\"name\":\"oq\",\"type\":\"fuojrngif\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.workloadNetworks().listDnsZones("aqehg", "dohzjq", com.azure.core.util.Context.NONE); + = manager.workloadNetworks().listDnsZones("q", "yb", "wwpgdakchzyvlixq", com.azure.core.util.Context.NONE); - Assertions.assertEquals("coi", response.iterator().next().displayName()); - Assertions.assertEquals("xncnwfe", response.iterator().next().domain().get(0)); - Assertions.assertEquals("naquflq", response.iterator().next().dnsServerIps().get(0)); - Assertions.assertEquals("eqyj", response.iterator().next().sourceIp()); - Assertions.assertEquals(1498559377448823995L, response.iterator().next().dnsServices()); - Assertions.assertEquals(345184952591350162L, response.iterator().next().revision()); + Assertions.assertEquals("cxkjibnxmysuxswq", response.iterator().next().properties().displayName()); + Assertions.assertEquals("vl", response.iterator().next().properties().domain().get(0)); + Assertions.assertEquals("spkcdqzh", response.iterator().next().properties().dnsServerIps().get(0)); + Assertions.assertEquals("rcgegydcwboxjum", response.iterator().next().properties().sourceIp()); + Assertions.assertEquals(4609344180627239101L, response.iterator().next().properties().dnsServices()); + Assertions.assertEquals(778654076106405962L, response.iterator().next().properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListGatewaysMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListGatewaysMockTests.java index 7c9579a9fcce..d09819a4cdff 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListGatewaysMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListGatewaysMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkGateway; @@ -22,18 +22,18 @@ public final class WorkloadNetworksListGatewaysMockTests { @Test public void testListGateways() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"displayName\":\"vvi\",\"path\":\"cgx\"},\"id\":\"csserxht\",\"name\":\"soxhlwntsjgqr\",\"type\":\"xypruuuy\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"displayName\":\"r\",\"path\":\"hriypoqeyhlqhy\"},\"id\":\"rlpyznuciqdsmexi\",\"name\":\"tdfuxt\",\"type\":\"asiibmiybnnust\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.workloadNetworks().listGateways("guaucmfdjwnla", "punj", com.azure.core.util.Context.NONE); + PagedIterable response = manager.workloadNetworks() + .listGateways("acevehjkuyx", "afgaoqlt", "aeylinm", com.azure.core.util.Context.NONE); - Assertions.assertEquals("vvi", response.iterator().next().displayName()); + Assertions.assertEquals("r", response.iterator().next().properties().displayName()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListMockTests.java index 0cb9edefac71..907bb087c5a9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetwork; @@ -21,17 +21,17 @@ public final class WorkloadNetworksListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\"},\"id\":\"otangcfhnykzc\",\"name\":\"gswvxwlmzqwm\",\"type\":\"tx\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\"},\"id\":\"afidltugsres\",\"name\":\"kssjhoiftxfk\",\"type\":\"wegprh\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.workloadNetworks().list("thnwpzte", "ovmribiattg", com.azure.core.util.Context.NONE); + = manager.workloadNetworks().list("ppipifhpfeoa", "vgcxtx", com.azure.core.util.Context.NONE); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPortMirroringMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPortMirroringMockTests.java index d359834dff6b..b1d28306c76b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPortMirroringMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPortMirroringMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; @@ -23,22 +23,23 @@ public final class WorkloadNetworksListPortMirroringMockTests { @Test public void testListPortMirroring() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"nhg\",\"direction\":\"BIDIRECTIONAL\",\"source\":\"ynfsvkhgbvqtan\",\"destination\":\"fdlpukhpyr\",\"status\":\"SUCCESS\",\"provisioningState\":\"Failed\",\"revision\":1916878919574088822},\"id\":\"gkhnmgbrouxddbh\",\"name\":\"hpfpazjzoywjxhp\",\"type\":\"ulontacnpqwteht\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"yibcy\",\"direction\":\"INGRESS\",\"source\":\"gqcwdhohsdtmc\",\"destination\":\"sufco\",\"status\":\"SUCCESS\",\"provisioningState\":\"Updating\",\"revision\":7808079684010366581},\"id\":\"uapcvhdbevwqqxe\",\"name\":\"skonqzinkf\",\"type\":\"bgbzbowxeqoclj\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.workloadNetworks() - .listPortMirroring("fusuckzmkwklsno", "axmqeqal", com.azure.core.util.Context.NONE); + .listPortMirroring("vopvp", "dbzqgqqihed", "vqwt", com.azure.core.util.Context.NONE); - Assertions.assertEquals("nhg", response.iterator().next().displayName()); - Assertions.assertEquals(PortMirroringDirectionEnum.BIDIRECTIONAL, response.iterator().next().direction()); - Assertions.assertEquals("ynfsvkhgbvqtan", response.iterator().next().source()); - Assertions.assertEquals("fdlpukhpyr", response.iterator().next().destination()); - Assertions.assertEquals(1916878919574088822L, response.iterator().next().revision()); + Assertions.assertEquals("yibcy", response.iterator().next().properties().displayName()); + Assertions.assertEquals(PortMirroringDirectionEnum.INGRESS, + response.iterator().next().properties().direction()); + Assertions.assertEquals("gqcwdhohsdtmc", response.iterator().next().properties().source()); + Assertions.assertEquals("sufco", response.iterator().next().properties().destination()); + Assertions.assertEquals(7808079684010366581L, response.iterator().next().properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPublicIPsMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPublicIPsMockTests.java index 056e5f48a0a2..f260d3fd45d1 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPublicIPsMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListPublicIPsMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIp; @@ -22,19 +22,19 @@ public final class WorkloadNetworksListPublicIPsMockTests { @Test public void testListPublicIPs() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"yo\",\"numberOfPublicIPs\":8001190211178708850,\"publicIPBlock\":\"uuxvnsasbcry\",\"provisioningState\":\"Succeeded\"},\"id\":\"zrxklobd\",\"name\":\"nazpmk\",\"type\":\"lmv\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"pcpil\",\"numberOfPublicIPs\":326883131469492313,\"publicIPBlock\":\"vechndbnwiehole\",\"provisioningState\":\"Building\"},\"id\":\"uubw\",\"name\":\"fqsfa\",\"type\":\"aqtferr\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.workloadNetworks() - .listPublicIPs("pxbannovvoxc", "ytprwnwvroev", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.workloadNetworks().listPublicIPs("rsnm", "k", "yzejnhlbk", com.azure.core.util.Context.NONE); - Assertions.assertEquals("yo", response.iterator().next().displayName()); - Assertions.assertEquals(8001190211178708850L, response.iterator().next().numberOfPublicIPs()); + Assertions.assertEquals("pcpil", response.iterator().next().properties().displayName()); + Assertions.assertEquals(326883131469492313L, response.iterator().next().properties().numberOfPublicIPs()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListSegmentsMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListSegmentsMockTests.java index 10dd6bcf3369..7b64b86a2636 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListSegmentsMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListSegmentsMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; @@ -22,22 +22,22 @@ public final class WorkloadNetworksListSegmentsMockTests { @Test public void testListSegments() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"hbragapyyr\",\"connectedGateway\":\"svbpavbopfppdbwn\",\"subnet\":{\"dhcpRanges\":[\"hxkumasjcaacfdmm\",\"pugmehqe\"],\"gatewayAddress\":\"u\"},\"portVif\":[{\"portName\":\"ehewhoqh\"}],\"status\":\"SUCCESS\",\"provisioningState\":\"Deleting\",\"revision\":4907564329393150795},\"id\":\"eaclgschorimk\",\"name\":\"srrm\",\"type\":\"ucsofldpuviyf\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"goeiybbabpfhvfsl\",\"connectedGateway\":\"ntjlr\",\"subnet\":{\"dhcpRanges\":[\"s\",\"yrio\",\"vzidsxwaab\"],\"gatewayAddress\":\"ifrygzn\"},\"portVif\":[{\"portName\":\"ri\"}],\"status\":\"SUCCESS\",\"provisioningState\":\"Succeeded\",\"revision\":8575483333509149433},\"id\":\"lhslnelxieixyn\",\"name\":\"lxecwcrojphslh\",\"type\":\"awjutifd\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.workloadNetworks().listSegments("xoy", "ukphaimmoiroq", com.azure.core.util.Context.NONE); + = manager.workloadNetworks().listSegments("l", "qryxyn", "nzrdpsovwxz", com.azure.core.util.Context.NONE); - Assertions.assertEquals("hbragapyyr", response.iterator().next().displayName()); - Assertions.assertEquals("svbpavbopfppdbwn", response.iterator().next().connectedGateway()); - Assertions.assertEquals("hxkumasjcaacfdmm", response.iterator().next().subnet().dhcpRanges().get(0)); - Assertions.assertEquals("u", response.iterator().next().subnet().gatewayAddress()); - Assertions.assertEquals(4907564329393150795L, response.iterator().next().revision()); + Assertions.assertEquals("goeiybbabpfhvfsl", response.iterator().next().properties().displayName()); + Assertions.assertEquals("ntjlr", response.iterator().next().properties().connectedGateway()); + Assertions.assertEquals("s", response.iterator().next().properties().subnet().dhcpRanges().get(0)); + Assertions.assertEquals("ifrygzn", response.iterator().next().properties().subnet().gatewayAddress()); + Assertions.assertEquals(8575483333509149433L, response.iterator().next().properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVMGroupsMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVMGroupsMockTests.java index a53bf8fe3e75..9a7c43dc922d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVMGroupsMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVMGroupsMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroup; @@ -22,20 +22,20 @@ public final class WorkloadNetworksListVMGroupsMockTests { @Test public void testListVMGroups() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"fpubntnbatz\",\"members\":[\"sowsaael\"],\"status\":\"FAILURE\",\"provisioningState\":\"Building\",\"revision\":6305699352283667401},\"id\":\"lrvkmjc\",\"name\":\"mjvlgfgg\",\"type\":\"vkyylizrzbjpsf\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"wbuqn\",\"members\":[\"hzfylsgcrpfbc\",\"nezzcezelfwyfwlw\",\"jwetnpsihcla\"],\"status\":\"SUCCESS\",\"provisioningState\":\"Deleting\",\"revision\":1594393905994051179},\"id\":\"sqqw\",\"name\":\"tcmwqkchc\",\"type\":\"waxfewzjkj\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.workloadNetworks().listVMGroups("qaxsipietgbebjf", "lbmoichd", com.azure.core.util.Context.NONE); + = manager.workloadNetworks().listVMGroups("nsnvpd", "bmikost", "z", com.azure.core.util.Context.NONE); - Assertions.assertEquals("fpubntnbatz", response.iterator().next().displayName()); - Assertions.assertEquals("sowsaael", response.iterator().next().members().get(0)); - Assertions.assertEquals(6305699352283667401L, response.iterator().next().revision()); + Assertions.assertEquals("wbuqn", response.iterator().next().properties().displayName()); + Assertions.assertEquals("hzfylsgcrpfbc", response.iterator().next().properties().members().get(0)); + Assertions.assertEquals(1594393905994051179L, response.iterator().next().properties().revision()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVirtualMachinesMockTests.java b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVirtualMachinesMockTests.java index 32b3a29da206..0c91dac684be 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVirtualMachinesMockTests.java +++ b/sdk/avs/azure-resourcemanager-avs/src/test/java/com/azure/resourcemanager/avs/generated/WorkloadNetworksListVirtualMachinesMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.avs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.avs.AvsManager; import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachine; @@ -22,18 +22,18 @@ public final class WorkloadNetworksListVirtualMachinesMockTests { @Test public void testListVirtualMachines() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"displayName\":\"jgl\",\"vmType\":\"EDGE\"},\"id\":\"yzlwh\",\"name\":\"memhooclutnpq\",\"type\":\"emc\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"embnkbw\",\"vmType\":\"EDGE\"},\"id\":\"kdi\",\"name\":\"qihebw\",\"type\":\"swbzuwfmdurage\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AvsManager manager = AvsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.workloadNetworks() - .listVirtualMachines("uic", "hvtrrmhwrbfdpyf", com.azure.core.util.Context.NONE); + .listVirtualMachines("iiqbi", "htmwwinh", "hfqpofv", com.azure.core.util.Context.NONE); - Assertions.assertEquals("jgl", response.iterator().next().displayName()); + Assertions.assertEquals("embnkbw", response.iterator().next().properties().displayName()); } } diff --git a/sdk/avs/azure-resourcemanager-avs/tsp-location.yaml b/sdk/avs/azure-resourcemanager-avs/tsp-location.yaml new file mode 100644 index 000000000000..df2d9d4fa3ab --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/vmware/Microsoft.AVS.Management +commit: 8f96416ab263af7270f93ed449c80cede44fd27a +repo: Azure/azure-rest-api-specs +additionalDirectories: