From a0d176985835f6dc2957406cf91fa63d2b96e2b9 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 28 May 2026 11:01:35 +0000 Subject: [PATCH 1/2] Configurations: 'specification/devtestlabs/resource-manager/Microsoft.DevTestLab/DevTestLabs/tspconfig.yaml', API Version: 2018-09-15, SDK Release Type: stable, and CommitSHA: '589ab73777dd977a411b60321a991e48a58adeb9' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6364340 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- eng/versioning/version_client.txt | 2 +- .../CHANGELOG.md | 520 ++- .../README.md | 10 +- .../SAMPLE.md | 481 +-- .../azure-resourcemanager-devtestlabs/pom.xml | 10 +- .../devtestlabs/DevTestLabsManager.java | 157 +- .../fluent/ArmTemplatesClient.java | 64 +- .../fluent/ArtifactSourcesClient.java | 108 +- .../devtestlabs/fluent/ArtifactsClient.java | 68 +- .../devtestlabs/fluent/CostsClient.java | 10 +- .../fluent/CustomImagesClient.java | 138 +- ....java => DevTestLabsManagementClient.java} | 82 +- .../devtestlabs/fluent/DisksClient.java | 214 +- .../fluent/EnvironmentsClient.java | 168 +- .../devtestlabs/fluent/FormulasClient.java | 114 +- .../fluent/GalleryImagesClient.java | 8 +- .../fluent/GlobalSchedulesClient.java | 190 +- .../devtestlabs/fluent/LabsClient.java | 202 +- .../fluent/NotificationChannelsClient.java | 112 +- .../devtestlabs/fluent/OperationsClient.java | 2 +- .../devtestlabs/fluent/PoliciesClient.java | 160 +- .../devtestlabs/fluent/PolicySetsClient.java | 10 +- .../fluent/ProviderOperationsClient.java | 18 +- .../devtestlabs/fluent/SchedulesClient.java | 172 +- .../devtestlabs/fluent/SecretsClient.java | 152 +- .../fluent/ServiceFabricSchedulesClient.java | 234 +- .../fluent/ServiceFabricsClient.java | 228 +- .../fluent/ServiceRunnersClient.java | 14 +- .../devtestlabs/fluent/UsersClient.java | 126 +- .../fluent/VirtualMachineSchedulesClient.java | 192 +- .../fluent/VirtualMachinesClient.java | 218 +- .../fluent/VirtualNetworksClient.java | 120 +- .../models/ApplicableScheduleInner.java | 138 +- .../ApplicableSchedulePropertiesInner.java | 45 +- .../fluent/models/ArmTemplateInfoInner.java | 57 +- .../fluent/models/ArmTemplateInner.java | 111 +- .../fluent/models/ArmTemplateProperties.java | 23 +- .../fluent/models/ArtifactInner.java | 110 +- .../fluent/models/ArtifactProperties.java | 20 +- .../fluent/models/ArtifactSourceInner.java | 123 +- .../models/ArtifactSourceProperties.java | 10 +- .../fluent/models/CustomImageInner.java | 123 +- .../fluent/models/CustomImageProperties.java | 22 +- .../devtestlabs/fluent/models/DiskInner.java | 126 +- .../fluent/models/DiskProperties.java | 10 +- .../fluent/models/DtlEnvironmentInner.java | 127 +- .../fluent/models/EnvironmentProperties.java | 13 +- .../models/EvaluatePoliciesResponseInner.java | 30 +- .../fluent/models/FormulaInner.java | 126 +- .../fluent/models/FormulaProperties.java | 16 +- .../fluent/models/GalleryImageInner.java | 211 +- .../fluent/models/GalleryImageProperties.java | 96 +- .../GenerateUploadUriResponseInner.java | 27 +- .../fluent/models/LabCostInner.java | 122 +- .../fluent/models/LabCostProperties.java | 22 +- .../devtestlabs/fluent/models/LabInner.java | 118 +- .../fluent/models/LabProperties.java | 16 +- .../fluent/models/LabVhdInner.java | 27 +- ...ualMachineCreationParameterProperties.java | 28 +- .../fluent/models/LabVirtualMachineInner.java | 123 +- .../LabVirtualMachinePropertiesInner.java | 34 +- .../models/NotificationChannelInner.java | 123 +- .../models/NotificationChannelProperties.java | 13 +- .../fluent/models/OperationInner.java | 150 + .../fluent/models/OperationMetadataInner.java | 125 - .../fluent/models/OperationResultInner.java | 52 +- .../fluent/models/PolicyInner.java | 122 +- .../fluent/models/PolicyProperties.java | 10 +- .../fluent/models/RdpConnectionInner.java | 27 +- .../ScheduleCreationParameterProperties.java | 22 +- .../fluent/models/ScheduleInner.java | 122 +- .../fluent/models/ScheduleProperties.java | 22 +- .../fluent/models/SecretInner.java | 122 +- .../fluent/models/SecretProperties.java | 10 +- .../fluent/models/ServiceFabricInner.java | 123 +- .../models/ServiceFabricPropertiesInner.java | 13 +- .../fluent/models/ServiceRunnerInner.java | 112 +- .../devtestlabs/fluent/models/UserInner.java | 120 +- .../fluent/models/UserProperties.java | 16 +- .../fluent/models/VirtualNetworkInner.java | 118 +- .../models/VirtualNetworkProperties.java | 19 +- .../fluent/models/package-info.java | 4 +- .../devtestlabs/fluent/package-info.java | 4 +- .../ApplicableScheduleImpl.java | 7 +- .../ApplicableSchedulePropertiesImpl.java | 2 +- .../implementation/ArmTemplateImpl.java | 24 +- .../implementation/ArmTemplateInfoImpl.java | 22 +- .../ArmTemplatesClientImpl.java | 441 ++- .../implementation/ArmTemplatesImpl.java | 36 +- .../implementation/ArtifactImpl.java | 24 +- .../implementation/ArtifactSourceImpl.java | 17 +- .../ArtifactSourcesClientImpl.java | 852 ++--- .../implementation/ArtifactSourcesImpl.java | 34 +- .../implementation/ArtifactsClientImpl.java | 568 ++-- .../implementation/ArtifactsImpl.java | 42 +- .../implementation/CostsClientImpl.java | 209 +- .../devtestlabs/implementation/CostsImpl.java | 10 +- .../implementation/CustomImageImpl.java | 17 +- .../CustomImagesClientImpl.java | 999 +++--- .../implementation/CustomImagesImpl.java | 34 +- ...> DevTestLabsManagementClientBuilder.java} | 62 +- ...a => DevTestLabsManagementClientImpl.java} | 206 +- .../devtestlabs/implementation/DiskImpl.java | 45 +- .../implementation/DisksClientImpl.java | 1521 ++++----- .../devtestlabs/implementation/DisksImpl.java | 90 +- .../implementation/DtlEnvironmentImpl.java | 37 +- .../EnvironmentsClientImpl.java | 1120 +++---- .../implementation/EnvironmentsImpl.java | 74 +- .../EvaluatePoliciesResponseImpl.java | 2 +- .../implementation/FormulaImpl.java | 17 +- .../implementation/FormulasClientImpl.java | 897 ++---- .../implementation/FormulasImpl.java | 34 +- .../implementation/GalleryImageImpl.java | 15 +- .../GalleryImagesClientImpl.java | 215 +- .../implementation/GalleryImagesImpl.java | 2 +- .../GenerateUploadUriResponseImpl.java | 2 +- .../GlobalSchedulesClientImpl.java | 1464 ++++----- .../implementation/GlobalSchedulesImpl.java | 54 +- .../implementation/LabCostImpl.java | 15 +- .../devtestlabs/implementation/LabImpl.java | 17 +- .../implementation/LabVhdImpl.java | 2 +- .../implementation/LabVirtualMachineImpl.java | 17 +- .../LabVirtualMachinePropertiesImpl.java | 2 +- .../implementation/LabsClientImpl.java | 2148 +++++-------- .../devtestlabs/implementation/LabsImpl.java | 62 +- .../NotificationChannelImpl.java | 17 +- .../NotificationChannelsClientImpl.java | 951 ++---- .../NotificationChannelsImpl.java | 34 +- .../implementation/OperationImpl.java | 50 + .../implementation/OperationMetadataImpl.java | 37 - .../implementation/OperationResultImpl.java | 2 +- .../implementation/OperationsClientImpl.java | 85 +- .../implementation/OperationsImpl.java | 10 +- .../implementation/PoliciesClientImpl.java | 1003 +++--- .../implementation/PoliciesImpl.java | 34 +- .../implementation/PolicyImpl.java | 17 +- .../implementation/PolicySetsClientImpl.java | 137 +- .../implementation/PolicySetsImpl.java | 10 +- .../ProviderOperationsClientImpl.java | 177 +- .../ProviderOperationsImpl.java | 18 +- .../implementation/RdpConnectionImpl.java | 2 +- .../implementation/ResourceManagerUtils.java | 2 +- .../implementation/ScheduleImpl.java | 17 +- .../implementation/SchedulesClientImpl.java | 1282 +++----- .../implementation/SchedulesImpl.java | 66 +- .../implementation/SecretImpl.java | 37 +- .../implementation/SecretsClientImpl.java | 1038 +++--- .../implementation/SecretsImpl.java | 74 +- .../implementation/ServiceFabricImpl.java | 49 +- .../ServiceFabricPropertiesImpl.java | 2 +- .../ServiceFabricSchedulesClientImpl.java | 1393 +++----- .../ServiceFabricSchedulesImpl.java | 108 +- .../ServiceFabricsClientImpl.java | 1581 ++++----- .../implementation/ServiceFabricsImpl.java | 106 +- .../implementation/ServiceRunnerImpl.java | 15 +- .../ServiceRunnersClientImpl.java | 298 +- .../implementation/ServiceRunnersImpl.java | 10 +- .../devtestlabs/implementation/UserImpl.java | 17 +- .../implementation/UsersClientImpl.java | 949 +++--- .../devtestlabs/implementation/UsersImpl.java | 34 +- .../VirtualMachineSchedulesClientImpl.java | 1225 +++---- .../VirtualMachineSchedulesImpl.java | 68 +- .../VirtualMachinesClientImpl.java | 2819 ++++++----------- .../implementation/VirtualMachinesImpl.java | 50 +- .../implementation/VirtualNetworkImpl.java | 17 +- .../VirtualNetworksClientImpl.java | 952 +++--- .../implementation/VirtualNetworksImpl.java | 34 +- .../models/ArmTemplateList.java | 52 +- .../models/ArtifactList.java | 52 +- .../models/ArtifactSourceList.java | 52 +- .../models/CustomImageList.java | 52 +- .../{ => implementation}/models/DiskList.java | 52 +- .../models/DtlEnvironmentList.java | 52 +- .../models/FormulaList.java | 52 +- .../models/GalleryImageList.java | 52 +- .../{ => implementation}/models/LabList.java | 52 +- .../models/LabVhdList.java | 52 +- .../models/LabVirtualMachineList.java | 52 +- .../models/NotificationChannelList.java | 52 +- .../models/OperationListResult.java | 96 + .../models/PolicyList.java | 52 +- .../models/ScheduleList.java | 52 +- .../models/SecretList.java | 52 +- .../models/ServiceFabricList.java | 52 +- .../{ => implementation}/models/UserList.java | 52 +- .../models/VirtualNetworkList.java | 52 +- .../implementation/package-info.java | 4 +- .../devtestlabs/models/ActionType.java | 46 + .../models/ApplicableSchedule.java | 14 +- .../models/ApplicableScheduleFragment.java | 79 - .../models/ApplicableScheduleProperties.java | 2 +- .../models/ApplyArtifactsRequest.java | 13 +- .../devtestlabs/models/ArmTemplate.java | 18 +- .../devtestlabs/models/ArmTemplateInfo.java | 7 +- .../ArmTemplateParameterProperties.java | 10 +- .../devtestlabs/models/ArmTemplates.java | 56 +- .../devtestlabs/models/Artifact.java | 18 +- .../ArtifactDeploymentStatusProperties.java | 49 +- .../models/ArtifactInstallProperties.java | 13 +- .../models/ArtifactParameterProperties.java | 10 +- .../devtestlabs/models/ArtifactSource.java | 72 +- .../models/ArtifactSourceFragment.java | 11 +- .../devtestlabs/models/ArtifactSources.java | 70 +- .../devtestlabs/models/Artifacts.java | 60 +- .../models/AttachDiskProperties.java | 10 +- .../models/AttachNewDataDiskOptions.java | 10 +- .../models/BulkCreationParameters.java | 10 +- .../devtestlabs/models/ComputeDataDisk.java | 60 +- .../models/ComputeVmInstanceViewStatus.java | 49 +- .../models/ComputeVmProperties.java | 99 +- .../models/CostThresholdProperties.java | 13 +- .../models/CostThresholdStatus.java | 2 +- .../devtestlabs/models/CostType.java | 2 +- .../devtestlabs/models/Costs.java | 6 +- .../devtestlabs/models/CustomImage.java | 75 +- .../models/CustomImageFragment.java | 11 +- .../devtestlabs/models/CustomImageOsType.java | 2 +- .../models/CustomImagePropertiesCustom.java | 18 +- .../models/CustomImagePropertiesFromPlan.java | 10 +- .../models/CustomImagePropertiesFromVm.java | 16 +- .../devtestlabs/models/CustomImages.java | 72 +- .../models/DataDiskProperties.java | 13 +- .../models/DataDiskStorageTypeInfo.java | 10 +- .../devtestlabs/models/DayDetails.java | 10 +- .../models/DetachDataDiskProperties.java | 10 +- .../models/DetachDiskProperties.java | 10 +- .../devtestlabs/models/Disk.java | 80 +- .../devtestlabs/models/DiskFragment.java | 11 +- .../devtestlabs/models/Disks.java | 104 +- .../devtestlabs/models/DtlEnvironment.java | 76 +- .../models/DtlEnvironmentFragment.java | 11 +- .../devtestlabs/models/EnableStatus.java | 2 +- .../EnvironmentDeploymentProperties.java | 13 +- .../models/EnvironmentPermission.java | 2 +- .../devtestlabs/models/Environments.java | 80 +- .../models/EvaluatePoliciesProperties.java | 10 +- .../models/EvaluatePoliciesRequest.java | 13 +- .../models/EvaluatePoliciesResponse.java | 2 +- .../devtestlabs/models/Event.java | 10 +- .../models/ExportResourceUsageParameters.java | 10 +- .../devtestlabs/models/ExternalSubnet.java | 38 +- .../devtestlabs/models/FileUploadOptions.java | 2 +- .../devtestlabs/models/Formula.java | 69 +- .../devtestlabs/models/FormulaFragment.java | 11 +- .../models/FormulaPropertiesFromVm.java | 10 +- .../devtestlabs/models/Formulas.java | 70 +- .../devtestlabs/models/GalleryImage.java | 16 +- .../models/GalleryImageReference.java | 10 +- .../devtestlabs/models/GalleryImages.java | 8 +- .../models/GenerateArmTemplateRequest.java | 13 +- .../models/GenerateUploadUriParameter.java | 10 +- .../models/GenerateUploadUriResponse.java | 2 +- .../devtestlabs/models/GlobalSchedules.java | 116 +- .../models/HostCachingOptions.java | 2 +- .../devtestlabs/models/HourDetails.java | 10 +- .../devtestlabs/models/HttpStatusCode.java | 2 +- .../models/IdentityProperties.java | 10 +- .../ImportLabVirtualMachineRequest.java | 10 +- .../devtestlabs/models/InboundNatRule.java | 10 +- .../devtestlabs/models/Lab.java | 70 +- .../models/LabAnnouncementProperties.java | 10 +- .../devtestlabs/models/LabCost.java | 72 +- .../models/LabCostDetailsProperties.java | 49 +- .../models/LabCostSummaryProperties.java | 27 +- .../devtestlabs/models/LabFragment.java | 11 +- .../models/LabResourceCostProperties.java | 115 +- .../models/LabSupportProperties.java | 10 +- .../devtestlabs/models/LabVhd.java | 2 +- .../devtestlabs/models/LabVirtualMachine.java | 70 +- .../LabVirtualMachineCreationParameter.java | 13 +- .../models/LabVirtualMachineFragment.java | 11 +- .../models/LabVirtualMachineProperties.java | 2 +- .../devtestlabs/models/Labs.java | 116 +- .../devtestlabs/models/LinuxOsInfo.java | 10 +- .../devtestlabs/models/LinuxOsState.java | 2 +- .../models/ManagedIdentityType.java | 2 +- .../models/NetworkInterfaceProperties.java | 13 +- .../models/NotificationChannel.java | 70 +- .../models/NotificationChannelEventType.java | 2 +- .../models/NotificationChannelFragment.java | 11 +- .../models/NotificationChannels.java | 74 +- .../models/NotificationSettings.java | 10 +- .../devtestlabs/models/NotifyParameters.java | 10 +- .../devtestlabs/models/Operation.java | 58 + .../devtestlabs/models/OperationDisplay.java | 128 + .../devtestlabs/models/OperationError.java | 38 +- .../devtestlabs/models/OperationMetadata.java | 33 - .../models/OperationMetadataDisplay.java | 177 -- .../devtestlabs/models/OperationResult.java | 2 +- .../devtestlabs/models/Operations.java | 2 +- .../devtestlabs/models/Origin.java | 57 + .../devtestlabs/models/ParameterInfo.java | 10 +- .../models/ParametersValueFileInfo.java | 49 +- .../PercentageCostThresholdProperties.java | 10 +- .../devtestlabs/models/Policies.java | 98 +- .../devtestlabs/models/Policy.java | 82 +- .../models/PolicyEvaluatorType.java | 2 +- .../devtestlabs/models/PolicyFactName.java | 2 +- .../devtestlabs/models/PolicyFragment.java | 11 +- .../devtestlabs/models/PolicySetResult.java | 41 +- .../devtestlabs/models/PolicySets.java | 10 +- .../devtestlabs/models/PolicyStatus.java | 2 +- .../devtestlabs/models/PolicyViolation.java | 38 +- .../devtestlabs/models/Port.java | 10 +- .../devtestlabs/models/PremiumDataDisk.java | 2 +- .../models/ProviderOperationResult.java | 116 - .../models/ProviderOperations.java | 16 +- .../devtestlabs/models/RdpConnection.java | 2 +- .../models/ReportingCycleType.java | 2 +- .../ResizeLabVirtualMachineProperties.java | 10 +- .../models/RetargetScheduleProperties.java | 10 +- .../devtestlabs/models/Schedule.java | 69 +- .../models/ScheduleCreationParameter.java | 13 +- .../devtestlabs/models/ScheduleFragment.java | 11 +- .../devtestlabs/models/Schedules.java | 152 +- .../devtestlabs/models/Secret.java | 75 +- .../devtestlabs/models/SecretFragment.java | 11 +- .../devtestlabs/models/Secrets.java | 84 +- .../devtestlabs/models/ServiceFabric.java | 76 +- .../models/ServiceFabricFragment.java | 11 +- .../models/ServiceFabricProperties.java | 2 +- .../models/ServiceFabricSchedules.java | 200 +- .../devtestlabs/models/ServiceFabrics.java | 116 +- .../devtestlabs/models/ServiceRunner.java | 75 +- .../devtestlabs/models/ServiceRunners.java | 10 +- .../SharedPublicIpAddressConfiguration.java | 13 +- .../devtestlabs/models/SourceControlType.java | 2 +- .../devtestlabs/models/StorageType.java | 2 +- .../devtestlabs/models/Subnet.java | 10 +- .../devtestlabs/models/SubnetOverride.java | 13 +- ...netSharedPublicIpAddressConfiguration.java | 13 +- .../models/TargetCostProperties.java | 13 +- .../devtestlabs/models/TargetCostStatus.java | 2 +- .../devtestlabs/models/TransportProtocol.java | 2 +- .../devtestlabs/models/UpdateResource.java | 10 +- .../models/UsagePermissionType.java | 2 +- .../devtestlabs/models/User.java | 70 +- .../devtestlabs/models/UserFragment.java | 11 +- .../devtestlabs/models/UserIdentity.java | 10 +- .../devtestlabs/models/UserSecretStore.java | 10 +- .../devtestlabs/models/Users.java | 68 +- .../models/VirtualMachineCreationSource.java | 2 +- .../models/VirtualMachineSchedules.java | 168 +- .../devtestlabs/models/VirtualMachines.java | 124 +- .../devtestlabs/models/VirtualNetwork.java | 70 +- .../models/VirtualNetworkFragment.java | 11 +- .../devtestlabs/models/VirtualNetworks.java | 68 +- .../devtestlabs/models/WeekDetails.java | 10 +- .../devtestlabs/models/WindowsOsInfo.java | 10 +- .../devtestlabs/models/WindowsOsState.java | 2 +- .../devtestlabs/models/package-info.java | 4 +- .../devtestlabs/package-info.java | 4 +- .../src/main/java/module-info.java | 3 +- ...-resourcemanager-devtestlabs_metadata.json | 1 + ...ure-resourcemanager-devtestlabs.properties | 1 + .../generated/ArmTemplatesGetSamples.java | 5 +- .../generated/ArmTemplatesListSamples.java | 5 +- .../ArtifactSourcesCreateOrUpdateSamples.java | 6 +- .../ArtifactSourcesDeleteSamples.java | 6 +- .../generated/ArtifactSourcesGetSamples.java | 6 +- .../generated/ArtifactSourcesListSamples.java | 6 +- .../ArtifactSourcesUpdateSamples.java | 6 +- .../ArtifactsGenerateArmTemplateSamples.java | 5 +- .../generated/ArtifactsGetSamples.java | 5 +- .../generated/ArtifactsListSamples.java | 5 +- .../generated/CostsCreateOrUpdateSamples.java | 7 +- .../generated/CostsGetSamples.java | 5 +- .../CustomImagesCreateOrUpdateSamples.java | 6 +- .../generated/CustomImagesDeleteSamples.java | 6 +- .../generated/CustomImagesGetSamples.java | 5 +- .../generated/CustomImagesListSamples.java | 5 +- .../generated/CustomImagesUpdateSamples.java | 6 +- .../generated/DisksAttachSamples.java | 5 +- .../generated/DisksCreateOrUpdateSamples.java | 7 +- .../generated/DisksDeleteSamples.java | 8 +- .../generated/DisksDetachSamples.java | 5 +- .../generated/DisksGetSamples.java | 5 +- .../generated/DisksListSamples.java | 5 +- .../generated/DisksUpdateSamples.java | 5 +- .../EnvironmentsCreateOrUpdateSamples.java | 6 +- .../generated/EnvironmentsDeleteSamples.java | 6 +- .../generated/EnvironmentsGetSamples.java | 5 +- .../generated/EnvironmentsListSamples.java | 5 +- .../generated/EnvironmentsUpdateSamples.java | 6 +- .../FormulasCreateOrUpdateSamples.java | 7 +- .../generated/FormulasDeleteSamples.java | 5 +- .../generated/FormulasGetSamples.java | 5 +- .../generated/FormulasListSamples.java | 5 +- .../generated/FormulasUpdateSamples.java | 5 +- .../generated/GalleryImagesListSamples.java | 6 +- .../GlobalSchedulesCreateOrUpdateSamples.java | 6 +- .../GlobalSchedulesDeleteSamples.java | 6 +- .../GlobalSchedulesExecuteSamples.java | 5 +- ...balSchedulesGetByResourceGroupSamples.java | 6 +- ...alSchedulesListByResourceGroupSamples.java | 5 +- .../generated/GlobalSchedulesListSamples.java | 5 +- .../GlobalSchedulesRetargetSamples.java | 5 +- .../GlobalSchedulesUpdateSamples.java | 6 +- .../generated/LabsClaimAnyVmSamples.java | 5 +- .../LabsCreateEnvironmentSamples.java | 6 +- .../generated/LabsCreateOrUpdateSamples.java | 8 +- .../generated/LabsDeleteSamples.java | 5 +- .../LabsExportResourceUsageSamples.java | 5 +- .../LabsGenerateUploadUriSamples.java | 6 +- .../LabsGetByResourceGroupSamples.java | 5 +- .../LabsImportVirtualMachineSamples.java | 5 +- .../LabsListByResourceGroupSamples.java | 5 +- .../generated/LabsListSamples.java | 5 +- .../generated/LabsListVhdsSamples.java | 5 +- .../generated/LabsUpdateSamples.java | 5 +- ...ficationChannelsCreateOrUpdateSamples.java | 6 +- .../NotificationChannelsDeleteSamples.java | 5 +- .../NotificationChannelsGetSamples.java | 5 +- .../NotificationChannelsListSamples.java | 5 +- .../NotificationChannelsNotifySamples.java | 5 +- .../NotificationChannelsUpdateSamples.java | 5 +- .../generated/OperationsGetSamples.java | 5 +- .../PoliciesCreateOrUpdateSamples.java | 7 +- .../generated/PoliciesDeleteSamples.java | 5 +- .../generated/PoliciesGetSamples.java | 5 +- .../generated/PoliciesListSamples.java | 5 +- .../generated/PoliciesUpdateSamples.java | 5 +- .../PolicySetsEvaluatePoliciesSamples.java | 5 +- .../ProviderOperationsListSamples.java | 5 +- .../SchedulesCreateOrUpdateSamples.java | 9 +- .../generated/SchedulesDeleteSamples.java | 5 +- .../generated/SchedulesExecuteSamples.java | 5 +- .../generated/SchedulesGetSamples.java | 5 +- .../SchedulesListApplicableSamples.java | 5 +- .../generated/SchedulesListSamples.java | 5 +- .../generated/SchedulesUpdateSamples.java | 5 +- .../SecretsCreateOrUpdateSamples.java | 7 +- .../generated/SecretsDeleteSamples.java | 5 +- .../generated/SecretsGetSamples.java | 5 +- .../generated/SecretsListSamples.java | 5 +- .../generated/SecretsUpdateSamples.java | 5 +- ...eFabricSchedulesCreateOrUpdateSamples.java | 9 +- .../ServiceFabricSchedulesDeleteSamples.java | 5 +- .../ServiceFabricSchedulesExecuteSamples.java | 5 +- .../ServiceFabricSchedulesGetSamples.java | 5 +- .../ServiceFabricSchedulesListSamples.java | 5 +- .../ServiceFabricSchedulesUpdateSamples.java | 5 +- .../ServiceFabricsCreateOrUpdateSamples.java | 7 +- .../ServiceFabricsDeleteSamples.java | 6 +- .../generated/ServiceFabricsGetSamples.java | 6 +- ...FabricsListApplicableSchedulesSamples.java | 5 +- .../generated/ServiceFabricsListSamples.java | 6 +- .../generated/ServiceFabricsStartSamples.java | 6 +- .../generated/ServiceFabricsStopSamples.java | 6 +- .../ServiceFabricsUpdateSamples.java | 6 +- .../ServiceRunnersCreateOrUpdateSamples.java | 7 +- .../ServiceRunnersDeleteSamples.java | 6 +- .../generated/ServiceRunnersGetSamples.java | 6 +- .../generated/UsersCreateOrUpdateSamples.java | 8 +- .../generated/UsersDeleteSamples.java | 5 +- .../generated/UsersGetSamples.java | 5 +- .../generated/UsersListSamples.java | 5 +- .../generated/UsersUpdateSamples.java | 5 +- ...MachineSchedulesCreateOrUpdateSamples.java | 9 +- .../VirtualMachineSchedulesDeleteSamples.java | 5 +- ...VirtualMachineSchedulesExecuteSamples.java | 5 +- .../VirtualMachineSchedulesGetSamples.java | 5 +- .../VirtualMachineSchedulesListSamples.java | 5 +- .../VirtualMachineSchedulesUpdateSamples.java | 5 +- .../VirtualMachinesAddDataDiskSamples.java | 5 +- .../VirtualMachinesApplyArtifactsSamples.java | 5 +- .../VirtualMachinesClaimSamples.java | 6 +- .../VirtualMachinesCreateOrUpdateSamples.java | 7 +- .../VirtualMachinesDeleteSamples.java | 6 +- .../VirtualMachinesDetachDataDiskSamples.java | 5 +- ...tualMachinesGetRdpFileContentsSamples.java | 5 +- .../generated/VirtualMachinesGetSamples.java | 6 +- ...achinesListApplicableSchedulesSamples.java | 5 +- .../generated/VirtualMachinesListSamples.java | 6 +- .../VirtualMachinesRedeploySamples.java | 5 +- .../VirtualMachinesResizeSamples.java | 6 +- .../VirtualMachinesRestartSamples.java | 5 +- .../VirtualMachinesStartSamples.java | 6 +- .../generated/VirtualMachinesStopSamples.java | 6 +- .../VirtualMachinesTransferDisksSamples.java | 5 +- .../VirtualMachinesUnClaimSamples.java | 5 +- .../VirtualMachinesUpdateSamples.java | 6 +- .../VirtualNetworksCreateOrUpdateSamples.java | 14 +- .../VirtualNetworksDeleteSamples.java | 6 +- .../generated/VirtualNetworksGetSamples.java | 6 +- .../generated/VirtualNetworksListSamples.java | 6 +- .../VirtualNetworksUpdateSamples.java | 6 +- .../ApplicableScheduleFragmentTests.java | 41 - .../ApplicableScheduleInnerTests.java | 157 +- ...pplicableSchedulePropertiesInnerTests.java | 150 +- .../generated/ApplyArtifactsRequestTests.java | 88 +- .../generated/ArmTemplateInfoInnerTests.java | 11 +- .../generated/ArmTemplateInnerTests.java | 31 +- .../generated/ArmTemplateListTests.java | 44 +- .../ArmTemplateParameterPropertiesTests.java | 17 +- .../generated/ArmTemplatePropertiesTests.java | 10 +- .../ArmTemplatesGetWithResponseMockTests.java | 15 +- .../generated/ArmTemplatesListMockTests.java | 14 +- ...tifactDeploymentStatusPropertiesTests.java | 21 +- .../generated/ArtifactInnerTests.java | 31 +- .../ArtifactInstallPropertiesTests.java | 50 +- .../generated/ArtifactListTests.java | 40 +- .../ArtifactParameterPropertiesTests.java | 17 +- .../generated/ArtifactPropertiesTests.java | 10 +- .../ArtifactSourceFragmentTests.java | 16 +- ...actSourcesDeleteWithResponseMockTests.java | 8 +- ...erateArmTemplateWithResponseMockTests.java | 23 +- .../ArtifactsGetWithResponseMockTests.java | 14 +- .../generated/ArtifactsListMockTests.java | 14 +- .../generated/AttachDiskPropertiesTests.java | 10 +- .../AttachNewDataDiskOptionsTests.java | 22 +- .../BulkCreationParametersTests.java | 10 +- .../generated/ComputeDataDiskTests.java | 25 +- .../CostThresholdPropertiesTests.java | 28 +- .../generated/CustomImageFragmentTests.java | 13 +- .../generated/CustomImageInnerTests.java | 116 +- .../generated/CustomImageListTests.java | 159 +- .../CustomImagePropertiesCustomTests.java | 22 +- .../CustomImagePropertiesFromPlanTests.java | 25 +- .../CustomImagePropertiesFromVmTests.java | 16 +- .../generated/CustomImagePropertiesTests.java | 89 +- .../CustomImagesCreateOrUpdateMockTests.java | 75 +- .../CustomImagesDeleteMockTests.java | 9 +- .../CustomImagesGetWithResponseMockTests.java | 40 +- .../generated/CustomImagesListMockTests.java | 44 +- .../generated/DataDiskPropertiesTests.java | 28 +- .../DataDiskStorageTypeInfoTests.java | 10 +- .../generated/DayDetailsTests.java | 10 +- .../DetachDataDiskPropertiesTests.java | 10 +- .../generated/DetachDiskPropertiesTests.java | 10 +- .../generated/DiskFragmentTests.java | 12 +- .../devtestlabs/generated/DiskInnerTests.java | 66 +- .../devtestlabs/generated/DiskListTests.java | 101 +- .../generated/DiskPropertiesTests.java | 52 +- .../generated/DisksAttachMockTests.java | 10 +- .../DisksCreateOrUpdateMockTests.java | 50 +- .../generated/DisksDeleteMockTests.java | 9 +- .../generated/DisksDetachMockTests.java | 10 +- .../DisksGetWithResponseMockTests.java | 28 +- .../generated/DisksListMockTests.java | 29 +- .../DtlEnvironmentFragmentTests.java | 16 +- .../generated/DtlEnvironmentInnerTests.java | 47 +- .../generated/DtlEnvironmentListTests.java | 53 +- .../EnvironmentDeploymentPropertiesTests.java | 25 +- .../generated/EnvironmentPropertiesTests.java | 35 +- .../EnvironmentsCreateOrUpdateMockTests.java | 45 +- .../EnvironmentsDeleteMockTests.java | 8 +- .../EnvironmentsGetWithResponseMockTests.java | 22 +- .../generated/EnvironmentsListMockTests.java | 23 +- .../EvaluatePoliciesPropertiesTests.java | 28 +- .../EvaluatePoliciesRequestTests.java | 34 +- .../devtestlabs/generated/EventTests.java | 10 +- .../ExportResourceUsageParametersTests.java | 18 +- .../generated/ExternalSubnetTests.java | 16 +- .../generated/FormulaFragmentTests.java | 10 +- .../FormulaPropertiesFromVmTests.java | 10 +- .../FormulasDeleteWithResponseMockTests.java | 9 +- .../generated/GalleryImageInnerTests.java | 76 +- .../generated/GalleryImageListTests.java | 111 +- .../GalleryImagePropertiesTests.java | 54 +- .../generated/GalleryImageReferenceTests.java | 34 +- .../generated/GalleryImagesListMockTests.java | 37 +- .../GenerateArmTemplateRequestTests.java | 34 +- .../GenerateUploadUriParameterTests.java | 10 +- .../GenerateUploadUriResponseInnerTests.java | 15 +- ...esCreateOrUpdateWithResponseMockTests.java | 67 +- ...eByResourceGroupWithResponseMockTests.java | 8 +- .../GlobalSchedulesExecuteMockTests.java | 8 +- ...tByResourceGroupWithResponseMockTests.java | 36 +- ...SchedulesListByResourceGroupMockTests.java | 39 +- .../GlobalSchedulesListMockTests.java | 42 +- .../GlobalSchedulesRetargetMockTests.java | 10 +- .../generated/HourDetailsTests.java | 10 +- .../ImportLabVirtualMachineRequestTests.java | 19 +- .../generated/InboundNatRuleTests.java | 16 +- .../LabAnnouncementPropertiesTests.java | 26 +- .../LabCostDetailsPropertiesTests.java | 20 +- .../LabCostSummaryPropertiesTests.java | 13 +- .../generated/LabFragmentTests.java | 15 +- .../devtestlabs/generated/LabInnerTests.java | 84 +- .../devtestlabs/generated/LabListTests.java | 122 +- .../generated/LabPropertiesTests.java | 60 +- .../LabResourceCostPropertiesTests.java | 45 +- .../generated/LabSupportPropertiesTests.java | 15 +- .../generated/LabVhdInnerTests.java | 13 +- .../generated/LabVhdListTests.java | 21 +- .../LabVirtualMachineFragmentTests.java | 12 +- .../generated/LabsClaimAnyVmMockTests.java | 8 +- .../LabsCreateOrUpdateMockTests.java | 62 +- .../generated/LabsDeleteMockTests.java | 8 +- .../LabsExportResourceUsageMockTests.java | 12 +- ...enerateUploadUriWithResponseMockTests.java | 14 +- ...tByResourceGroupWithResponseMockTests.java | 36 +- .../LabsImportVirtualMachineMockTests.java | 12 +- .../LabsListByResourceGroupMockTests.java | 34 +- .../generated/LabsListMockTests.java | 35 +- .../generated/LabsListVhdsMockTests.java | 13 +- .../generated/LinuxOsInfoTests.java | 10 +- .../NetworkInterfacePropertiesTests.java | 80 +- .../NotificationChannelFragmentTests.java | 15 +- .../NotificationChannelInnerTests.java | 51 +- .../NotificationChannelListTests.java | 75 +- .../NotificationChannelPropertiesTests.java | 28 +- ...lsCreateOrUpdateWithResponseMockTests.java | 40 +- ...onChannelsDeleteWithResponseMockTests.java | 9 +- ...ationChannelsGetWithResponseMockTests.java | 23 +- .../NotificationChannelsListMockTests.java | 24 +- ...onChannelsNotifyWithResponseMockTests.java | 11 +- .../generated/NotificationSettingsTests.java | 28 +- .../generated/NotifyParametersTests.java | 10 +- .../generated/OperationDisplayTests.java | 17 + .../generated/OperationInnerTests.java | 17 + .../generated/OperationListResultTests.java | 19 + .../OperationMetadataDisplayTests.java | 35 - .../OperationMetadataInnerTests.java | 39 - .../generated/ParameterInfoTests.java | 14 +- .../ParametersValueFileInfoTests.java | 18 +- ...ercentageCostThresholdPropertiesTests.java | 10 +- ...esCreateOrUpdateWithResponseMockTests.java | 32 +- .../PoliciesDeleteWithResponseMockTests.java | 9 +- .../PoliciesGetWithResponseMockTests.java | 24 +- .../generated/PoliciesListMockTests.java | 23 +- .../generated/PolicyFragmentTests.java | 11 +- .../generated/PolicyInnerTests.java | 54 +- .../generated/PolicyListTests.java | 87 +- .../generated/PolicyPropertiesTests.java | 34 +- .../devtestlabs/generated/PortTests.java | 10 +- .../ProviderOperationResultTests.java | 52 - .../ProviderOperationsListMockTests.java | 18 +- .../generated/RdpConnectionInnerTests.java | 13 +- ...esizeLabVirtualMachinePropertiesTests.java | 10 +- .../RetargetSchedulePropertiesTests.java | 14 +- ...eduleCreationParameterPropertiesTests.java | 74 +- .../ScheduleCreationParameterTests.java | 81 +- .../generated/ScheduleFragmentTests.java | 14 +- .../generated/ScheduleInnerTests.java | 87 +- .../generated/ScheduleListTests.java | 141 +- .../generated/SchedulePropertiesTests.java | 74 +- ...esCreateOrUpdateWithResponseMockTests.java | 62 +- .../SchedulesDeleteWithResponseMockTests.java | 9 +- .../generated/SchedulesExecuteMockTests.java | 8 +- .../SchedulesGetWithResponseMockTests.java | 38 +- .../SchedulesListApplicableMockTests.java | 39 +- .../generated/SchedulesListMockTests.java | 39 +- .../SchedulesUpdateWithResponseMockTests.java | 38 +- .../generated/SecretFragmentTests.java | 10 +- .../generated/SecretInnerTests.java | 23 +- .../generated/SecretListTests.java | 42 +- .../generated/SecretPropertiesTests.java | 10 +- .../SecretsCreateOrUpdateMockTests.java | 25 +- .../SecretsDeleteWithResponseMockTests.java | 8 +- .../SecretsGetWithResponseMockTests.java | 16 +- .../generated/SecretsListMockTests.java | 16 +- .../generated/ServiceFabricFragmentTests.java | 10 +- .../generated/ServiceFabricInnerTests.java | 29 +- .../generated/ServiceFabricListTests.java | 52 +- .../ServiceFabricPropertiesInnerTests.java | 15 +- ...esCreateOrUpdateWithResponseMockTests.java | 70 +- ...cSchedulesDeleteWithResponseMockTests.java | 8 +- ...erviceFabricSchedulesExecuteMockTests.java | 9 +- ...bricSchedulesGetWithResponseMockTests.java | 41 +- .../ServiceFabricSchedulesListMockTests.java | 41 +- ...cSchedulesUpdateWithResponseMockTests.java | 43 +- ...ServiceFabricsCreateOrUpdateMockTests.java | 28 +- .../ServiceFabricsDeleteMockTests.java | 9 +- ...erviceFabricsGetWithResponseMockTests.java | 18 +- ...licableSchedulesWithResponseMockTests.java | 73 +- .../ServiceFabricsListMockTests.java | 18 +- .../ServiceFabricsStartMockTests.java | 9 +- .../ServiceFabricsStopMockTests.java | 8 +- ...iceRunnersDeleteWithResponseMockTests.java | 9 +- ...aredPublicIpAddressConfigurationTests.java | 28 +- .../generated/SubnetOverrideTests.java | 50 +- ...aredPublicIpAddressConfigurationTests.java | 13 +- .../devtestlabs/generated/SubnetTests.java | 23 +- .../generated/TargetCostPropertiesTests.java | 70 +- .../generated/UpdateResourceTests.java | 14 +- .../generated/UserFragmentTests.java | 14 +- .../generated/UserIdentityTests.java | 34 +- .../generated/UsersDeleteMockTests.java | 8 +- ...esCreateOrUpdateWithResponseMockTests.java | 67 +- ...eSchedulesDeleteWithResponseMockTests.java | 8 +- ...rtualMachineSchedulesExecuteMockTests.java | 8 +- ...hineSchedulesGetWithResponseMockTests.java | 39 +- .../VirtualMachineSchedulesListMockTests.java | 38 +- ...eSchedulesUpdateWithResponseMockTests.java | 40 +- .../VirtualMachinesAddDataDiskMockTests.java | 14 +- ...irtualMachinesApplyArtifactsMockTests.java | 45 +- .../VirtualMachinesClaimMockTests.java | 8 +- .../VirtualMachinesDeleteMockTests.java | 8 +- ...irtualMachinesDetachDataDiskMockTests.java | 10 +- ...tRdpFileContentsWithResponseMockTests.java | 13 +- ...licableSchedulesWithResponseMockTests.java | 74 +- .../VirtualMachinesRedeployMockTests.java | 9 +- .../VirtualMachinesResizeMockTests.java | 10 +- .../VirtualMachinesRestartMockTests.java | 9 +- .../VirtualMachinesStartMockTests.java | 9 +- .../VirtualMachinesStopMockTests.java | 8 +- ...VirtualMachinesTransferDisksMockTests.java | 9 +- .../VirtualMachinesUnClaimMockTests.java | 9 +- .../VirtualNetworkFragmentTests.java | 14 +- .../generated/VirtualNetworkInnerTests.java | 113 +- .../generated/VirtualNetworkListTests.java | 159 +- .../VirtualNetworkPropertiesTests.java | 112 +- ...irtualNetworksCreateOrUpdateMockTests.java | 82 +- .../VirtualNetworksDeleteMockTests.java | 8 +- ...rtualNetworksGetWithResponseMockTests.java | 35 +- .../VirtualNetworksListMockTests.java | 34 +- .../generated/WeekDetailsTests.java | 17 +- .../generated/WindowsOsInfoTests.java | 10 +- .../tsp-location.yaml | 4 + 711 files changed, 19797 insertions(+), 28679 deletions(-) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/{DevTestLabsClient.java => DevTestLabsManagementClient.java} (94%) create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationInner.java delete mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationMetadataInner.java rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/{DevTestLabsClientBuilder.java => DevTestLabsManagementClientBuilder.java} (63%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/{DevTestLabsClientImpl.java => DevTestLabsManagementClientImpl.java} (91%) create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationImpl.java delete mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationMetadataImpl.java rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/ArmTemplateList.java (67%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/ArtifactList.java (67%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/ArtifactSourceList.java (67%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/CustomImageList.java (67%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/DiskList.java (66%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/DtlEnvironmentList.java (67%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/FormulaList.java (67%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/GalleryImageList.java (67%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/LabList.java (66%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/LabVhdList.java (66%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/LabVirtualMachineList.java (67%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/NotificationChannelList.java (67%) create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/OperationListResult.java rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/PolicyList.java (66%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/ScheduleList.java (67%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/SecretList.java (66%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/ServiceFabricList.java (67%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/UserList.java (66%) rename sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/{ => implementation}/models/VirtualNetworkList.java (67%) create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ActionType.java delete mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleFragment.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Operation.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationDisplay.java delete mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationMetadata.java delete mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationMetadataDisplay.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Origin.java delete mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperationResult.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/resources/META-INF/azure-resourcemanager-devtestlabs_metadata.json create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/resources/azure-resourcemanager-devtestlabs.properties delete mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplicableScheduleFragmentTests.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationDisplayTests.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationInnerTests.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationListResultTests.java delete mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationMetadataDisplayTests.java delete mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationMetadataInnerTests.java delete mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationResultTests.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/tsp-location.yaml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 5c69998dac68..1321450393af 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -352,7 +352,7 @@ com.azure.resourcemanager:azure-resourcemanager-customerinsights;1.0.0-beta.3;1. com.azure.resourcemanager:azure-resourcemanager-databox;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-datamigration;1.2.0;1.3.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-devspaces;1.0.0-beta.3;1.0.0-beta.4 -com.azure.resourcemanager:azure-resourcemanager-devtestlabs;1.1.0;1.2.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-devtestlabs;1.1.0;1.2.0 com.azure.resourcemanager:azure-resourcemanager-hanaonazure;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-healthcareapis;1.2.0;1.3.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-hybridcompute;1.0.0;1.1.0-beta.3 diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/CHANGELOG.md b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/CHANGELOG.md index ebbc207d1527..bbe0b3d7bff8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/CHANGELOG.md +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/CHANGELOG.md @@ -1,14 +1,526 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0 (2026-05-28) -### Features Added +- Azure Resource Manager DevTestLabs client library for Java. This package contains Microsoft Azure SDK for DevTestLabs Management SDK. The DevTest Labs Client. Package api-version 2018-09-15. 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.ArmTemplateList` was removed + +#### `models.FormulaList` was removed + +#### `models.ScheduleList` was removed + +#### `models.VirtualNetworkList` was removed + +#### `models.UserList` was removed + +#### `models.ArtifactList` was removed + +#### `models.DtlEnvironmentList` was removed + +#### `models.LabList` was removed + +#### `models.SecretList` was removed + +#### `models.ApplicableScheduleFragment` was removed + +#### `models.PolicyList` was removed + +#### `models.OperationMetadataDisplay` was removed + +#### `models.ServiceFabricList` was removed + +#### `models.ProviderOperationResult` was removed + +#### `models.GalleryImageList` was removed + +#### `models.OperationMetadata` was removed + +#### `models.DiskList` was removed + +#### `models.LabVirtualMachineList` was removed + +#### `models.LabVhdList` was removed + +#### `models.ArtifactSourceList` was removed + +#### `models.NotificationChannelList` was removed + +#### `models.CustomImageList` was removed + +#### `models.ArmTemplateInfo` was modified + +* `java.lang.Object parameters()` -> `java.util.Map parameters()` +* `java.lang.Object template()` -> `java.util.Map template()` + +#### `models.TargetCostProperties` was modified + +* `validate()` was removed + +#### `models.PolicyViolation` was modified + +* `PolicyViolation()` was changed to private access +* `withMessage(java.lang.String)` was removed +* `withCode(java.lang.String)` was removed +* `validate()` was removed + +#### `models.Subnet` was modified + +* `validate()` was removed + +#### `models.GenerateUploadUriParameter` was modified + +* `validate()` was removed + +#### `models.Artifact` was modified + +* `java.lang.Object parameters()` -> `java.util.Map parameters()` + +#### `models.ArtifactSourceFragment` was modified + +* `validate()` was removed + +#### `models.IdentityProperties` was modified + +* `validate()` was removed + +#### `models.ExternalSubnet` was modified + +* `ExternalSubnet()` was changed to private access +* `withName(java.lang.String)` was removed +* `validate()` was removed +* `withId(java.lang.String)` was removed + +#### `models.GalleryImageReference` was modified + +* `validate()` was removed + +#### `models.DtlEnvironmentFragment` was modified + +* `validate()` was removed + +#### `models.HourDetails` was modified + +* `validate()` was removed + +#### `models.Port` was modified + +* `validate()` was removed + +#### `models.FormulaFragment` was modified + +* `validate()` was removed + +#### `models.DetachDiskProperties` was modified + +* `validate()` was removed + +#### `models.LinuxOsInfo` was modified + +* `validate()` was removed + +#### `models.LabSupportProperties` was modified + +* `validate()` was removed + +#### `models.ScheduleFragment` was modified + +* `validate()` was removed + +#### `models.ArmTemplate` was modified + +* `java.lang.Object contents()` -> `java.util.Map contents()` + +#### `models.ParameterInfo` was modified + +* `validate()` was removed + +#### `models.EnvironmentDeploymentProperties` was modified + +* `validate()` was removed + +#### `models.ArtifactParameterProperties` was modified + +* `validate()` was removed + +#### `models.ComputeDataDisk` was modified + +* `ComputeDataDisk()` was changed to private access +* `withDiskUri(java.lang.String)` was removed +* `withManagedDiskId(java.lang.String)` was removed +* `validate()` was removed +* `withDiskSizeGiB(java.lang.Integer)` was removed +* `withName(java.lang.String)` was removed + +#### `models.CustomImagePropertiesFromPlan` was modified + +* `validate()` was removed + +#### `models.WeekDetails` was modified + +* `validate()` was removed + +#### `models.FormulaPropertiesFromVm` was modified + +* `validate()` was removed + +#### `models.UserSecretStore` was modified + +* `validate()` was removed + +#### `models.SecretFragment` was modified + +* `validate()` was removed + +#### `models.RetargetScheduleProperties` was modified + +* `validate()` was removed + +#### `models.SubnetOverride` was modified + +* `validate()` was removed + +#### `models.BulkCreationParameters` was modified + +* `validate()` was removed + +#### `models.NotificationChannelFragment` was modified + +* `validate()` was removed + +#### `models.ServiceFabricFragment` was modified + +* `validate()` was removed + +#### `models.SubnetSharedPublicIpAddressConfiguration` was modified + +* `validate()` was removed + +#### `models.Event` was modified + +* `validate()` was removed + +#### `models.PolicySetResult` was modified + +* `PolicySetResult()` was changed to private access +* `withHasError(java.lang.Boolean)` was removed +* `validate()` was removed +* `withPolicyViolations(java.util.List)` was removed + +#### `models.LabResourceCostProperties` was modified + +* `LabResourceCostProperties()` was changed to private access +* `withExternalResourceId(java.lang.String)` was removed +* `withResourceId(java.lang.String)` was removed +* `withResourceType(java.lang.String)` was removed +* `validate()` was removed +* `withResourcename(java.lang.String)` was removed +* `withResourcePricingTier(java.lang.String)` was removed +* `withResourceUId(java.lang.String)` was removed +* `withResourceOwner(java.lang.String)` was removed +* `withResourceCost(java.lang.Double)` was removed +* `withResourceStatus(java.lang.String)` was removed + +#### `models.ArmTemplateParameterProperties` was modified + +* `validate()` was removed + +#### `models.CustomImagePropertiesFromVm` was modified + +* `validate()` was removed + +#### `models.OperationError` was modified + +* `OperationError()` was changed to private access +* `withMessage(java.lang.String)` was removed +* `withCode(java.lang.String)` was removed +* `validate()` was removed + +#### `models.DetachDataDiskProperties` was modified + +* `validate()` was removed + +#### `models.UpdateResource` was modified + +* `validate()` was removed + +#### `models.DiskFragment` was modified + +* `validate()` was removed + +#### `models.LabAnnouncementProperties` was modified + +* `validate()` was removed + +#### `models.ScheduleCreationParameter` was modified + +* `validate()` was removed + +#### `models.NotificationSettings` was modified + +* `validate()` was removed + +#### `models.PercentageCostThresholdProperties` was modified + +* `validate()` was removed + +#### `models.UserFragment` was modified + +* `validate()` was removed + +#### `models.DataDiskStorageTypeInfo` was modified + +* `validate()` was removed + +#### `models.VirtualNetworkFragment` was modified + +* `validate()` was removed + +#### `models.ResizeLabVirtualMachineProperties` was modified + +* `validate()` was removed + +#### `models.NetworkInterfaceProperties` was modified + +* `validate()` was removed + +#### `models.NotifyParameters` was modified + +* `validate()` was removed + +#### `models.EvaluatePoliciesRequest` was modified + +* `validate()` was removed + +#### `models.SharedPublicIpAddressConfiguration` was modified + +* `validate()` was removed + +#### `models.CustomImageFragment` was modified + +* `validate()` was removed + +#### `models.PolicyFragment` was modified + +* `validate()` was removed + +#### `models.EvaluatePoliciesProperties` was modified + +* `validate()` was removed + +#### `models.ParametersValueFileInfo` was modified + +* `ParametersValueFileInfo()` was changed to private access +* `withFileName(java.lang.String)` was removed +* `validate()` was removed +* `withParametersValueInfo(java.lang.Object)` was removed +* `java.lang.Object parametersValueInfo()` -> `java.util.Map parametersValueInfo()` + +#### `models.WindowsOsInfo` was modified + +* `validate()` was removed + +#### `models.LabCostDetailsProperties` was modified + +* `LabCostDetailsProperties()` was changed to private access +* `withDate(java.time.OffsetDateTime)` was removed +* `withCost(java.lang.Double)` was removed +* `withCostType(models.CostType)` was removed +* `validate()` was removed + +#### `models.LabCostSummaryProperties` was modified + +* `LabCostSummaryProperties()` was changed to private access +* `withEstimatedLabCost(java.lang.Double)` was removed +* `validate()` was removed + +#### `models.ComputeVmProperties` was modified + +* `ComputeVmProperties()` was changed to private access +* `withOsDiskId(java.lang.String)` was removed +* `withDataDiskIds(java.util.List)` was removed +* `withVmSize(java.lang.String)` was removed +* `withOsType(java.lang.String)` was removed +* `withDataDisks(java.util.List)` was removed +* `validate()` was removed +* `withNetworkInterfaceId(java.lang.String)` was removed +* `withStatuses(java.util.List)` was removed + +#### `models.CostThresholdProperties` was modified + +* `validate()` was removed + +#### `models.UserIdentity` was modified + +* `validate()` was removed + +#### `models.ArtifactDeploymentStatusProperties` was modified + +* `ArtifactDeploymentStatusProperties()` was changed to private access +* `validate()` was removed +* `withArtifactsApplied(java.lang.Integer)` was removed +* `withDeploymentStatus(java.lang.String)` was removed +* `withTotalArtifacts(java.lang.Integer)` was removed + +#### `models.LabVirtualMachineFragment` was modified + +* `validate()` was removed + +#### `models.CustomImagePropertiesCustom` was modified + +* `validate()` was removed + +#### `models.ComputeVmInstanceViewStatus` was modified + +* `ComputeVmInstanceViewStatus()` was changed to private access +* `withCode(java.lang.String)` was removed +* `withMessage(java.lang.String)` was removed +* `withDisplayStatus(java.lang.String)` was removed +* `validate()` was removed + +#### `models.DayDetails` was modified + +* `validate()` was removed + +#### `models.LabFragment` was modified + +* `validate()` was removed + +#### `models.DataDiskProperties` was modified + +* `validate()` was removed + +#### `models.ApplyArtifactsRequest` was modified + +* `validate()` was removed + +#### `models.AttachNewDataDiskOptions` was modified + +* `validate()` was removed + +#### `models.ExportResourceUsageParameters` was modified + +* `validate()` was removed + +#### `models.AttachDiskProperties` was modified + +* `validate()` was removed + +#### `models.ArtifactInstallProperties` was modified + +* `validate()` was removed + +#### `models.LabVirtualMachineCreationParameter` was modified + +* `validate()` was removed + +#### `models.GenerateArmTemplateRequest` was modified + +* `validate()` was removed + +#### `models.InboundNatRule` was modified + +* `validate()` was removed + +#### `DevTestLabsManager` was modified + +* `fluent.DevTestLabsClient serviceClient()` -> `fluent.DevTestLabsManagementClient serviceClient()` + +#### `models.ImportLabVirtualMachineRequest` was modified + +* `validate()` was removed + +### Features Added + +* `models.Operation` was added + +* `models.OperationDisplay` was added + +* `models.ActionType` was added + +* `models.Origin` was added + +#### `models.NotificationChannel` was modified + +* `systemData()` was added + +#### `models.Artifact` was modified + +* `systemData()` was added + +#### `models.ApplicableSchedule` was modified + +* `systemData()` was added + +#### `models.User` was modified + +* `systemData()` was added + +#### `models.Secret` was modified + +* `systemData()` was added + +#### `models.ServiceRunner` was modified + +* `systemData()` was added + +#### `models.CustomImage` was modified + +* `systemData()` was added + +#### `models.Formula` was modified + +* `systemData()` was added + +#### `models.ArmTemplate` was modified + +* `systemData()` was added + +#### `models.LabCost` was modified + +* `systemData()` was added + +#### `models.Disk` was modified + +* `systemData()` was added + +#### `models.ServiceFabric` was modified + +* `systemData()` was added + +#### `models.ArtifactSource` was modified + +* `systemData()` was added + +#### `models.DtlEnvironment` was modified + +* `systemData()` was added + +#### `models.Schedule` was modified + +* `systemData()` was added + +#### `models.GalleryImage` was modified + +* `systemData()` was added + +#### `models.Policy` was modified + +* `systemData()` was added + +#### `models.Lab` was modified + +* `systemData()` was added + +#### `models.LabVirtualMachine` was modified + +* `systemData()` was added + +#### `models.VirtualNetwork` was modified -### Other Changes +* `systemData()` was added ## 1.1.0 (2024-12-13) diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/README.md b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/README.md index 9916a9c49e7b..a60aef12185c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/README.md +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/README.md @@ -2,7 +2,7 @@ Azure Resource Manager DevTestLabs client library for Java. -This package contains Microsoft Azure SDK for DevTestLabs Management SDK. The DevTest Labs Client. Package tag package-2018-09. 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 DevTestLabs Management SDK. The DevTest Labs Client. Package api-version 2018-09-15. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-devtestlabs - 1.2.0-beta.1 + 1.2.0 ``` [//]: # ({x-version-update-end}) @@ -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 @@ DevTestLabsManager manager = DevTestLabsManager .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. @@ -107,5 +107,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/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md index 0f6e7558fe71..806334303e2a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md @@ -215,8 +215,7 @@ */ public final class ArmTemplatesGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_Get.json + * x-ms-original-file: 2018-09-15/ArmTemplates_Get.json */ /** * Sample code: ArmTemplates_Get. @@ -239,8 +238,7 @@ public final class ArmTemplatesGetSamples { */ public final class ArmTemplatesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_List.json + * x-ms-original-file: 2018-09-15/ArmTemplates_List.json */ /** * Sample code: ArmTemplates_List. @@ -268,8 +266,7 @@ import java.util.Map; */ public final class ArtifactSourcesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ArtifactSources_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/ArtifactSources_CreateOrUpdate.json */ /** * Sample code: ArtifactSources_CreateOrUpdate. @@ -279,7 +276,6 @@ public final class ArtifactSourcesCreateOrUpdateSamples { public static void artifactSourcesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.artifactSources() .define("{artifactSourceName}") - .withRegion((String) null) .withExistingLab("resourceGroupName", "{labName}") .withTags(mapOf("tagName1", "tagValue1")) .withDisplayName("{displayName}") @@ -315,9 +311,7 @@ public final class ArtifactSourcesCreateOrUpdateSamples { */ public final class ArtifactSourcesDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Delete - * .json + * x-ms-original-file: 2018-09-15/ArtifactSources_Delete.json */ /** * Sample code: ArtifactSources_Delete. @@ -340,9 +334,7 @@ public final class ArtifactSourcesDeleteSamples { */ public final class ArtifactSourcesGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Get. - * json + * x-ms-original-file: 2018-09-15/ArtifactSources_Get.json */ /** * Sample code: ArtifactSources_Get. @@ -365,9 +357,7 @@ public final class ArtifactSourcesGetSamples { */ public final class ArtifactSourcesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_List. - * json + * x-ms-original-file: 2018-09-15/ArtifactSources_List.json */ /** * Sample code: ArtifactSources_List. @@ -393,9 +383,7 @@ import java.util.Map; */ public final class ArtifactSourcesUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Update - * .json + * x-ms-original-file: 2018-09-15/ArtifactSources_Update.json */ /** * Sample code: ArtifactSources_Update. @@ -435,8 +423,7 @@ import com.azure.resourcemanager.devtestlabs.models.GenerateArmTemplateRequest; */ public final class ArtifactsGenerateArmTemplateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Artifacts_GenerateArmTemplate.json + * x-ms-original-file: 2018-09-15/Artifacts_GenerateArmTemplate.json */ /** * Sample code: Artifacts_GenerateArmTemplate. @@ -462,8 +449,7 @@ public final class ArtifactsGenerateArmTemplateSamples { */ public final class ArtifactsGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_Get.json + * x-ms-original-file: 2018-09-15/Artifacts_Get.json */ /** * Sample code: Artifacts_Get. @@ -486,8 +472,7 @@ public final class ArtifactsGetSamples { */ public final class ArtifactsListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_List.json + * x-ms-original-file: 2018-09-15/Artifacts_List.json */ /** * Sample code: Artifacts_List. @@ -519,9 +504,7 @@ import java.util.Arrays; */ public final class CostsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_CreateOrUpdate. - * json + * x-ms-original-file: 2018-09-15/Costs_CreateOrUpdate.json */ /** * Sample code: Costs_CreateOrUpdate. @@ -531,7 +514,6 @@ public final class CostsCreateOrUpdateSamples { public static void costsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.costs() .define("targetCost") - .withRegion((String) null) .withExistingLab("resourceGroupName", "{labName}") .withTargetCost(new TargetCostProperties().withStatus(TargetCostStatus.ENABLED) .withTarget(100) @@ -575,8 +557,7 @@ public final class CostsCreateOrUpdateSamples { */ public final class CostsGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_Get.json + * x-ms-original-file: 2018-09-15/Costs_Get.json */ /** * Sample code: Costs_Get. @@ -604,8 +585,7 @@ import java.util.Map; */ public final class CustomImagesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * CustomImages_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/CustomImages_CreateOrUpdate.json */ /** * Sample code: CustomImages_CreateOrUpdate. @@ -615,7 +595,6 @@ public final class CustomImagesCreateOrUpdateSamples { public static void customImagesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.customImages() .define("{customImageName}") - .withRegion((String) null) .withExistingLab("resourceGroupName", "{labName}") .withTags(mapOf("tagName1", "tagValue1")) .withVm(new CustomImagePropertiesFromVm().withSourceVmId( @@ -647,9 +626,7 @@ public final class CustomImagesCreateOrUpdateSamples { */ public final class CustomImagesDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Delete. - * json + * x-ms-original-file: 2018-09-15/CustomImages_Delete.json */ /** * Sample code: CustomImages_Delete. @@ -671,8 +648,7 @@ public final class CustomImagesDeleteSamples { */ public final class CustomImagesGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Get.json + * x-ms-original-file: 2018-09-15/CustomImages_Get.json */ /** * Sample code: CustomImages_Get. @@ -695,8 +671,7 @@ public final class CustomImagesGetSamples { */ public final class CustomImagesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_List.json + * x-ms-original-file: 2018-09-15/CustomImages_List.json */ /** * Sample code: CustomImages_List. @@ -722,9 +697,7 @@ import java.util.Map; */ public final class CustomImagesUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Update. - * json + * x-ms-original-file: 2018-09-15/CustomImages_Update.json */ /** * Sample code: CustomImages_Update. @@ -763,8 +736,7 @@ import com.azure.resourcemanager.devtestlabs.models.AttachDiskProperties; */ public final class DisksAttachSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Attach.json + * x-ms-original-file: 2018-09-15/Disks_Attach.json */ /** * Sample code: Disks_Attach. @@ -791,9 +763,7 @@ import com.azure.resourcemanager.devtestlabs.models.StorageType; */ public final class DisksCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_CreateOrUpdate. - * json + * x-ms-original-file: 2018-09-15/Disks_CreateOrUpdate.json */ /** * Sample code: Disks_CreateOrUpdate. @@ -803,7 +773,6 @@ public final class DisksCreateOrUpdateSamples { public static void disksCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.disks() .define("{diskName}") - .withRegion((String) null) .withExistingUser("resourceGroupName", "{labName}", "{userId}") .withDiskType(StorageType.STANDARD) .withDiskSizeGiB(1023) @@ -822,8 +791,7 @@ public final class DisksCreateOrUpdateSamples { */ public final class DisksDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Delete.json + * x-ms-original-file: 2018-09-15/Disks_Delete.json */ /** * Sample code: Disks_Delete. @@ -831,8 +799,7 @@ public final class DisksDeleteSamples { * @param manager Entry point to DevTestLabsManager. */ public static void disksDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { - manager.disks() - .delete("resourceGroupName", "{labName}", "{userId}", "{diskName}", com.azure.core.util.Context.NONE); + manager.disks().delete("resourceGroupName", "{labName}", "@me", "{diskName}", com.azure.core.util.Context.NONE); } } ``` @@ -847,8 +814,7 @@ import com.azure.resourcemanager.devtestlabs.models.DetachDiskProperties; */ public final class DisksDetachSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Detach.json + * x-ms-original-file: 2018-09-15/Disks_Detach.json */ /** * Sample code: Disks_Detach. @@ -873,8 +839,7 @@ public final class DisksDetachSamples { */ public final class DisksGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Get.json + * x-ms-original-file: 2018-09-15/Disks_Get.json */ /** * Sample code: Disks_Get. @@ -897,8 +862,7 @@ public final class DisksGetSamples { */ public final class DisksListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_List.json + * x-ms-original-file: 2018-09-15/Disks_List.json */ /** * Sample code: Disks_List. @@ -924,8 +888,7 @@ import java.util.Map; */ public final class DisksUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Update.json + * x-ms-original-file: 2018-09-15/Disks_Update.json */ /** * Sample code: Disks_Update. @@ -965,8 +928,7 @@ import java.util.Arrays; */ public final class EnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Environments_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/Environments_CreateOrUpdate.json */ /** * Sample code: Environments_CreateOrUpdate. @@ -976,7 +938,6 @@ public final class EnvironmentsCreateOrUpdateSamples { public static void environmentsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.environments() .define("{environmentName}") - .withRegion((String) null) .withExistingUser("resourceGroupName", "{labName}", "@me") .withDeploymentProperties(new EnvironmentDeploymentProperties().withArmTemplateId( "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}") @@ -994,9 +955,7 @@ public final class EnvironmentsCreateOrUpdateSamples { */ public final class EnvironmentsDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Delete. - * json + * x-ms-original-file: 2018-09-15/Environments_Delete.json */ /** * Sample code: Environments_Delete. @@ -1018,8 +977,7 @@ public final class EnvironmentsDeleteSamples { */ public final class EnvironmentsGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Get.json + * x-ms-original-file: 2018-09-15/Environments_Get.json */ /** * Sample code: Environments_Get. @@ -1042,8 +1000,7 @@ public final class EnvironmentsGetSamples { */ public final class EnvironmentsListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_List.json + * x-ms-original-file: 2018-09-15/Environments_List.json */ /** * Sample code: Environments_List. @@ -1069,9 +1026,7 @@ import java.util.Map; */ public final class EnvironmentsUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Update. - * json + * x-ms-original-file: 2018-09-15/Environments_Update.json */ /** * Sample code: Environments_Update. @@ -1117,8 +1072,7 @@ import java.util.Arrays; */ public final class FormulasCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Formulas_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/Formulas_CreateOrUpdate.json */ /** * Sample code: Formulas_CreateOrUpdate. @@ -1128,8 +1082,8 @@ public final class FormulasCreateOrUpdateSamples { public static void formulasCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.formulas() .define("{formulaName}") - .withRegion("{location}") .withExistingLab("resourceGroupName", "{labName}") + .withRegion("{location}") .withDescription("Formula using a Linux base") .withFormulaContent(new LabVirtualMachineCreationParameter().withLocation("{location}") .withNotes("Ubuntu Server 20.10") @@ -1165,8 +1119,7 @@ public final class FormulasCreateOrUpdateSamples { */ public final class FormulasDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Delete.json + * x-ms-original-file: 2018-09-15/Formulas_Delete.json */ /** * Sample code: Formulas_Delete. @@ -1188,8 +1141,7 @@ public final class FormulasDeleteSamples { */ public final class FormulasGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Get.json + * x-ms-original-file: 2018-09-15/Formulas_Get.json */ /** * Sample code: Formulas_Get. @@ -1211,8 +1163,7 @@ public final class FormulasGetSamples { */ public final class FormulasListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_List.json + * x-ms-original-file: 2018-09-15/Formulas_List.json */ /** * Sample code: Formulas_List. @@ -1238,8 +1189,7 @@ import java.util.Map; */ public final class FormulasUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Update.json + * x-ms-original-file: 2018-09-15/Formulas_Update.json */ /** * Sample code: Formulas_Update. @@ -1275,9 +1225,7 @@ public final class FormulasUpdateSamples { */ public final class GalleryImagesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GalleryImages_List. - * json + * x-ms-original-file: 2018-09-15/GalleryImages_List.json */ /** * Sample code: GalleryImages_List. @@ -1303,8 +1251,7 @@ import java.util.Arrays; */ public final class GlobalSchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * GlobalSchedules_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/GlobalSchedules_CreateOrUpdate.json */ /** * Sample code: GlobalSchedules_CreateOrUpdate. @@ -1314,7 +1261,6 @@ public final class GlobalSchedulesCreateOrUpdateSamples { public static void globalSchedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.globalSchedules() .define("labvmautostart") - .withRegion((String) null) .withExistingResourceGroup("resourceGroupName") .withStatus(EnableStatus.ENABLED) .withTaskType("LabVmsStartupTask") @@ -1335,9 +1281,7 @@ public final class GlobalSchedulesCreateOrUpdateSamples { */ public final class GlobalSchedulesDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Delete - * .json + * x-ms-original-file: 2018-09-15/GlobalSchedules_Delete.json */ /** * Sample code: GlobalSchedules_Delete. @@ -1359,8 +1303,7 @@ public final class GlobalSchedulesDeleteSamples { */ public final class GlobalSchedulesExecuteSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * GlobalSchedules_Execute.json + * x-ms-original-file: 2018-09-15/GlobalSchedules_Execute.json */ /** * Sample code: GlobalSchedules_Execute. @@ -1381,9 +1324,7 @@ public final class GlobalSchedulesExecuteSamples { */ public final class GlobalSchedulesGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Get. - * json + * x-ms-original-file: 2018-09-15/GlobalSchedules_Get.json */ /** * Sample code: GlobalSchedules_Get. @@ -1406,8 +1347,7 @@ public final class GlobalSchedulesGetByResourceGroupSamples { */ public final class GlobalSchedulesListSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * GlobalSchedules_ListBySubscription.json + * x-ms-original-file: 2018-09-15/GlobalSchedules_ListBySubscription.json */ /** * Sample code: GlobalSchedules_ListBySubscription. @@ -1429,8 +1369,7 @@ public final class GlobalSchedulesListSamples { */ public final class GlobalSchedulesListByResourceGroupSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * GlobalSchedules_ListByResourceGroup.json + * x-ms-original-file: 2018-09-15/GlobalSchedules_ListByResourceGroup.json */ /** * Sample code: GlobalSchedules_ListByResourceGroup. @@ -1455,8 +1394,7 @@ import com.azure.resourcemanager.devtestlabs.models.RetargetScheduleProperties; */ public final class GlobalSchedulesRetargetSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * GlobalSchedules_Retarget.json + * x-ms-original-file: 2018-09-15/GlobalSchedules_Retarget.json */ /** * Sample code: GlobalSchedules_Retarget. @@ -1486,9 +1424,7 @@ import java.util.Map; */ public final class GlobalSchedulesUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Update - * .json + * x-ms-original-file: 2018-09-15/GlobalSchedules_Update.json */ /** * Sample code: GlobalSchedules_Update. @@ -1525,8 +1461,7 @@ public final class GlobalSchedulesUpdateSamples { */ public final class LabsClaimAnyVmSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ClaimAnyVm.json + * x-ms-original-file: 2018-09-15/Labs_ClaimAnyVm.json */ /** * Sample code: Labs_ClaimAnyVm. @@ -1552,9 +1487,7 @@ import java.util.Map; */ public final class LabsCreateEnvironmentSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateEnvironment - * .json + * x-ms-original-file: 2018-09-15/Labs_CreateEnvironment.json */ /** * Sample code: Labs_CreateEnvironment. @@ -1609,9 +1542,7 @@ import java.util.Map; */ public final class LabsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateOrUpdate. - * json + * x-ms-original-file: 2018-09-15/Labs_CreateOrUpdate.json */ /** * Sample code: Labs_CreateOrUpdate. @@ -1621,8 +1552,8 @@ public final class LabsCreateOrUpdateSamples { public static void labsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.labs() .define("{labName}") - .withRegion("{location}") .withExistingResourceGroup("resourceGroupName") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) .withLabStorageType(StorageType.fromString("{Standard|Premium}")) .create(); @@ -1650,8 +1581,7 @@ public final class LabsCreateOrUpdateSamples { */ public final class LabsDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Delete.json + * x-ms-original-file: 2018-09-15/Labs_Delete.json */ /** * Sample code: Labs_Delete. @@ -1675,8 +1605,7 @@ import java.time.OffsetDateTime; */ public final class LabsExportResourceUsageSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Labs_ExportResourceUsage.json + * x-ms-original-file: 2018-09-15/Labs_ExportResourceUsage.json */ /** * Sample code: Labs_ExportResourceUsage. @@ -1705,9 +1634,7 @@ import com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriParameter; */ public final class LabsGenerateUploadUriSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_GenerateUploadUri - * .json + * x-ms-original-file: 2018-09-15/Labs_GenerateUploadUri.json */ /** * Sample code: Labs_GenerateUploadUri. @@ -1730,8 +1657,7 @@ public final class LabsGenerateUploadUriSamples { */ public final class LabsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Get.json + * x-ms-original-file: 2018-09-15/Labs_Get.json */ /** * Sample code: Labs_Get. @@ -1755,8 +1681,7 @@ import com.azure.resourcemanager.devtestlabs.models.ImportLabVirtualMachineReque */ public final class LabsImportVirtualMachineSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Labs_ImportVirtualMachine.json + * x-ms-original-file: 2018-09-15/Labs_ImportVirtualMachine.json */ /** * Sample code: Labs_ImportVirtualMachine. @@ -1782,8 +1707,7 @@ public final class LabsImportVirtualMachineSamples { */ public final class LabsListSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Labs_ListBySubscription.json + * x-ms-original-file: 2018-09-15/Labs_ListBySubscription.json */ /** * Sample code: Labs_ListBySubscription. @@ -1804,8 +1728,7 @@ public final class LabsListSamples { */ public final class LabsListByResourceGroupSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Labs_ListByResourceGroup.json + * x-ms-original-file: 2018-09-15/Labs_ListByResourceGroup.json */ /** * Sample code: Labs_ListByResourceGroup. @@ -1827,8 +1750,7 @@ public final class LabsListByResourceGroupSamples { */ public final class LabsListVhdsSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListVhds.json + * x-ms-original-file: 2018-09-15/Labs_ListVhds.json */ /** * Sample code: Labs_ListVhds. @@ -1851,8 +1773,7 @@ import com.azure.resourcemanager.devtestlabs.models.Lab; */ public final class LabsUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Update.json + * x-ms-original-file: 2018-09-15/Labs_Update.json */ /** * Sample code: Labs_Update. @@ -1880,8 +1801,7 @@ import java.util.Arrays; */ public final class NotificationChannelsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * NotificationChannels_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/NotificationChannels_CreateOrUpdate.json */ /** * Sample code: NotificationChannels_CreateOrUpdate. @@ -1892,7 +1812,6 @@ public final class NotificationChannelsCreateOrUpdateSamples { notificationChannelsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.notificationChannels() .define("{notificationChannelName}") - .withRegion((String) null) .withExistingLab("resourceGroupName", "{labName}") .withWebhookUrl("{webhookUrl}") .withEmailRecipient("{email}") @@ -1912,8 +1831,7 @@ public final class NotificationChannelsCreateOrUpdateSamples { */ public final class NotificationChannelsDeleteSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * NotificationChannels_Delete.json + * x-ms-original-file: 2018-09-15/NotificationChannels_Delete.json */ /** * Sample code: NotificationChannels_Delete. @@ -1936,8 +1854,7 @@ public final class NotificationChannelsDeleteSamples { */ public final class NotificationChannelsGetSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * NotificationChannels_Get.json + * x-ms-original-file: 2018-09-15/NotificationChannels_Get.json */ /** * Sample code: NotificationChannels_Get. @@ -1960,8 +1877,7 @@ public final class NotificationChannelsGetSamples { */ public final class NotificationChannelsListSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * NotificationChannels_List.json + * x-ms-original-file: 2018-09-15/NotificationChannels_List.json */ /** * Sample code: NotificationChannels_List. @@ -1986,8 +1902,7 @@ import com.azure.resourcemanager.devtestlabs.models.NotifyParameters; */ public final class NotificationChannelsNotifySamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * NotificationChannels_Notify.json + * x-ms-original-file: 2018-09-15/NotificationChannels_Notify.json */ /** * Sample code: NotificationChannels_Notify. @@ -2015,8 +1930,7 @@ import com.azure.resourcemanager.devtestlabs.models.NotificationChannel; */ public final class NotificationChannelsUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * NotificationChannels_Update.json + * x-ms-original-file: 2018-09-15/NotificationChannels_Update.json */ /** * Sample code: NotificationChannels_Update. @@ -2041,8 +1955,7 @@ public final class NotificationChannelsUpdateSamples { */ public final class OperationsGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Operations_Get.json + * x-ms-original-file: 2018-09-15/Operations_Get.json */ /** * Sample code: Operations_Get. @@ -2069,8 +1982,7 @@ import java.util.Map; */ public final class PoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Policies_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/Policies_CreateOrUpdate.json */ /** * Sample code: Policies_CreateOrUpdate. @@ -2080,8 +1992,8 @@ public final class PoliciesCreateOrUpdateSamples { public static void policiesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.policies() .define("{policyName}") - .withRegion("{location}") .withExistingPolicyset("resourceGroupName", "{labName}", "{policySetName}") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) .withDescription("{policyDescription}") .withStatus(PolicyStatus.fromString("{policyStatus}")) @@ -2114,8 +2026,7 @@ public final class PoliciesCreateOrUpdateSamples { */ public final class PoliciesDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Delete.json + * x-ms-original-file: 2018-09-15/Policies_Delete.json */ /** * Sample code: Policies_Delete. @@ -2138,8 +2049,7 @@ public final class PoliciesDeleteSamples { */ public final class PoliciesGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Get.json + * x-ms-original-file: 2018-09-15/Policies_Get.json */ /** * Sample code: Policies_Get. @@ -2162,8 +2072,7 @@ public final class PoliciesGetSamples { */ public final class PoliciesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_List.json + * x-ms-original-file: 2018-09-15/Policies_List.json */ /** * Sample code: Policies_List. @@ -2190,8 +2099,7 @@ import java.util.Map; */ public final class PoliciesUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Update.json + * x-ms-original-file: 2018-09-15/Policies_Update.json */ /** * Sample code: Policies_Update. @@ -2232,8 +2140,7 @@ import java.util.Arrays; */ public final class PolicySetsEvaluatePoliciesSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * PolicySets_EvaluatePolicies.json + * x-ms-original-file: 2018-09-15/PolicySets_EvaluatePolicies.json */ /** * Sample code: PolicySets_EvaluatePolicies. @@ -2258,8 +2165,7 @@ public final class PolicySetsEvaluatePoliciesSamples { */ public final class ProviderOperationsListSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ProviderOperations_List.json + * x-ms-original-file: 2018-09-15/ProviderOperations_List.json */ /** * Sample code: ProviderOperations_List. @@ -2290,8 +2196,7 @@ import java.util.Map; */ public final class SchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Schedules_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/Schedules_CreateOrUpdate.json */ /** * Sample code: Schedules_CreateOrUpdate. @@ -2301,8 +2206,8 @@ public final class SchedulesCreateOrUpdateSamples { public static void schedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.schedules() .createOrUpdateWithResponse("resourceGroupName", "{labName}", "{scheduleName}", - new ScheduleInner().withLocation("{location}") - .withTags(mapOf("tagName1", "tagValue1")) + new ScheduleInner().withTags(mapOf("tagName1", "tagValue1")) + .withLocation("{location}") .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) .withTaskType("{myLabVmTaskType}") .withWeeklyRecurrence(new WeekDetails().withWeekdays(Arrays.asList("Monday", "Wednesday", "Friday")) @@ -2343,8 +2248,7 @@ public final class SchedulesCreateOrUpdateSamples { */ public final class SchedulesDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Delete.json + * x-ms-original-file: 2018-09-15/Schedules_Delete.json */ /** * Sample code: Schedules_Delete. @@ -2366,8 +2270,7 @@ public final class SchedulesDeleteSamples { */ public final class SchedulesExecuteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Execute.json + * x-ms-original-file: 2018-09-15/Schedules_Execute.json */ /** * Sample code: Schedules_Execute. @@ -2389,8 +2292,7 @@ public final class SchedulesExecuteSamples { */ public final class SchedulesGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Get.json + * x-ms-original-file: 2018-09-15/Schedules_Get.json */ /** * Sample code: Schedules_Get. @@ -2413,8 +2315,7 @@ public final class SchedulesGetSamples { */ public final class SchedulesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_List.json + * x-ms-original-file: 2018-09-15/Schedules_List.json */ /** * Sample code: Schedules_List. @@ -2436,8 +2337,7 @@ public final class SchedulesListSamples { */ public final class SchedulesListApplicableSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Schedules_ListApplicable.json + * x-ms-original-file: 2018-09-15/Schedules_ListApplicable.json */ /** * Sample code: Schedules_ListApplicable. @@ -2463,8 +2363,7 @@ import java.util.Map; */ public final class SchedulesUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Update.json + * x-ms-original-file: 2018-09-15/Schedules_Update.json */ /** * Sample code: Schedules_Update. @@ -2499,9 +2398,7 @@ public final class SchedulesUpdateSamples { */ public final class SecretsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_CreateOrUpdate - * .json + * x-ms-original-file: 2018-09-15/Secrets_CreateOrUpdate.json */ /** * Sample code: Secrets_CreateOrUpdate. @@ -2511,7 +2408,6 @@ public final class SecretsCreateOrUpdateSamples { public static void secretsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.secrets() .define("{secretName}") - .withRegion((String) null) .withExistingUser("resourceGroupName", "{labName}", "{userName}") .withValue("{secret}") .create(); @@ -2527,8 +2423,7 @@ public final class SecretsCreateOrUpdateSamples { */ public final class SecretsDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Delete.json + * x-ms-original-file: 2018-09-15/Secrets_Delete.json */ /** * Sample code: Secrets_Delete. @@ -2551,8 +2446,7 @@ public final class SecretsDeleteSamples { */ public final class SecretsGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Get.json + * x-ms-original-file: 2018-09-15/Secrets_Get.json */ /** * Sample code: Secrets_Get. @@ -2575,8 +2469,7 @@ public final class SecretsGetSamples { */ public final class SecretsListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_List.json + * x-ms-original-file: 2018-09-15/Secrets_List.json */ /** * Sample code: Secrets_List. @@ -2603,8 +2496,7 @@ import java.util.Map; */ public final class SecretsUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Update.json + * x-ms-original-file: 2018-09-15/Secrets_Update.json */ /** * Sample code: Secrets_Update. @@ -2651,8 +2543,7 @@ import java.util.Map; */ public final class ServiceFabricSchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabricSchedules_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/ServiceFabricSchedules_CreateOrUpdate.json */ /** * Sample code: ServiceFabricSchedules_CreateOrUpdate. @@ -2664,8 +2555,8 @@ public final class ServiceFabricSchedulesCreateOrUpdateSamples { manager.serviceFabricSchedules() .createOrUpdateWithResponse("resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", - new ScheduleInner().withLocation("{location}") - .withTags(mapOf("tagName1", "tagValue1")) + new ScheduleInner().withTags(mapOf("tagName1", "tagValue1")) + .withLocation("{location}") .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) .withTaskType( "{Unknown|LabVmsShutdownTask|LabVmsStartupTask|LabVmReclamationTask|ComputeVmShutdownTask}") @@ -2709,8 +2600,7 @@ public final class ServiceFabricSchedulesCreateOrUpdateSamples { */ public final class ServiceFabricSchedulesDeleteSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabricSchedules_Delete.json + * x-ms-original-file: 2018-09-15/ServiceFabricSchedules_Delete.json */ /** * Sample code: ServiceFabricSchedules_Delete. @@ -2733,8 +2623,7 @@ public final class ServiceFabricSchedulesDeleteSamples { */ public final class ServiceFabricSchedulesExecuteSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabricSchedules_Execute.json + * x-ms-original-file: 2018-09-15/ServiceFabricSchedules_Execute.json */ /** * Sample code: ServiceFabricSchedules_Execute. @@ -2757,8 +2646,7 @@ public final class ServiceFabricSchedulesExecuteSamples { */ public final class ServiceFabricSchedulesGetSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabricSchedules_Get.json + * x-ms-original-file: 2018-09-15/ServiceFabricSchedules_Get.json */ /** * Sample code: ServiceFabricSchedules_Get. @@ -2781,8 +2669,7 @@ public final class ServiceFabricSchedulesGetSamples { */ public final class ServiceFabricSchedulesListSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabricSchedules_List.json + * x-ms-original-file: 2018-09-15/ServiceFabricSchedules_List.json */ /** * Sample code: ServiceFabricSchedules_List. @@ -2809,8 +2696,7 @@ import java.util.Map; */ public final class ServiceFabricSchedulesUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabricSchedules_Update.json + * x-ms-original-file: 2018-09-15/ServiceFabricSchedules_Update.json */ /** * Sample code: ServiceFabricSchedules_Update. @@ -2848,8 +2734,7 @@ import java.util.Map; */ public final class ServiceFabricsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabrics_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/ServiceFabrics_CreateOrUpdate.json */ /** * Sample code: ServiceFabrics_CreateOrUpdate. @@ -2859,8 +2744,8 @@ public final class ServiceFabricsCreateOrUpdateSamples { public static void serviceFabricsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.serviceFabrics() .define("{serviceFabricName}") - .withRegion("{location}") .withExistingUser("resourceGroupName", "{labName}", "{userName}") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) .withExternalServiceFabricId("{serviceFabricId}") .withEnvironmentId("{environmentId}") @@ -2889,9 +2774,7 @@ public final class ServiceFabricsCreateOrUpdateSamples { */ public final class ServiceFabricsDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Delete. - * json + * x-ms-original-file: 2018-09-15/ServiceFabrics_Delete.json */ /** * Sample code: ServiceFabrics_Delete. @@ -2914,9 +2797,7 @@ public final class ServiceFabricsDeleteSamples { */ public final class ServiceFabricsGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Get. - * json + * x-ms-original-file: 2018-09-15/ServiceFabrics_Get.json */ /** * Sample code: ServiceFabrics_Get. @@ -2939,9 +2820,7 @@ public final class ServiceFabricsGetSamples { */ public final class ServiceFabricsListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_List. - * json + * x-ms-original-file: 2018-09-15/ServiceFabrics_List.json */ /** * Sample code: ServiceFabrics_List. @@ -2964,8 +2843,7 @@ public final class ServiceFabricsListSamples { */ public final class ServiceFabricsListApplicableSchedulesSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabrics_ListApplicableSchedules.json + * x-ms-original-file: 2018-09-15/ServiceFabrics_ListApplicableSchedules.json */ /** * Sample code: ServiceFabrics_ListApplicableSchedules. @@ -2989,9 +2867,7 @@ public final class ServiceFabricsListApplicableSchedulesSamples { */ public final class ServiceFabricsStartSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Start. - * json + * x-ms-original-file: 2018-09-15/ServiceFabrics_Start.json */ /** * Sample code: ServiceFabrics_Start. @@ -3014,9 +2890,7 @@ public final class ServiceFabricsStartSamples { */ public final class ServiceFabricsStopSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Stop. - * json + * x-ms-original-file: 2018-09-15/ServiceFabrics_Stop.json */ /** * Sample code: ServiceFabrics_Stop. @@ -3043,9 +2917,7 @@ import java.util.Map; */ public final class ServiceFabricsUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Update. - * json + * x-ms-original-file: 2018-09-15/ServiceFabrics_Update.json */ /** * Sample code: ServiceFabrics_Update. @@ -3087,8 +2959,7 @@ import java.util.Map; */ public final class ServiceRunnersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceRunners_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/ServiceRunners_CreateOrUpdate.json */ /** * Sample code: ServiceRunners_CreateOrUpdate. @@ -3098,8 +2969,8 @@ public final class ServiceRunnersCreateOrUpdateSamples { public static void serviceRunnersCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.serviceRunners() .define("{servicerunnerName}") - .withRegion("{location}") .withExistingLab("resourceGroupName", "{devtestlabName}") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) .withIdentity(new IdentityProperties().withType(ManagedIdentityType.fromString("{identityType}")) .withPrincipalId("{identityPrincipalId}") @@ -3130,9 +3001,7 @@ public final class ServiceRunnersCreateOrUpdateSamples { */ public final class ServiceRunnersDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Delete. - * json + * x-ms-original-file: 2018-09-15/ServiceRunners_Delete.json */ /** * Sample code: ServiceRunners_Delete. @@ -3155,9 +3024,7 @@ public final class ServiceRunnersDeleteSamples { */ public final class ServiceRunnersGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Get. - * json + * x-ms-original-file: 2018-09-15/ServiceRunners_Get.json */ /** * Sample code: ServiceRunners_Get. @@ -3185,9 +3052,7 @@ import java.util.Map; */ public final class UsersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_CreateOrUpdate. - * json + * x-ms-original-file: 2018-09-15/Users_CreateOrUpdate.json */ /** * Sample code: Users_CreateOrUpdate. @@ -3197,8 +3062,8 @@ public final class UsersCreateOrUpdateSamples { public static void usersCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.users() .define("{userName}") - .withRegion("{location}") .withExistingLab("resourceGroupName", "{devtestlabName}") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) .withIdentity(new UserIdentity().withPrincipalName("{principalName}") .withPrincipalId("{principalId}") @@ -3232,8 +3097,7 @@ public final class UsersCreateOrUpdateSamples { */ public final class UsersDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Delete.json + * x-ms-original-file: 2018-09-15/Users_Delete.json */ /** * Sample code: Users_Delete. @@ -3254,8 +3118,7 @@ public final class UsersDeleteSamples { */ public final class UsersGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Get.json + * x-ms-original-file: 2018-09-15/Users_Get.json */ /** * Sample code: Users_Get. @@ -3278,8 +3141,7 @@ public final class UsersGetSamples { */ public final class UsersListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_List.json + * x-ms-original-file: 2018-09-15/Users_List.json */ /** * Sample code: Users_List. @@ -3305,8 +3167,7 @@ import java.util.Map; */ public final class UsersUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Update.json + * x-ms-original-file: 2018-09-15/Users_Update.json */ /** * Sample code: Users_Update. @@ -3353,8 +3214,7 @@ import java.util.Map; */ public final class VirtualMachineSchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachineSchedules_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/VirtualMachineSchedules_CreateOrUpdate.json */ /** * Sample code: VirtualMachineSchedules_CreateOrUpdate. @@ -3365,8 +3225,8 @@ public final class VirtualMachineSchedulesCreateOrUpdateSamples { virtualMachineSchedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.virtualMachineSchedules() .createOrUpdateWithResponse("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", - new ScheduleInner().withLocation("{location}") - .withTags(mapOf("tagName1", "tagValue1")) + new ScheduleInner().withTags(mapOf("tagName1", "tagValue1")) + .withLocation("{location}") .withStatus(EnableStatus.ENABLED) .withTaskType("LabVmsShutdownTask") .withWeeklyRecurrence( @@ -3406,8 +3266,7 @@ public final class VirtualMachineSchedulesCreateOrUpdateSamples { */ public final class VirtualMachineSchedulesDeleteSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachineSchedules_Delete.json + * x-ms-original-file: 2018-09-15/VirtualMachineSchedules_Delete.json */ /** * Sample code: VirtualMachineSchedules_Delete. @@ -3430,8 +3289,7 @@ public final class VirtualMachineSchedulesDeleteSamples { */ public final class VirtualMachineSchedulesExecuteSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachineSchedules_Execute.json + * x-ms-original-file: 2018-09-15/VirtualMachineSchedules_Execute.json */ /** * Sample code: VirtualMachineSchedules_Execute. @@ -3454,8 +3312,7 @@ public final class VirtualMachineSchedulesExecuteSamples { */ public final class VirtualMachineSchedulesGetSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachineSchedules_Get.json + * x-ms-original-file: 2018-09-15/VirtualMachineSchedules_Get.json */ /** * Sample code: VirtualMachineSchedules_Get. @@ -3478,8 +3335,7 @@ public final class VirtualMachineSchedulesGetSamples { */ public final class VirtualMachineSchedulesListSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachineSchedules_List.json + * x-ms-original-file: 2018-09-15/VirtualMachineSchedules_List.json */ /** * Sample code: VirtualMachineSchedules_List. @@ -3506,8 +3362,7 @@ import java.util.Map; */ public final class VirtualMachineSchedulesUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachineSchedules_Update.json + * x-ms-original-file: 2018-09-15/VirtualMachineSchedules_Update.json */ /** * Sample code: VirtualMachineSchedules_Update. @@ -3546,8 +3401,7 @@ import com.azure.resourcemanager.devtestlabs.models.StorageType; */ public final class VirtualMachinesAddDataDiskSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_AddDataDisk.json + * x-ms-original-file: 2018-09-15/VirtualMachines_AddDataDisk.json */ /** * Sample code: VirtualMachines_AddDataDisk. @@ -3578,8 +3432,7 @@ import java.util.Arrays; */ public final class VirtualMachinesApplyArtifactsSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_ApplyArtifacts.json + * x-ms-original-file: 2018-09-15/VirtualMachines_ApplyArtifacts.json */ /** * Sample code: VirtualMachines_ApplyArtifacts. @@ -3604,9 +3457,7 @@ public final class VirtualMachinesApplyArtifactsSamples { */ public final class VirtualMachinesClaimSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Claim. - * json + * x-ms-original-file: 2018-09-15/VirtualMachines_Claim.json */ /** * Sample code: VirtualMachines_Claim. @@ -3631,8 +3482,7 @@ import java.util.Map; */ public final class VirtualMachinesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/VirtualMachines_CreateOrUpdate.json */ /** * Sample code: VirtualMachines_CreateOrUpdate. @@ -3642,8 +3492,8 @@ public final class VirtualMachinesCreateOrUpdateSamples { public static void virtualMachinesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.virtualMachines() .define("{vmName}") - .withRegion("{location}") .withExistingLab("resourceGroupName", "{labName}") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) .withSize("Standard_A2_v2") .withUsername("{userName}") @@ -3684,9 +3534,7 @@ public final class VirtualMachinesCreateOrUpdateSamples { */ public final class VirtualMachinesDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Delete - * .json + * x-ms-original-file: 2018-09-15/VirtualMachines_Delete.json */ /** * Sample code: VirtualMachines_Delete. @@ -3710,8 +3558,7 @@ import com.azure.resourcemanager.devtestlabs.models.DetachDataDiskProperties; */ public final class VirtualMachinesDetachDataDiskSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_DetachDataDisk.json + * x-ms-original-file: 2018-09-15/VirtualMachines_DetachDataDisk.json */ /** * Sample code: VirtualMachines_DetachDataDisk. @@ -3736,9 +3583,7 @@ public final class VirtualMachinesDetachDataDiskSamples { */ public final class VirtualMachinesGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Get. - * json + * x-ms-original-file: 2018-09-15/VirtualMachines_Get.json */ /** * Sample code: VirtualMachines_Get. @@ -3760,8 +3605,7 @@ public final class VirtualMachinesGetSamples { */ public final class VirtualMachinesGetRdpFileContentsSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_GetRdpFileContents.json + * x-ms-original-file: 2018-09-15/VirtualMachines_GetRdpFileContents.json */ /** * Sample code: VirtualMachines_GetRdpFileContents. @@ -3785,9 +3629,7 @@ public final class VirtualMachinesGetRdpFileContentsSamples { */ public final class VirtualMachinesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_List. - * json + * x-ms-original-file: 2018-09-15/VirtualMachines_List.json */ /** * Sample code: VirtualMachines_List. @@ -3809,8 +3651,7 @@ public final class VirtualMachinesListSamples { */ public final class VirtualMachinesListApplicableSchedulesSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_ListApplicableSchedules.json + * x-ms-original-file: 2018-09-15/VirtualMachines_ListApplicableSchedules.json */ /** * Sample code: VirtualMachines_ListApplicableSchedules. @@ -3834,8 +3675,7 @@ public final class VirtualMachinesListApplicableSchedulesSamples { */ public final class VirtualMachinesRedeploySamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_Redeploy.json + * x-ms-original-file: 2018-09-15/VirtualMachines_Redeploy.json */ /** * Sample code: VirtualMachines_Redeploy. @@ -3859,9 +3699,7 @@ import com.azure.resourcemanager.devtestlabs.models.ResizeLabVirtualMachinePrope */ public final class VirtualMachinesResizeSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Resize - * .json + * x-ms-original-file: 2018-09-15/VirtualMachines_Resize.json */ /** * Sample code: VirtualMachines_Resize. @@ -3884,8 +3722,7 @@ public final class VirtualMachinesResizeSamples { */ public final class VirtualMachinesRestartSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_Restart.json + * x-ms-original-file: 2018-09-15/VirtualMachines_Restart.json */ /** * Sample code: VirtualMachines_Restart. @@ -3907,9 +3744,7 @@ public final class VirtualMachinesRestartSamples { */ public final class VirtualMachinesStartSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Start. - * json + * x-ms-original-file: 2018-09-15/VirtualMachines_Start.json */ /** * Sample code: VirtualMachines_Start. @@ -3930,9 +3765,7 @@ public final class VirtualMachinesStartSamples { */ public final class VirtualMachinesStopSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Stop. - * json + * x-ms-original-file: 2018-09-15/VirtualMachines_Stop.json */ /** * Sample code: VirtualMachines_Stop. @@ -3953,8 +3786,7 @@ public final class VirtualMachinesStopSamples { */ public final class VirtualMachinesTransferDisksSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_TransferDisks.json + * x-ms-original-file: 2018-09-15/VirtualMachines_TransferDisks.json */ /** * Sample code: VirtualMachines_TransferDisks. @@ -3976,8 +3808,7 @@ public final class VirtualMachinesTransferDisksSamples { */ public final class VirtualMachinesUnClaimSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_UnClaim.json + * x-ms-original-file: 2018-09-15/VirtualMachines_UnClaim.json */ /** * Sample code: VirtualMachines_UnClaim. @@ -4001,9 +3832,7 @@ import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachine; */ public final class VirtualMachinesUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Update - * .json + * x-ms-original-file: 2018-09-15/VirtualMachines_Update.json */ /** * Sample code: VirtualMachines_Update. @@ -4022,6 +3851,9 @@ public final class VirtualMachinesUpdateSamples { ### VirtualNetworks_CreateOrUpdate ```java +import com.azure.resourcemanager.devtestlabs.models.Subnet; +import com.azure.resourcemanager.devtestlabs.models.UsagePermissionType; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -4030,8 +3862,7 @@ import java.util.Map; */ public final class VirtualNetworksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualNetworks_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/VirtualNetworks_CreateOrUpdate.json */ /** * Sample code: VirtualNetworks_CreateOrUpdate. @@ -4041,9 +3872,13 @@ public final class VirtualNetworksCreateOrUpdateSamples { public static void virtualNetworksCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.virtualNetworks() .define("{virtualNetworkName}") - .withRegion("{location}") .withExistingLab("resourceGroupName", "{labName}") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) + .withAllowedSubnets(Arrays.asList(new Subnet().withResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{virtualNetworkName}Subnet") + .withLabSubnetName("{virtualNetworkName}Subnet") + .withAllowPublicIp(UsagePermissionType.ALLOW))) .create(); } @@ -4069,9 +3904,7 @@ public final class VirtualNetworksCreateOrUpdateSamples { */ public final class VirtualNetworksDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Delete - * .json + * x-ms-original-file: 2018-09-15/VirtualNetworks_Delete.json */ /** * Sample code: VirtualNetworks_Delete. @@ -4093,9 +3926,7 @@ public final class VirtualNetworksDeleteSamples { */ public final class VirtualNetworksGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Get. - * json + * x-ms-original-file: 2018-09-15/VirtualNetworks_Get.json */ /** * Sample code: VirtualNetworks_Get. @@ -4118,9 +3949,7 @@ public final class VirtualNetworksGetSamples { */ public final class VirtualNetworksListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_List. - * json + * x-ms-original-file: 2018-09-15/VirtualNetworks_List.json */ /** * Sample code: VirtualNetworks_List. @@ -4146,9 +3975,7 @@ import java.util.Map; */ public final class VirtualNetworksUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Update - * .json + * x-ms-original-file: 2018-09-15/VirtualNetworks_Update.json */ /** * Sample code: VirtualNetworks_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml index 8c1cdca10eae..dad9b3d971bc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-devtestlabs - 1.2.0-beta.1 + 1.2.0 jar Microsoft Azure SDK for DevTestLabs Management - This package contains Microsoft Azure SDK for DevTestLabs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The DevTest Labs Client. Package tag package-2018-09. + This package contains Microsoft Azure SDK for DevTestLabs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The DevTest Labs Client. Package api-version 2018-09-15. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + false diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManager.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManager.java index 304fc9637408..a9bbfcbca513 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManager.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs; @@ -22,14 +22,15 @@ import com.azure.core.http.policy.UserAgentPolicy; 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.devtestlabs.fluent.DevTestLabsClient; +import com.azure.resourcemanager.devtestlabs.fluent.DevTestLabsManagementClient; import com.azure.resourcemanager.devtestlabs.implementation.ArmTemplatesImpl; import com.azure.resourcemanager.devtestlabs.implementation.ArtifactSourcesImpl; import com.azure.resourcemanager.devtestlabs.implementation.ArtifactsImpl; import com.azure.resourcemanager.devtestlabs.implementation.CostsImpl; import com.azure.resourcemanager.devtestlabs.implementation.CustomImagesImpl; -import com.azure.resourcemanager.devtestlabs.implementation.DevTestLabsClientBuilder; +import com.azure.resourcemanager.devtestlabs.implementation.DevTestLabsManagementClientBuilder; import com.azure.resourcemanager.devtestlabs.implementation.DisksImpl; import com.azure.resourcemanager.devtestlabs.implementation.EnvironmentsImpl; import com.azure.resourcemanager.devtestlabs.implementation.FormulasImpl; @@ -79,6 +80,7 @@ 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; @@ -91,10 +93,14 @@ public final class DevTestLabsManager { private Labs labs; - private Operations operations; - private GlobalSchedules globalSchedules; + private Schedules schedules; + + private ServiceFabricSchedules serviceFabricSchedules; + + private VirtualMachineSchedules virtualMachineSchedules; + private ArtifactSources artifactSources; private ArmTemplates armTemplates; @@ -111,11 +117,9 @@ public final class DevTestLabsManager { private NotificationChannels notificationChannels; - private PolicySets policySets; - private Policies policies; - private Schedules schedules; + private PolicySets policySets; private ServiceRunners serviceRunners; @@ -129,20 +133,18 @@ public final class DevTestLabsManager { private ServiceFabrics serviceFabrics; - private ServiceFabricSchedules serviceFabricSchedules; - private VirtualMachines virtualMachines; - private VirtualMachineSchedules virtualMachineSchedules; - private VirtualNetworks virtualNetworks; - private final DevTestLabsClient clientObject; + private Operations operations; + + private final DevTestLabsManagementClient clientObject; private DevTestLabsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new DevTestLabsClientBuilder().pipeline(httpPipeline) + this.clientObject = new DevTestLabsManagementClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -189,6 +191,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-devtestlabs.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -296,12 +301,14 @@ public DevTestLabsManager authenticate(TokenCredential credential, AzureProfile 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.devtestlabs") .append("/") - .append("1.1.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -371,18 +378,6 @@ public Labs labs() { return labs; } - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - /** * Gets the resource collection API of GlobalSchedules. It manages Schedule. * @@ -395,6 +390,44 @@ public GlobalSchedules globalSchedules() { return globalSchedules; } + /** + * Gets the resource collection API of Schedules. + * + * @return Resource collection API of Schedules. + */ + public Schedules schedules() { + if (this.schedules == null) { + this.schedules = new SchedulesImpl(clientObject.getSchedules(), this); + } + return schedules; + } + + /** + * Gets the resource collection API of ServiceFabricSchedules. + * + * @return Resource collection API of ServiceFabricSchedules. + */ + public ServiceFabricSchedules serviceFabricSchedules() { + if (this.serviceFabricSchedules == null) { + this.serviceFabricSchedules + = new ServiceFabricSchedulesImpl(clientObject.getServiceFabricSchedules(), this); + } + return serviceFabricSchedules; + } + + /** + * Gets the resource collection API of VirtualMachineSchedules. + * + * @return Resource collection API of VirtualMachineSchedules. + */ + public VirtualMachineSchedules virtualMachineSchedules() { + if (this.virtualMachineSchedules == null) { + this.virtualMachineSchedules + = new VirtualMachineSchedulesImpl(clientObject.getVirtualMachineSchedules(), this); + } + return virtualMachineSchedules; + } + /** * Gets the resource collection API of ArtifactSources. It manages ArtifactSource. * @@ -491,18 +524,6 @@ public NotificationChannels notificationChannels() { return notificationChannels; } - /** - * Gets the resource collection API of PolicySets. - * - * @return Resource collection API of PolicySets. - */ - public PolicySets policySets() { - if (this.policySets == null) { - this.policySets = new PolicySetsImpl(clientObject.getPolicySets(), this); - } - return policySets; - } - /** * Gets the resource collection API of Policies. It manages Policy. * @@ -516,15 +537,15 @@ public Policies policies() { } /** - * Gets the resource collection API of Schedules. + * Gets the resource collection API of PolicySets. * - * @return Resource collection API of Schedules. + * @return Resource collection API of PolicySets. */ - public Schedules schedules() { - if (this.schedules == null) { - this.schedules = new SchedulesImpl(clientObject.getSchedules(), this); + public PolicySets policySets() { + if (this.policySets == null) { + this.policySets = new PolicySetsImpl(clientObject.getPolicySets(), this); } - return schedules; + return policySets; } /** @@ -599,19 +620,6 @@ public ServiceFabrics serviceFabrics() { return serviceFabrics; } - /** - * Gets the resource collection API of ServiceFabricSchedules. - * - * @return Resource collection API of ServiceFabricSchedules. - */ - public ServiceFabricSchedules serviceFabricSchedules() { - if (this.serviceFabricSchedules == null) { - this.serviceFabricSchedules - = new ServiceFabricSchedulesImpl(clientObject.getServiceFabricSchedules(), this); - } - return serviceFabricSchedules; - } - /** * Gets the resource collection API of VirtualMachines. It manages LabVirtualMachine. * @@ -624,19 +632,6 @@ public VirtualMachines virtualMachines() { return virtualMachines; } - /** - * Gets the resource collection API of VirtualMachineSchedules. - * - * @return Resource collection API of VirtualMachineSchedules. - */ - public VirtualMachineSchedules virtualMachineSchedules() { - if (this.virtualMachineSchedules == null) { - this.virtualMachineSchedules - = new VirtualMachineSchedulesImpl(clientObject.getVirtualMachineSchedules(), this); - } - return virtualMachineSchedules; - } - /** * Gets the resource collection API of VirtualNetworks. It manages VirtualNetwork. * @@ -650,12 +645,24 @@ public VirtualNetworks virtualNetworks() { } /** - * Gets wrapped service client DevTestLabsClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets wrapped service client DevTestLabsManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. * - * @return Wrapped service client DevTestLabsClient. + * @return Wrapped service client DevTestLabsManagementClient. */ - public DevTestLabsClient serviceClient() { + public DevTestLabsManagementClient serviceClient() { return this.clientObject; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArmTemplatesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArmTemplatesClient.java index 81efdadab585..a5d43d4b41fc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArmTemplatesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArmTemplatesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -16,69 +16,69 @@ */ public interface ArmTemplatesClient { /** - * List azure resource manager templates in a given artifact source. + * Get azure resource manager template. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. + * @param name The name of the azure resource manager template. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return azure resource manager template along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String artifactSourceName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String labName, String artifactSourceName, + String name, String expand, Context context); /** - * List azure resource manager templates in a given artifact source. + * Get azure resource manager template. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param name The name of the azure resource manager template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return azure resource manager template. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ArmTemplateInner get(String resourceGroupName, String labName, String artifactSourceName, String name); /** - * Get azure resource manager template. + * List azure resource manager templates in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the azure resource manager template. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String labName, String artifactSourceName, - String name, String expand, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String artifactSourceName); /** - * Get azure resource manager template. + * List azure resource manager templates in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the azure resource manager template. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ArmTemplateInner get(String resourceGroupName, String labName, String artifactSourceName, String name); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, + String expand, String filter, Integer top, String orderby, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactSourcesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactSourcesClient.java index 7e51ff2aa83a..1670341b969d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactSourcesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactSourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -17,72 +17,73 @@ */ public interface ArtifactSourcesClient { /** - * List artifact sources in a given lab. + * Get artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. + * @param name The name of the artifact source. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return artifact source along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String labName, String name, String expand, + Context context); /** - * List artifact sources in a given lab. + * Get artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param name The name of the artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return artifact source. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactSourceInner get(String resourceGroupName, String labName, String name); /** - * Get artifact source. + * Create or replace an existing artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param artifactSource Properties of an artifact source. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact source along with {@link Response}. + * @return properties of an artifact source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String labName, String name, String expand, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + ArtifactSourceInner artifactSource, Context context); /** - * Get artifact source. + * Create or replace an existing artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. + * @param artifactSource Properties of an artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact source. + * @return properties of an artifact source. */ @ServiceMethod(returns = ReturnType.SINGLE) - ArtifactSourceInner get(String resourceGroupName, String labName, String name); + ArtifactSourceInner createOrUpdate(String resourceGroupName, String labName, String name, + ArtifactSourceInner artifactSource); /** - * Create or replace an existing artifact source. + * Allows modifying tags of artifact sources. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @param artifactSource Properties of an artifact source. @@ -93,13 +94,13 @@ Response getWithResponse(String resourceGroupName, String l * @return properties of an artifact source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, - ArtifactSourceInner artifactSource, Context context); + Response updateWithResponse(String resourceGroupName, String labName, String name, + ArtifactSourceFragment artifactSource, Context context); /** - * Create or replace an existing artifact source. + * Allows modifying tags of artifact sources. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @param artifactSource Properties of an artifact source. @@ -109,13 +110,13 @@ Response createOrUpdateWithResponse(String resourceGroupNam * @return properties of an artifact source. */ @ServiceMethod(returns = ReturnType.SINGLE) - ArtifactSourceInner createOrUpdate(String resourceGroupName, String labName, String name, - ArtifactSourceInner artifactSource); + ArtifactSourceInner update(String resourceGroupName, String labName, String name, + ArtifactSourceFragment artifactSource); /** * Delete artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @param context The context to associate with this operation. @@ -130,7 +131,7 @@ ArtifactSourceInner createOrUpdate(String resourceGroupName, String labName, Str /** * Delete artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -141,35 +142,34 @@ ArtifactSourceInner createOrUpdate(String resourceGroupName, String labName, Str void delete(String resourceGroupName, String labName, String name); /** - * Allows modifying tags of artifact sources. All other properties will be ignored. + * List artifact sources in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String name, - ArtifactSourceFragment artifactSource, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); /** - * Allows modifying tags of artifact sources. All other properties will be ignored. + * List artifact sources in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ArtifactSourceInner update(String resourceGroupName, String labName, String name, - ArtifactSourceFragment artifactSource); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactsClient.java index cf104774aca8..5a6af5f465f6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -18,77 +18,77 @@ */ public interface ArtifactsClient { /** - * List artifacts in a given artifact source. + * Get artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. + * @param name The name of the artifact. + * @param expand Specify the $expand query. Example: 'properties($select=title)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return artifact along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String artifactSourceName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String labName, String artifactSourceName, + String name, String expand, Context context); /** - * List artifacts in a given artifact source. + * Get artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param name The name of the artifact. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return artifact. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ArtifactInner get(String resourceGroupName, String labName, String artifactSourceName, String name); /** - * Get artifact. + * List artifacts in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the artifact. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String labName, String artifactSourceName, - String name, String expand, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String artifactSourceName); /** - * Get artifact. + * List artifacts in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the artifact. + * @param expand Specify the $expand query. Example: 'properties($select=title)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ArtifactInner get(String resourceGroupName, String labName, String artifactSourceName, String name); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, + String expand, String filter, Integer top, String orderby, Context context); /** * Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates * the generated artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. @@ -107,7 +107,7 @@ Response generateArmTemplateWithResponse(String resourceGr * Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates * the generated artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CostsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CostsClient.java index cd228f8dbe8b..8d6cb0711eb3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CostsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CostsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -17,7 +17,7 @@ public interface CostsClient { /** * Get cost. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @param expand Specify the $expand query. Example: 'properties($expand=labCostDetails)'. @@ -34,7 +34,7 @@ Response getWithResponse(String resourceGroupName, String labName, /** * Get cost. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -48,7 +48,7 @@ Response getWithResponse(String resourceGroupName, String labName, /** * Create or replace an existing cost. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @param labCost A cost item. @@ -65,7 +65,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, Stri /** * Create or replace an existing cost. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @param labCost A cost item. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CustomImagesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CustomImagesClient.java index 66380b27fa58..6174ca943fbe 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CustomImagesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CustomImagesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -18,44 +18,12 @@ * An instance of this class provides access to all the operations defined in CustomImagesClient. */ public interface CustomImagesClient { - /** - * List custom images in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName); - - /** - * List custom images in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context); - /** * Get custom image. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param expand Specify the $expand query. Example: 'properties($select=vm)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -70,9 +38,9 @@ Response getWithResponse(String resourceGroupName, String labN /** * Get custom image. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -84,9 +52,9 @@ Response getWithResponse(String resourceGroupName, String labN /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -100,9 +68,9 @@ SyncPoller, CustomImageInner> beginCreateOrUpdate(S /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -117,9 +85,9 @@ SyncPoller, CustomImageInner> beginCreateOrUpdate(S /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -133,9 +101,9 @@ CustomImageInner createOrUpdate(String resourceGroupName, String labName, String /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -147,12 +115,44 @@ CustomImageInner createOrUpdate(String resourceGroupName, String labName, String CustomImageInner createOrUpdate(String resourceGroupName, String labName, String name, CustomImageInner customImage, Context context); + /** + * Allows modifying tags of custom images. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the CustomImage. + * @param customImage A custom image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a custom image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String labName, String name, + CustomImageFragment customImage, Context context); + + /** + * Allows modifying tags of custom images. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the CustomImage. + * @param customImage A custom image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a custom image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomImageInner update(String resourceGroupName, String labName, String name, CustomImageFragment customImage); + /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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,9 +164,9 @@ CustomImageInner createOrUpdate(String resourceGroupName, String labName, String /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -180,9 +180,9 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -193,9 +193,9 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -205,34 +205,34 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String void delete(String resourceGroupName, String labName, String name, Context context); /** - * Allows modifying tags of custom images. All other properties will be ignored. + * List custom images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param customImage A custom image. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String name, - CustomImageFragment customImage, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); /** - * Allows modifying tags of custom images. All other properties will be ignored. + * List custom images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param customImage A custom image. + * @param expand Specify the $expand query. Example: 'properties($select=vm)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomImageInner update(String resourceGroupName, String labName, String name, CustomImageFragment customImage); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DevTestLabsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DevTestLabsManagementClient.java similarity index 94% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DevTestLabsClient.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DevTestLabsManagementClient.java index cd6dd2b6e268..81b6b30ec62b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DevTestLabsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DevTestLabsManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -8,30 +8,30 @@ import java.time.Duration; /** - * The interface for DevTestLabsClient class. + * The interface for DevTestLabsManagementClient class. */ -public interface DevTestLabsClient { +public interface DevTestLabsManagementClient { /** - * Gets The subscription ID. - * - * @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. * @@ -61,18 +61,32 @@ public interface DevTestLabsClient { LabsClient getLabs(); /** - * Gets the OperationsClient object to access its operations. + * Gets the GlobalSchedulesClient object to access its operations. * - * @return the OperationsClient object. + * @return the GlobalSchedulesClient object. */ - OperationsClient getOperations(); + GlobalSchedulesClient getGlobalSchedules(); /** - * Gets the GlobalSchedulesClient object to access its operations. + * Gets the SchedulesClient object to access its operations. * - * @return the GlobalSchedulesClient object. + * @return the SchedulesClient object. */ - GlobalSchedulesClient getGlobalSchedules(); + SchedulesClient getSchedules(); + + /** + * Gets the ServiceFabricSchedulesClient object to access its operations. + * + * @return the ServiceFabricSchedulesClient object. + */ + ServiceFabricSchedulesClient getServiceFabricSchedules(); + + /** + * Gets the VirtualMachineSchedulesClient object to access its operations. + * + * @return the VirtualMachineSchedulesClient object. + */ + VirtualMachineSchedulesClient getVirtualMachineSchedules(); /** * Gets the ArtifactSourcesClient object to access its operations. @@ -130,13 +144,6 @@ public interface DevTestLabsClient { */ NotificationChannelsClient getNotificationChannels(); - /** - * Gets the PolicySetsClient object to access its operations. - * - * @return the PolicySetsClient object. - */ - PolicySetsClient getPolicySets(); - /** * Gets the PoliciesClient object to access its operations. * @@ -145,11 +152,11 @@ public interface DevTestLabsClient { PoliciesClient getPolicies(); /** - * Gets the SchedulesClient object to access its operations. + * Gets the PolicySetsClient object to access its operations. * - * @return the SchedulesClient object. + * @return the PolicySetsClient object. */ - SchedulesClient getSchedules(); + PolicySetsClient getPolicySets(); /** * Gets the ServiceRunnersClient object to access its operations. @@ -193,13 +200,6 @@ public interface DevTestLabsClient { */ ServiceFabricsClient getServiceFabrics(); - /** - * Gets the ServiceFabricSchedulesClient object to access its operations. - * - * @return the ServiceFabricSchedulesClient object. - */ - ServiceFabricSchedulesClient getServiceFabricSchedules(); - /** * Gets the VirtualMachinesClient object to access its operations. * @@ -208,16 +208,16 @@ public interface DevTestLabsClient { VirtualMachinesClient getVirtualMachines(); /** - * Gets the VirtualMachineSchedulesClient object to access its operations. + * Gets the VirtualNetworksClient object to access its operations. * - * @return the VirtualMachineSchedulesClient object. + * @return the VirtualNetworksClient object. */ - VirtualMachineSchedulesClient getVirtualMachineSchedules(); + VirtualNetworksClient getVirtualNetworks(); /** - * Gets the VirtualNetworksClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the VirtualNetworksClient object. + * @return the OperationsClient object. */ - VirtualNetworksClient getVirtualNetworks(); + OperationsClient getOperations(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DisksClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DisksClient.java index 16a0c1f63043..920c9a35e052 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DisksClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DisksClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -20,46 +20,12 @@ * An instance of this class provides access to all the operations defined in DisksClient. */ public interface DisksClient { - /** - * List disks in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String username); - - /** - * List disks in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context); - /** * Get disk. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. * @param context The context to associate with this operation. @@ -69,15 +35,15 @@ PagedIterable list(String resourceGroupName, String labName, String u * @return disk along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String labName, String username, String name, + Response getWithResponse(String resourceGroupName, String labName, String userName, String name, String expand, Context context); /** * Get disk. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -85,14 +51,14 @@ Response getWithResponse(String resourceGroupName, String labName, St * @return disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - DiskInner get(String resourceGroupName, String labName, String username, String name); + DiskInner get(String resourceGroupName, String labName, String userName, String name); /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -102,14 +68,14 @@ Response getWithResponse(String resourceGroupName, String labName, St */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DiskInner> beginCreateOrUpdate(String resourceGroupName, String labName, - String username, String name, DiskInner disk); + String userName, String name, DiskInner disk); /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. * @param context The context to associate with this operation. @@ -120,14 +86,14 @@ SyncPoller, DiskInner> beginCreateOrUpdate(String resource */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DiskInner> beginCreateOrUpdate(String resourceGroupName, String labName, - String username, String name, DiskInner disk, Context context); + String userName, String name, DiskInner disk, Context context); /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -136,14 +102,14 @@ SyncPoller, DiskInner> beginCreateOrUpdate(String resource * @return a Disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - DiskInner createOrUpdate(String resourceGroupName, String labName, String username, String name, DiskInner disk); + DiskInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, DiskInner disk); /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. * @param context The context to associate with this operation. @@ -153,15 +119,49 @@ SyncPoller, DiskInner> beginCreateOrUpdate(String resource * @return a Disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - DiskInner createOrUpdate(String resourceGroupName, String labName, String username, String name, DiskInner disk, + DiskInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, DiskInner disk, Context context); + /** + * Allows modifying tags of disks. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the disk. + * @param disk A Disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Disk along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String labName, String userName, String name, + DiskFragment disk, Context context); + + /** + * Allows modifying tags of disks. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the disk. + * @param disk A Disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskInner update(String resourceGroupName, String labName, String userName, String name, DiskFragment disk); + /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -169,15 +169,15 @@ DiskInner createOrUpdate(String resourceGroupName, String labName, String userna * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String userName, String name); /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -186,29 +186,29 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String userName, String name, Context context); /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 labName, String username, String name); + void delete(String resourceGroupName, String labName, String userName, String name); /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -216,48 +216,48 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labName, String username, String name, Context context); + void delete(String resourceGroupName, String labName, String userName, String name, Context context); /** - * Allows modifying tags of disks. All other properties will be ignored. + * List disks in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. - * @param disk A Disk. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String username, String name, - DiskFragment disk, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String userName); /** - * Allows modifying tags of disks. All other properties will be ignored. + * List disks in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. - * @param disk A Disk. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiskInner update(String resourceGroupName, String labName, String username, String name, DiskFragment disk); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby, Context context); /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -266,15 +266,15 @@ Response updateWithResponse(String resourceGroupName, String labName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginAttach(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginAttach(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties); /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. * @param context The context to associate with this operation. @@ -284,15 +284,15 @@ SyncPoller, Void> beginAttach(String resourceGroupName, String * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginAttach(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginAttach(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties, Context context); /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -300,15 +300,15 @@ SyncPoller, Void> beginAttach(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void attach(String resourceGroupName, String labName, String username, String name, + void attach(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties); /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. * @param context The context to associate with this operation. @@ -317,16 +317,16 @@ void attach(String resourceGroupName, String labName, String username, String na * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void attach(String resourceGroupName, String labName, String username, String name, + void attach(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties, Context context); /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -335,16 +335,16 @@ void attach(String resourceGroupName, String labName, String username, String na * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDetach(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginDetach(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties); /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. * @param context The context to associate with this operation. @@ -354,16 +354,16 @@ SyncPoller, Void> beginDetach(String resourceGroupName, String * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDetach(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginDetach(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties, Context context); /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -371,16 +371,16 @@ SyncPoller, Void> beginDetach(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void detach(String resourceGroupName, String labName, String username, String name, + void detach(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties); /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. * @param context The context to associate with this operation. @@ -389,6 +389,6 @@ void detach(String resourceGroupName, String labName, String username, String na * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void detach(String resourceGroupName, String labName, String username, String name, + void detach(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/EnvironmentsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/EnvironmentsClient.java index 768014c9158d..056cf4d1c7d3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/EnvironmentsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/EnvironmentsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -18,46 +18,12 @@ * An instance of this class provides access to all the operations defined in EnvironmentsClient. */ public interface EnvironmentsClient { - /** - * List environments in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String username); - - /** - * List environments in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context); - /** * Get environment. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. * @param context The context to associate with this operation. @@ -67,15 +33,15 @@ PagedIterable list(String resourceGroupName, String labName * @return environment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String labName, String username, + Response getWithResponse(String resourceGroupName, String labName, String userName, String name, String expand, Context context); /** * Get environment. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -83,14 +49,14 @@ Response getWithResponse(String resourceGroupName, String l * @return environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - DtlEnvironmentInner get(String resourceGroupName, String labName, String username, String name); + DtlEnvironmentInner get(String resourceGroupName, String labName, String userName, String name); /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -100,14 +66,14 @@ Response getWithResponse(String resourceGroupName, String l */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DtlEnvironmentInner> beginCreateOrUpdate(String resourceGroupName, - String labName, String username, String name, DtlEnvironmentInner dtlEnvironment); + String labName, String userName, String name, DtlEnvironmentInner dtlEnvironment); /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. * @param context The context to associate with this operation. @@ -118,14 +84,14 @@ SyncPoller, DtlEnvironmentInner> beginCreateOrUp */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DtlEnvironmentInner> beginCreateOrUpdate(String resourceGroupName, - String labName, String username, String name, DtlEnvironmentInner dtlEnvironment, Context context); + String labName, String userName, String name, DtlEnvironmentInner dtlEnvironment, Context context); /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -134,15 +100,15 @@ SyncPoller, DtlEnvironmentInner> beginCreateOrUp * @return an environment, which is essentially an ARM template deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - DtlEnvironmentInner createOrUpdate(String resourceGroupName, String labName, String username, String name, + DtlEnvironmentInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, DtlEnvironmentInner dtlEnvironment); /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. * @param context The context to associate with this operation. @@ -152,15 +118,50 @@ DtlEnvironmentInner createOrUpdate(String resourceGroupName, String labName, Str * @return an environment, which is essentially an ARM template deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - DtlEnvironmentInner createOrUpdate(String resourceGroupName, String labName, String username, String name, + DtlEnvironmentInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, DtlEnvironmentInner dtlEnvironment, Context context); + /** + * Allows modifying tags of environments. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the environment. + * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 environment, which is essentially an ARM template deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String labName, String userName, + String name, DtlEnvironmentFragment dtlEnvironment, Context context); + + /** + * Allows modifying tags of environments. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the environment. + * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 environment, which is essentially an ARM template deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DtlEnvironmentInner update(String resourceGroupName, String labName, String userName, String name, + DtlEnvironmentFragment dtlEnvironment); + /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -168,15 +169,15 @@ DtlEnvironmentInner createOrUpdate(String resourceGroupName, String labName, Str * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String userName, String name); /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -185,29 +186,29 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String userName, String name, Context context); /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 labName, String username, String name); + void delete(String resourceGroupName, String labName, String userName, String name); /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -215,40 +216,39 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labName, String username, String name, Context context); + void delete(String resourceGroupName, String labName, String userName, String name, Context context); /** - * Allows modifying tags of environments. All other properties will be ignored. + * List environments in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 environment, which is essentially an ARM template deployment along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String username, - String name, DtlEnvironmentFragment dtlEnvironment, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String userName); /** - * Allows modifying tags of environments. All other properties will be ignored. + * List environments in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 environment, which is essentially an ARM template deployment. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DtlEnvironmentInner update(String resourceGroupName, String labName, String username, String name, - DtlEnvironmentFragment dtlEnvironment); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/FormulasClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/FormulasClient.java index 0486cb97d0ac..7d009f777921 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/FormulasClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/FormulasClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -18,42 +18,10 @@ * An instance of this class provides access to all the operations defined in FormulasClient. */ public interface FormulasClient { - /** - * List formulas in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName); - - /** - * List formulas in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context); - /** * Get formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param expand Specify the $expand query. Example: 'properties($select=description)'. @@ -70,7 +38,7 @@ Response getWithResponse(String resourceGroupName, String labName, /** * Get formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -84,7 +52,7 @@ Response getWithResponse(String resourceGroupName, String labName, /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other parameters. @@ -101,7 +69,7 @@ SyncPoller, FormulaInner> beginCreateOrUpdate(String re /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other parameters. @@ -119,7 +87,7 @@ SyncPoller, FormulaInner> beginCreateOrUpdate(String re /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other parameters. @@ -134,7 +102,7 @@ SyncPoller, FormulaInner> beginCreateOrUpdate(String re /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other parameters. @@ -149,62 +117,94 @@ FormulaInner createOrUpdate(String resourceGroupName, String labName, String nam Context context); /** - * Delete formula. + * Allows modifying tags of formulas. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. + * @param formula A formula for creating a VM, specifying an image base and other 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); + Response updateWithResponse(String resourceGroupName, String labName, String name, + FormulaFragment formula, Context context); /** - * Delete formula. + * Allows modifying tags of formulas. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. + * @param formula A formula for creating a VM, specifying an image base and other 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 a formula for creating a VM, specifying an image base and other parameters. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labName, String name); + FormulaInner update(String resourceGroupName, String labName, String name, FormulaFragment formula); /** - * Allows modifying tags of formulas. All other properties will be ignored. + * Delete formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String name, - FormulaFragment formula, Context context); + Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); /** - * Allows modifying tags of formulas. All other properties will be ignored. + * Delete formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other 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 a formula for creating a VM, specifying an image base and other parameters. */ @ServiceMethod(returns = ReturnType.SINGLE) - FormulaInner update(String resourceGroupName, String labName, String name, FormulaFragment formula); + void delete(String resourceGroupName, String labName, String name); + + /** + * List formulas in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); + + /** + * List formulas in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GalleryImagesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GalleryImagesClient.java index d8c390561846..373665189e26 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GalleryImagesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GalleryImagesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -17,7 +17,7 @@ public interface GalleryImagesClient { /** * List gallery images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -30,9 +30,9 @@ public interface GalleryImagesClient { /** * List gallery images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GlobalSchedulesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GlobalSchedulesClient.java index 6a369376037a..eca85d870799 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GlobalSchedulesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GlobalSchedulesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -20,95 +20,69 @@ */ public interface GlobalSchedulesClient { /** - * List schedules in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List schedules in a subscription. + * Get schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); - - /** - * List schedules in a resource group. - * - * @param resourceGroupName The name of the resource 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 the response of a list operation as paginated response with {@link PagedIterable}. + * @return schedule along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, String expand, + Context context); /** - * List schedules in a resource group. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, - Integer top, String orderby, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ScheduleInner getByResourceGroup(String resourceGroupName, String name); /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response}. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String name, String expand, + Response createOrUpdateWithResponse(String resourceGroupName, String name, ScheduleInner schedule, Context context); /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return a schedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner getByResourceGroup(String resourceGroupName, String name); + ScheduleInner createOrUpdate(String resourceGroupName, String name, ScheduleInner schedule); /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -117,14 +91,14 @@ Response getByResourceGroupWithResponse(String resourceGroupName, * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String name, ScheduleInner schedule, + Response updateWithResponse(String resourceGroupName, String name, ScheduleFragment schedule, Context context); /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -132,13 +106,13 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str * @return a schedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner createOrUpdate(String resourceGroupName, String name, ScheduleInner schedule); + ScheduleInner update(String resourceGroupName, String name, ScheduleFragment schedule); /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -151,8 +125,8 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -161,40 +135,66 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str void delete(String resourceGroupName, String name); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param schedule A schedule. + * @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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List schedules in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String name, ScheduleFragment schedule, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, + Integer top, String orderby, Context context); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param schedule A schedule. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List schedules in a subscription. + * + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner update(String resourceGroupName, String name, ScheduleFragment schedule); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -206,8 +206,8 @@ Response updateWithResponse(String resourceGroupName, String name /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -220,8 +220,8 @@ Response updateWithResponse(String resourceGroupName, String name /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -232,8 +232,8 @@ Response updateWithResponse(String resourceGroupName, String name /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param context The context to associate with this 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,8 +245,8 @@ Response updateWithResponse(String resourceGroupName, String name /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -260,8 +260,8 @@ SyncPoller, Void> beginRetarget(String resourceGroupName, Strin /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -276,8 +276,8 @@ SyncPoller, Void> beginRetarget(String resourceGroupName, Strin /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -289,8 +289,8 @@ SyncPoller, Void> beginRetarget(String resourceGroupName, Strin /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/LabsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/LabsClient.java index a1205d02342c..4f3428337bdc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/LabsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/LabsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -24,66 +24,10 @@ * An instance of this class provides access to all the operations defined in LabsClient. */ public interface LabsClient { - /** - * List labs in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List labs in a subscription. - * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); - - /** - * List labs in a resource group. - * - * @param resourceGroupName The name of the resource 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 the response of a list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List labs in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, Integer top, - String orderby, Context context); - /** * Get lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. * @param context The context to associate with this operation. @@ -99,7 +43,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName, Stri /** * Get lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -112,7 +56,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName, Stri /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -126,7 +70,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName, Stri /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. * @param context The context to associate with this operation. @@ -142,7 +86,7 @@ SyncPoller, LabInner> beginCreateOrUpdate(String resourceGr /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -156,7 +100,7 @@ SyncPoller, LabInner> beginCreateOrUpdate(String resourceGr /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. * @param context The context to associate with this operation. @@ -168,10 +112,39 @@ SyncPoller, LabInner> beginCreateOrUpdate(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) LabInner createOrUpdate(String resourceGroupName, String name, LabInner lab, Context context); + /** + * Allows modifying tags of labs. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the lab. + * @param lab A lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a lab along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String name, LabFragment lab, Context context); + + /** + * Allows modifying tags of labs. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the lab. + * @param lab A lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a lab. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabInner update(String resourceGroupName, String name, LabFragment lab); + /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -184,7 +157,7 @@ SyncPoller, LabInner> beginCreateOrUpdate(String resourceGr /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -198,7 +171,7 @@ SyncPoller, LabInner> beginCreateOrUpdate(String resourceGr /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -210,7 +183,7 @@ SyncPoller, LabInner> beginCreateOrUpdate(String resourceGr /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -221,38 +194,65 @@ SyncPoller, LabInner> beginCreateOrUpdate(String resourceGr void delete(String resourceGroupName, String name, Context context); /** - * Allows modifying tags of labs. All other properties will be ignored. + * List labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param lab A lab. + * @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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List labs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String name, LabFragment lab, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, Integer top, + String orderby, Context context); /** - * Allows modifying tags of labs. All other properties will be ignored. + * List labs in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param lab A lab. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List labs in a subscription. + * + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabInner update(String resourceGroupName, String name, LabFragment lab); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -265,7 +265,7 @@ SyncPoller, LabInner> beginCreateOrUpdate(String resourceGr /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -279,7 +279,7 @@ SyncPoller, LabInner> beginCreateOrUpdate(String resourceGr /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -291,7 +291,7 @@ SyncPoller, LabInner> beginCreateOrUpdate(String resourceGr /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -304,7 +304,7 @@ SyncPoller, LabInner> beginCreateOrUpdate(String resourceGr /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -319,7 +319,7 @@ SyncPoller, Void> beginCreateEnvironment(String resourceGroupNa /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a virtual machine. * @param context The context to associate with this operation. @@ -335,7 +335,7 @@ SyncPoller, Void> beginCreateEnvironment(String resourceGroupNa /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -349,7 +349,7 @@ void createEnvironment(String resourceGroupName, String name, /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a virtual machine. * @param context The context to associate with this operation. @@ -364,7 +364,7 @@ void createEnvironment(String resourceGroupName, String name, /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -379,7 +379,7 @@ SyncPoller, Void> beginExportResourceUsage(String resourceGroup /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. * @param context The context to associate with this operation. @@ -395,7 +395,7 @@ SyncPoller, Void> beginExportResourceUsage(String resourceGroup /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -409,7 +409,7 @@ void exportResourceUsage(String resourceGroupName, String name, /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. * @param context The context to associate with this operation. @@ -424,7 +424,7 @@ void exportResourceUsage(String resourceGroupName, String name, /** * Generate a URI for uploading custom disk images to a Lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param generateUploadUriParameter Properties for generating an upload URI. * @param context The context to associate with this operation. @@ -440,7 +440,7 @@ Response generateUploadUriWithResponse(String re /** * Generate a URI for uploading custom disk images to a Lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param generateUploadUriParameter Properties for generating an upload URI. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -455,7 +455,7 @@ GenerateUploadUriResponseInner generateUploadUri(String resourceGroupName, Strin /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. @@ -471,7 +471,7 @@ SyncPoller, Void> beginImportVirtualMachine(String resourceGrou /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. @@ -488,7 +488,7 @@ SyncPoller, Void> beginImportVirtualMachine(String resourceGrou /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. @@ -503,7 +503,7 @@ void importVirtualMachine(String resourceGroupName, String name, /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. @@ -519,7 +519,7 @@ void importVirtualMachine(String resourceGroupName, String name, /** * List disk images available for custom image creation. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -532,7 +532,7 @@ void importVirtualMachine(String resourceGroupName, String name, /** * List disk images available for custom image creation. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/NotificationChannelsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/NotificationChannelsClient.java index eed8dcb5fef9..2b6880f880da 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/NotificationChannelsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/NotificationChannelsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -18,72 +18,73 @@ */ public interface NotificationChannelsClient { /** - * List notification channels in a given lab. + * Get notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. + * @param name The name of the notification channel. + * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return notification channel along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String labName, String name, + String expand, Context context); /** - * List notification channels in a given lab. + * Get notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param name The name of the notification channel. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return notification channel. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + NotificationChannelInner get(String resourceGroupName, String labName, String name); /** - * Get notification channel. + * Create or replace an existing notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. + * @param notificationChannel A notification. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return notification channel along with {@link Response}. + * @return a notification along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String labName, String name, - String expand, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + NotificationChannelInner notificationChannel, Context context); /** - * Get notification channel. + * Create or replace an existing notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. + * @param notificationChannel A notification. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return notification channel. + * @return a notification. */ @ServiceMethod(returns = ReturnType.SINGLE) - NotificationChannelInner get(String resourceGroupName, String labName, String name); + NotificationChannelInner createOrUpdate(String resourceGroupName, String labName, String name, + NotificationChannelInner notificationChannel); /** - * Create or replace an existing notification channel. + * Allows modifying tags of notification channels. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notificationChannel A notification. @@ -94,13 +95,13 @@ Response getWithResponse(String resourceGroupName, Str * @return a notification along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, - NotificationChannelInner notificationChannel, Context context); + Response updateWithResponse(String resourceGroupName, String labName, String name, + NotificationChannelFragment notificationChannel, Context context); /** - * Create or replace an existing notification channel. + * Allows modifying tags of notification channels. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notificationChannel A notification. @@ -110,13 +111,13 @@ Response createOrUpdateWithResponse(String resourceGro * @return a notification. */ @ServiceMethod(returns = ReturnType.SINGLE) - NotificationChannelInner createOrUpdate(String resourceGroupName, String labName, String name, - NotificationChannelInner notificationChannel); + NotificationChannelInner update(String resourceGroupName, String labName, String name, + NotificationChannelFragment notificationChannel); /** * Delete notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param context The context to associate with this operation. @@ -131,7 +132,7 @@ NotificationChannelInner createOrUpdate(String resourceGroupName, String labName /** * Delete notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -142,42 +143,41 @@ NotificationChannelInner createOrUpdate(String resourceGroupName, String labName void delete(String resourceGroupName, String labName, String name); /** - * Allows modifying tags of notification channels. All other properties will be ignored. + * List notification channels in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the notification channel. - * @param notificationChannel A notification. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String name, - NotificationChannelFragment notificationChannel, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); /** - * Allows modifying tags of notification channels. All other properties will be ignored. + * List notification channels in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the notification channel. - * @param notificationChannel A notification. + * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - NotificationChannelInner update(String resourceGroupName, String labName, String name, - NotificationChannelFragment notificationChannel); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context); /** * Send notification to provided channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notifyParameters Properties for generating a Notification. @@ -194,7 +194,7 @@ Response notifyWithResponse(String resourceGroupName, String labName, Stri /** * Send notification to provided channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notifyParameters Properties for generating a Notification. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/OperationsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/OperationsClient.java index 92268101153e..458493437a3d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/OperationsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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.devtestlabs.fluent; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PoliciesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PoliciesClient.java index af10d2eee624..727208bfe664 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PoliciesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PoliciesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -16,47 +16,13 @@ * An instance of this class provides access to all the operations defined in PoliciesClient. */ public interface PoliciesClient { - /** - * List policies in a given policy set. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String policySetName); - - /** - * List policies in a given policy set. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String policySetName, String expand, - String filter, Integer top, String orderby, Context context); - /** * Get policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -71,10 +37,10 @@ Response getWithResponse(String resourceGroupName, String labName, /** * Get policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -86,10 +52,10 @@ Response getWithResponse(String resourceGroupName, String labName, /** * Create or replace an existing policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @param policy A Policy. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -104,10 +70,10 @@ Response createOrUpdateWithResponse(String resourceGroupName, Strin /** * Create or replace an existing policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @param policy A Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -118,13 +84,48 @@ Response createOrUpdateWithResponse(String resourceGroupName, Strin PolicyInner createOrUpdate(String resourceGroupName, String labName, String policySetName, String name, PolicyInner policy); + /** + * Allows modifying tags of policies. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. + * @param policy A Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String labName, String policySetName, + String name, PolicyFragment policy, Context context); + + /** + * Allows modifying tags of policies. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. + * @param policy A Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyInner update(String resourceGroupName, String labName, String policySetName, String name, + PolicyFragment policy); + /** * Delete policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -138,10 +139,10 @@ Response deleteWithResponse(String resourceGroupName, String labName, Stri /** * Delete policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -150,37 +151,36 @@ Response deleteWithResponse(String resourceGroupName, String labName, Stri void delete(String resourceGroupName, String labName, String policySetName, String name); /** - * Allows modifying tags of policies. All other properties will be ignored. + * List policies in a given policy set. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. - * @param policy A Policy. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Policy along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String policySetName, - String name, PolicyFragment policy, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String policySetName); /** - * Allows modifying tags of policies. All other properties will be ignored. + * List policies in a given policy set. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. - * @param policy A Policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Policy. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyInner update(String resourceGroupName, String labName, String policySetName, String name, - PolicyFragment policy); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String policySetName, String expand, + String filter, Integer top, String orderby, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PolicySetsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PolicySetsClient.java index 6df89994cf8c..52422f3856c4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PolicySetsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PolicySetsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -18,9 +18,9 @@ public interface PolicySetsClient { /** * Evaluates lab policy. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the policy set. + * @param name The name of the PolicySet. * @param evaluatePoliciesRequest Request body for evaluating a policy set. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -35,9 +35,9 @@ Response evaluatePoliciesWithResponse(String reso /** * Evaluates lab policy. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the policy set. + * @param name The name of the PolicySet. * @param evaluatePoliciesRequest Request body for evaluating a policy set. * @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/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ProviderOperationsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ProviderOperationsClient.java index f0621015ac28..1ba3d5c50130 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ProviderOperationsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ProviderOperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -8,31 +8,33 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.devtestlabs.fluent.models.OperationMetadataInner; +import com.azure.resourcemanager.devtestlabs.fluent.models.OperationInner; /** * An instance of this class provides access to all the operations defined in ProviderOperationsClient. */ public interface ProviderOperationsClient { /** - * Result of the request to list REST API operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** - * Result of the request to list REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SchedulesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SchedulesClient.java index bd9a561e8bdd..c3913b7fd810 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SchedulesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SchedulesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -19,74 +19,74 @@ */ public interface SchedulesClient { /** - * List schedules in a given lab. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String labName, String name, String expand, + Context context); /** - * List schedules in a given lab. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ScheduleInner get(String resourceGroupName, String labName, String name); /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. + * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response}. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String labName, String name, String expand, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + ScheduleInner schedule, Context context); /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return a schedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner get(String resourceGroupName, String labName, String name); + ScheduleInner createOrUpdate(String resourceGroupName, String labName, String name, ScheduleInner schedule); /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -95,15 +95,15 @@ Response getWithResponse(String resourceGroupName, String labName * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, - ScheduleInner schedule, Context context); + Response updateWithResponse(String resourceGroupName, String labName, String name, + ScheduleFragment schedule, Context context); /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -111,14 +111,14 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str * @return a schedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner createOrUpdate(String resourceGroupName, String labName, String name, ScheduleInner schedule); + ScheduleInner update(String resourceGroupName, String labName, String name, ScheduleFragment schedule); /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -131,9 +131,9 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -142,43 +142,43 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str void delete(String resourceGroupName, String labName, String name); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given lab. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String name, - ScheduleFragment schedule, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given lab. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner update(String resourceGroupName, String labName, String name, ScheduleFragment schedule); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context); /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -190,9 +190,9 @@ Response updateWithResponse(String resourceGroupName, String labN /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -206,9 +206,9 @@ SyncPoller, Void> beginExecute(String resourceGroupName, String /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -219,9 +219,9 @@ SyncPoller, Void> beginExecute(String resourceGroupName, String /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -233,9 +233,9 @@ SyncPoller, Void> beginExecute(String resourceGroupName, String /** * Lists all applicable schedules. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -247,9 +247,9 @@ SyncPoller, Void> beginExecute(String resourceGroupName, String /** * Lists all applicable schedules. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param context The context to associate with this 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/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SecretsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SecretsClient.java index 600357e7719e..e0f74a910121 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SecretsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SecretsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -18,46 +18,12 @@ * An instance of this class provides access to all the operations defined in SecretsClient. */ public interface SecretsClient { - /** - * List secrets in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String username); - - /** - * List secrets in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context); - /** * Get secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param expand Specify the $expand query. Example: 'properties($select=value)'. * @param context The context to associate with this operation. @@ -67,15 +33,15 @@ PagedIterable list(String resourceGroupName, String labName, String * @return secret along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String labName, String username, String name, + Response getWithResponse(String resourceGroupName, String labName, String userName, String name, String expand, Context context); /** * Get secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -83,14 +49,14 @@ Response getWithResponse(String resourceGroupName, String labName, * @return secret. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecretInner get(String resourceGroupName, String labName, String username, String name); + SecretInner get(String resourceGroupName, String labName, String userName, String name); /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -100,14 +66,14 @@ Response getWithResponse(String resourceGroupName, String labName, */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SecretInner> beginCreateOrUpdate(String resourceGroupName, String labName, - String username, String name, SecretInner secret); + String userName, String name, SecretInner secret); /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. * @param context The context to associate with this operation. @@ -118,14 +84,14 @@ SyncPoller, SecretInner> beginCreateOrUpdate(String reso */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SecretInner> beginCreateOrUpdate(String resourceGroupName, String labName, - String username, String name, SecretInner secret, Context context); + String userName, String name, SecretInner secret, Context context); /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -134,15 +100,15 @@ SyncPoller, SecretInner> beginCreateOrUpdate(String reso * @return a secret. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecretInner createOrUpdate(String resourceGroupName, String labName, String username, String name, + SecretInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, SecretInner secret); /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. * @param context The context to associate with this operation. @@ -152,71 +118,105 @@ SecretInner createOrUpdate(String resourceGroupName, String labName, String user * @return a secret. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecretInner createOrUpdate(String resourceGroupName, String labName, String username, String name, + SecretInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, SecretInner secret, Context context); /** - * Delete secret. + * Allows modifying tags of secrets. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. + * @param secret A secret. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return a secret along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String labName, String username, String name, - Context context); + Response updateWithResponse(String resourceGroupName, String labName, String userName, String name, + SecretFragment secret, Context context); /** - * Delete secret. + * Allows modifying tags of secrets. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. + * @param secret A secret. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a secret. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labName, String username, String name); + SecretInner update(String resourceGroupName, String labName, String userName, String name, SecretFragment secret); /** - * Allows modifying tags of secrets. All other properties will be ignored. + * Delete secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. - * @param secret A secret. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String username, String name, - SecretFragment secret, Context context); + Response deleteWithResponse(String resourceGroupName, String labName, String userName, String name, + Context context); /** - * Allows modifying tags of secrets. All other properties will be ignored. + * Delete secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. - * @param secret A secret. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecretInner update(String resourceGroupName, String labName, String username, String name, SecretFragment secret); + void delete(String resourceGroupName, String labName, String userName, String name); + + /** + * List secrets in a given user profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String userName); + + /** + * List secrets in a given user profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=value)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricSchedulesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricSchedulesClient.java index b5bffc2a39b1..142ef4802c60 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricSchedulesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricSchedulesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -19,85 +19,85 @@ */ public interface ServiceFabricSchedulesClient { /** - * List schedules in a given service fabric. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String username, - String serviceFabricName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, String expand, Context context); /** - * List schedules in a given service fabric. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String username, - String serviceFabricName, String expand, String filter, Integer top, String orderby, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ScheduleInner get(String resourceGroupName, String labName, String userName, String serviceFabricName, String name); /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. + * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response}. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, String expand, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, ScheduleInner schedule, Context context); /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return a schedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner get(String resourceGroupName, String labName, String username, String serviceFabricName, String name); + ScheduleInner createOrUpdate(String resourceGroupName, String labName, String userName, String serviceFabricName, + String name, ScheduleInner schedule); /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -106,17 +106,17 @@ Response getWithResponse(String resourceGroupName, String labName * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, ScheduleInner schedule, Context context); + Response updateWithResponse(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, ScheduleFragment schedule, Context context); /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -124,17 +124,17 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str * @return a schedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner createOrUpdate(String resourceGroupName, String labName, String username, String serviceFabricName, - String name, ScheduleInner schedule); + ScheduleInner update(String resourceGroupName, String labName, String userName, String serviceFabricName, + String name, ScheduleFragment schedule); /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -142,86 +142,86 @@ ScheduleInner createOrUpdate(String resourceGroupName, String labName, String us * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String labName, String username, + Response deleteWithResponse(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, Context context); /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 labName, String username, String serviceFabricName, String name); + void delete(String resourceGroupName, String labName, String userName, String serviceFabricName, String name); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given service fabric. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, ScheduleFragment schedule, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String userName, + String serviceFabricName); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given service fabric. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner update(String resourceGroupName, String labName, String username, String serviceFabricName, - String name, ScheduleFragment schedule); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String userName, + String serviceFabricName, String expand, String filter, Integer top, String orderby, Context context); /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked 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> beginExecute(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String userName, String serviceFabricName, String name); /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -229,38 +229,38 @@ SyncPoller, Void> beginExecute(String resourceGroupName, String * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, Context context); /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 execute(String resourceGroupName, String labName, String username, String serviceFabricName, String name); + void execute(String resourceGroupName, String labName, String userName, String serviceFabricName, String name); /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 execute(String resourceGroupName, String labName, String username, String serviceFabricName, String name, + void execute(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricsClient.java index 5c083c6c395c..c89857bde8f3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -19,46 +19,12 @@ * An instance of this class provides access to all the operations defined in ServiceFabricsClient. */ public interface ServiceFabricsClient { - /** - * List service fabrics in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String username); - - /** - * List service fabrics in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context); - /** * Get service fabric. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. * @param context The context to associate with this operation. @@ -68,15 +34,15 @@ PagedIterable list(String resourceGroupName, String labName, * @return service fabric along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String labName, String username, String name, + Response getWithResponse(String resourceGroupName, String labName, String userName, String name, String expand, Context context); /** * Get service fabric. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -84,14 +50,14 @@ Response getWithResponse(String resourceGroupName, String la * @return service fabric. */ @ServiceMethod(returns = ReturnType.SINGLE) - ServiceFabricInner get(String resourceGroupName, String labName, String username, String name); + ServiceFabricInner get(String resourceGroupName, String labName, String userName, String name); /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -101,14 +67,14 @@ Response getWithResponse(String resourceGroupName, String la */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServiceFabricInner> beginCreateOrUpdate(String resourceGroupName, - String labName, String username, String name, ServiceFabricInner serviceFabric); + String labName, String userName, String name, ServiceFabricInner serviceFabric); /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. * @param context The context to associate with this operation. @@ -119,14 +85,14 @@ SyncPoller, ServiceFabricInner> beginCreateOrUpda */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServiceFabricInner> beginCreateOrUpdate(String resourceGroupName, - String labName, String username, String name, ServiceFabricInner serviceFabric, Context context); + String labName, String userName, String name, ServiceFabricInner serviceFabric, Context context); /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -135,15 +101,15 @@ SyncPoller, ServiceFabricInner> beginCreateOrUpda * @return a Service Fabric. */ @ServiceMethod(returns = ReturnType.SINGLE) - ServiceFabricInner createOrUpdate(String resourceGroupName, String labName, String username, String name, + ServiceFabricInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, ServiceFabricInner serviceFabric); /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. * @param context The context to associate with this operation. @@ -153,15 +119,50 @@ ServiceFabricInner createOrUpdate(String resourceGroupName, String labName, Stri * @return a Service Fabric. */ @ServiceMethod(returns = ReturnType.SINGLE) - ServiceFabricInner createOrUpdate(String resourceGroupName, String labName, String username, String name, + ServiceFabricInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, ServiceFabricInner serviceFabric, Context context); + /** + * Allows modifying tags of service fabrics. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the service fabric. + * @param serviceFabric A Service Fabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String labName, String userName, + String name, ServiceFabricFragment serviceFabric, Context context); + + /** + * Allows modifying tags of service fabrics. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the service fabric. + * @param serviceFabric A Service Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceFabricInner update(String resourceGroupName, String labName, String userName, String name, + ServiceFabricFragment serviceFabric); + /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -169,15 +170,15 @@ ServiceFabricInner createOrUpdate(String resourceGroupName, String labName, Stri * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String userName, String name); /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -186,29 +187,29 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String userName, String name, Context context); /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labName, String username, String name); + void delete(String resourceGroupName, String labName, String userName, String name); /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -216,49 +217,48 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labName, String username, String name, Context context); + void delete(String resourceGroupName, String labName, String userName, String name, Context context); /** - * Allows modifying tags of service fabrics. All other properties will be ignored. + * List service fabrics in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String username, - String name, ServiceFabricFragment serviceFabric, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String userName); /** - * Allows modifying tags of service fabrics. All other properties will be ignored. + * List service fabrics in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceFabricInner update(String resourceGroupName, String labName, String username, String name, - ServiceFabricFragment serviceFabric); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby, Context context); /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -268,14 +268,14 @@ ServiceFabricInner update(String resourceGroupName, String labName, String usern */ @ServiceMethod(returns = ReturnType.SINGLE) Response listApplicableSchedulesWithResponse(String resourceGroupName, String labName, - String username, String name, Context context); + String userName, String name, Context context); /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -283,15 +283,15 @@ Response listApplicableSchedulesWithResponse(String res * @return schedules applicable to a virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - ApplicableScheduleInner listApplicableSchedules(String resourceGroupName, String labName, String username, + ApplicableScheduleInner listApplicableSchedules(String resourceGroupName, String labName, String userName, String name); /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -299,15 +299,15 @@ ApplicableScheduleInner listApplicableSchedules(String resourceGroupName, String * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginStart(String resourceGroupName, String labName, String userName, String name); /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -316,29 +316,29 @@ SyncPoller, Void> beginStart(String resourceGroupName, String l * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginStart(String resourceGroupName, String labName, String userName, String name, Context context); /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String labName, String username, String name); + void start(String resourceGroupName, String labName, String userName, String name); /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -346,14 +346,14 @@ SyncPoller, Void> beginStart(String resourceGroupName, String l * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String labName, String username, String name, Context context); + void start(String resourceGroupName, String labName, String userName, String name, Context context); /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -361,15 +361,15 @@ SyncPoller, Void> beginStart(String resourceGroupName, String l * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStop(String resourceGroupName, String labName, String username, + SyncPoller, Void> beginStop(String resourceGroupName, String labName, String userName, String name); /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -378,29 +378,29 @@ SyncPoller, Void> beginStop(String resourceGroupName, String la * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStop(String resourceGroupName, String labName, String username, String name, + SyncPoller, Void> beginStop(String resourceGroupName, String labName, String userName, String name, Context context); /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String labName, String username, String name); + void stop(String resourceGroupName, String labName, String userName, String name); /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -408,5 +408,5 @@ SyncPoller, Void> beginStop(String resourceGroupName, String la * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String labName, String username, String name, Context context); + void stop(String resourceGroupName, String labName, String userName, String name, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceRunnersClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceRunnersClient.java index 3af00fce9070..0d199855fe0a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceRunnersClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceRunnersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -17,7 +17,7 @@ public interface ServiceRunnersClient { /** * Get service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @param context The context to associate with this operation. @@ -33,7 +33,7 @@ Response getWithResponse(String resourceGroupName, String la /** * Get service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -47,7 +47,7 @@ Response getWithResponse(String resourceGroupName, String la /** * Create or replace an existing service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @param serviceRunner A container for a managed identity to execute DevTest lab services. @@ -64,7 +64,7 @@ Response createOrUpdateWithResponse(String resourceGroupName /** * Create or replace an existing service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @param serviceRunner A container for a managed identity to execute DevTest lab services. @@ -80,7 +80,7 @@ ServiceRunnerInner createOrUpdate(String resourceGroupName, String labName, Stri /** * Delete service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @param context The context to associate with this operation. @@ -95,7 +95,7 @@ ServiceRunnerInner createOrUpdate(String resourceGroupName, String labName, Stri /** * Delete service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/UsersClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/UsersClient.java index efa0411b9283..5c879e2192cd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/UsersClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/UsersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -18,42 +18,10 @@ * An instance of this class provides access to all the operations defined in UsersClient. */ public interface UsersClient { - /** - * List user profiles in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName); - - /** - * List user profiles in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, - String orderby, Context context); - /** * Get user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param expand Specify the $expand query. Example: 'properties($select=identity)'. @@ -70,7 +38,7 @@ Response getWithResponse(String resourceGroupName, String labName, St /** * Get user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -84,14 +52,14 @@ Response getWithResponse(String resourceGroupName, String labName, St /** * Create or replace an existing user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of profile of a lab user. + * @return the {@link SyncPoller} for polling of a user profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, UserInner> beginCreateOrUpdate(String resourceGroupName, String labName, @@ -100,7 +68,7 @@ SyncPoller, UserInner> beginCreateOrUpdate(String resource /** * Create or replace an existing user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. @@ -108,7 +76,7 @@ SyncPoller, UserInner> beginCreateOrUpdate(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 profile of a lab user. + * @return the {@link SyncPoller} for polling of a user profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, UserInner> beginCreateOrUpdate(String resourceGroupName, String labName, @@ -117,14 +85,14 @@ SyncPoller, UserInner> beginCreateOrUpdate(String resource /** * Create or replace an existing user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return a user profile. */ @ServiceMethod(returns = ReturnType.SINGLE) UserInner createOrUpdate(String resourceGroupName, String labName, String name, UserInner user); @@ -132,7 +100,7 @@ SyncPoller, UserInner> beginCreateOrUpdate(String resource /** * Create or replace an existing user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. @@ -140,15 +108,47 @@ SyncPoller, UserInner> beginCreateOrUpdate(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 profile of a lab user. + * @return a user profile. */ @ServiceMethod(returns = ReturnType.SINGLE) UserInner createOrUpdate(String resourceGroupName, String labName, String name, UserInner user, Context context); + /** + * Allows modifying tags of user profiles. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the user profile. + * @param user Profile of a lab user. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a user profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String labName, String name, UserFragment user, + Context context); + + /** + * Allows modifying tags of user profiles. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the user profile. + * @param user Profile of a lab user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a user profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UserInner update(String resourceGroupName, String labName, String name, UserFragment user); + /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -162,7 +162,7 @@ SyncPoller, UserInner> beginCreateOrUpdate(String resource /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param context The context to associate with this operation. @@ -178,7 +178,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -191,7 +191,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param context The context to associate with this operation. @@ -203,34 +203,34 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String void delete(String resourceGroupName, String labName, String name, Context context); /** - * Allows modifying tags of user profiles. All other properties will be ignored. + * List user profiles in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the user profile. - * @param user Profile of a lab user. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String name, UserFragment user, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); /** - * Allows modifying tags of user profiles. All other properties will be ignored. + * List user profiles in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the user profile. - * @param user Profile of a lab user. + * @param expand Specify the $expand query. Example: 'properties($select=identity)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner update(String resourceGroupName, String labName, String name, UserFragment user); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, + String orderby, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachineSchedulesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachineSchedulesClient.java index 9ca1a1cdc0d4..518b880e4594 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachineSchedulesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachineSchedulesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -18,47 +18,13 @@ * An instance of this class provides access to all the operations defined in VirtualMachineSchedulesClient. */ public interface VirtualMachineSchedulesClient { - /** - * List schedules in a given virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String virtualMachineName); - - /** - * List schedules in a given virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby, Context context); - /** * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -73,10 +39,10 @@ Response getWithResponse(String resourceGroupName, String labName /** * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -88,10 +54,10 @@ Response getWithResponse(String resourceGroupName, String labName /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -106,10 +72,10 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -120,13 +86,48 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str ScheduleInner createOrUpdate(String resourceGroupName, String labName, String virtualMachineName, String name, ScheduleInner schedule); + /** + * Allows modifying tags of schedules. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. + * @param schedule A schedule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a schedule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String labName, String virtualMachineName, + String name, ScheduleFragment schedule, Context context); + + /** + * Allows modifying tags of schedules. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. + * @param schedule A schedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a schedule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScheduleInner update(String resourceGroupName, String labName, String virtualMachineName, String name, + ScheduleFragment schedule); + /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -140,10 +141,10 @@ Response deleteWithResponse(String resourceGroupName, String labName, Stri /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -152,47 +153,46 @@ Response deleteWithResponse(String resourceGroupName, String labName, Stri void delete(String resourceGroupName, String labName, String virtualMachineName, String name); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given virtual machine. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String virtualMachineName, - String name, ScheduleFragment schedule, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String virtualMachineName); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given virtual machine. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner update(String resourceGroupName, String labName, String virtualMachineName, String name, - ScheduleFragment schedule); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String virtualMachineName, + String expand, String filter, Integer top, String orderby, Context context); /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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,10 +205,10 @@ SyncPoller, Void> beginExecute(String resourceGroupName, String /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -222,10 +222,10 @@ SyncPoller, Void> beginExecute(String resourceGroupName, String /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -236,10 +236,10 @@ SyncPoller, Void> beginExecute(String resourceGroupName, String /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param context The context to associate with this 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/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachinesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachinesClient.java index 2c125f80cb54..a8e8057e8010 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachinesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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.devtestlabs.fluent; @@ -24,43 +24,10 @@ * An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ public interface VirtualMachinesClient { - /** - * List virtual machines in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName); - - /** - * List virtual machines in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: - * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context); - /** * Get virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param expand Specify the $expand query. Example: @@ -78,7 +45,7 @@ Response getWithResponse(String resourceGroupName, Strin /** * Get virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -92,7 +59,7 @@ Response getWithResponse(String resourceGroupName, Strin /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A virtual machine. @@ -108,7 +75,7 @@ SyncPoller, LabVirtualMachineInner> beginCrea /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A virtual machine. @@ -125,7 +92,7 @@ SyncPoller, LabVirtualMachineInner> beginCrea /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A virtual machine. @@ -141,7 +108,7 @@ LabVirtualMachineInner createOrUpdate(String resourceGroupName, String labName, /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A virtual machine. @@ -155,10 +122,43 @@ LabVirtualMachineInner createOrUpdate(String resourceGroupName, String labName, LabVirtualMachineInner createOrUpdate(String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine, Context context); + /** + * Allows modifying tags of virtual machines. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the virtual machine. + * @param labVirtualMachine A virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String labName, String name, + LabVirtualMachineFragment labVirtualMachine, Context context); + + /** + * Allows modifying tags of virtual machines. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the virtual machine. + * @param labVirtualMachine A 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabVirtualMachineInner update(String resourceGroupName, String labName, String name, + LabVirtualMachineFragment labVirtualMachine); + /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -172,7 +172,7 @@ LabVirtualMachineInner createOrUpdate(String resourceGroupName, String labName, /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -188,7 +188,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -201,7 +201,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -213,42 +213,42 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String void delete(String resourceGroupName, String labName, String name, Context context); /** - * Allows modifying tags of virtual machines. All other properties will be ignored. + * List virtual machines in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String name, - LabVirtualMachineFragment labVirtualMachine, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); /** - * Allows modifying tags of virtual machines. All other properties will be ignored. + * List virtual machines in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. + * @param expand Specify the $expand query. Example: + * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabVirtualMachineInner update(String resourceGroupName, String labName, String name, - LabVirtualMachineFragment labVirtualMachine); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context); /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a virtual machine. @@ -264,7 +264,7 @@ SyncPoller, Void> beginAddDataDisk(String resourceGroupName, St /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a virtual machine. @@ -281,7 +281,7 @@ SyncPoller, Void> beginAddDataDisk(String resourceGroupName, St /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a virtual machine. @@ -295,7 +295,7 @@ SyncPoller, Void> beginAddDataDisk(String resourceGroupName, St /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a virtual machine. @@ -311,7 +311,7 @@ void addDataDisk(String resourceGroupName, String labName, String name, DataDisk /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a virtual machine. @@ -327,7 +327,7 @@ SyncPoller, Void> beginApplyArtifacts(String resourceGroupName, /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a virtual machine. @@ -344,7 +344,7 @@ SyncPoller, Void> beginApplyArtifacts(String resourceGroupName, /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a virtual machine. @@ -359,7 +359,7 @@ void applyArtifacts(String resourceGroupName, String labName, String name, /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a virtual machine. @@ -375,7 +375,7 @@ void applyArtifacts(String resourceGroupName, String labName, String name, /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -389,7 +389,7 @@ void applyArtifacts(String resourceGroupName, String labName, String name, /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -405,7 +405,7 @@ SyncPoller, Void> beginClaim(String resourceGroupName, String l /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -418,7 +418,7 @@ SyncPoller, Void> beginClaim(String resourceGroupName, String l /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -432,7 +432,7 @@ SyncPoller, Void> beginClaim(String resourceGroupName, String l /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a virtual machine. @@ -448,7 +448,7 @@ SyncPoller, Void> beginDetachDataDisk(String resourceGroupName, /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a virtual machine. @@ -465,7 +465,7 @@ SyncPoller, Void> beginDetachDataDisk(String resourceGroupName, /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a virtual machine. @@ -480,7 +480,7 @@ void detachDataDisk(String resourceGroupName, String labName, String name, /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a virtual machine. @@ -496,7 +496,7 @@ void detachDataDisk(String resourceGroupName, String labName, String name, /** * Gets a string that represents the contents of the RDP file for the virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -513,7 +513,7 @@ Response getRdpFileContentsWithResponse(String resourceGroup /** * Gets a string that represents the contents of the RDP file for the virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -527,7 +527,7 @@ Response getRdpFileContentsWithResponse(String resourceGroup /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -543,7 +543,7 @@ Response listApplicableSchedulesWithResponse(String res /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -557,7 +557,7 @@ Response listApplicableSchedulesWithResponse(String res /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -571,7 +571,7 @@ Response listApplicableSchedulesWithResponse(String res /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -587,7 +587,7 @@ SyncPoller, Void> beginRedeploy(String resourceGroupName, Strin /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -600,7 +600,7 @@ SyncPoller, Void> beginRedeploy(String resourceGroupName, Strin /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -614,7 +614,7 @@ SyncPoller, Void> beginRedeploy(String resourceGroupName, Strin /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a virtual machine. @@ -630,7 +630,7 @@ SyncPoller, Void> beginResize(String resourceGroupName, String /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a virtual machine. @@ -647,7 +647,7 @@ SyncPoller, Void> beginResize(String resourceGroupName, String /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a virtual machine. @@ -662,7 +662,7 @@ void resize(String resourceGroupName, String labName, String name, /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a virtual machine. @@ -678,7 +678,7 @@ void resize(String resourceGroupName, String labName, String name, /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -692,7 +692,7 @@ void resize(String resourceGroupName, String labName, String name, /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -708,7 +708,7 @@ SyncPoller, Void> beginRestart(String resourceGroupName, String /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -721,7 +721,7 @@ SyncPoller, Void> beginRestart(String resourceGroupName, String /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -735,7 +735,7 @@ SyncPoller, Void> beginRestart(String resourceGroupName, String /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -749,7 +749,7 @@ SyncPoller, Void> beginRestart(String resourceGroupName, String /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -765,7 +765,7 @@ SyncPoller, Void> beginStart(String resourceGroupName, String l /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -778,7 +778,7 @@ SyncPoller, Void> beginStart(String resourceGroupName, String l /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -792,7 +792,7 @@ SyncPoller, Void> beginStart(String resourceGroupName, String l /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -806,7 +806,7 @@ SyncPoller, Void> beginStart(String resourceGroupName, String l /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -822,7 +822,7 @@ SyncPoller, Void> beginStop(String resourceGroupName, String la /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -835,7 +835,7 @@ SyncPoller, Void> beginStop(String resourceGroupName, String la /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -850,7 +850,7 @@ SyncPoller, Void> beginStop(String resourceGroupName, String la * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -865,7 +865,7 @@ SyncPoller, Void> beginStop(String resourceGroupName, String la * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -882,7 +882,7 @@ SyncPoller, Void> beginTransferDisks(String resourceGroupName, * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -896,7 +896,7 @@ SyncPoller, Void> beginTransferDisks(String resourceGroupName, * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -910,7 +910,7 @@ SyncPoller, Void> beginTransferDisks(String resourceGroupName, /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -924,7 +924,7 @@ SyncPoller, Void> beginTransferDisks(String resourceGroupName, /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -940,7 +940,7 @@ SyncPoller, Void> beginUnClaim(String resourceGroupName, String /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -953,7 +953,7 @@ SyncPoller, Void> beginUnClaim(String resourceGroupName, String /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualNetworksClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualNetworksClient.java index 59432329c07f..eba5fbac604a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualNetworksClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualNetworksClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent; @@ -18,42 +18,10 @@ * An instance of this class provides access to all the operations defined in VirtualNetworksClient. */ public interface VirtualNetworksClient { - /** - * List virtual networks in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName); - - /** - * List virtual networks in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context); - /** * Get virtual network. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. @@ -70,7 +38,7 @@ Response getWithResponse(String resourceGroupName, String l /** * Get virtual network. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -84,7 +52,7 @@ Response getWithResponse(String resourceGroupName, String l /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. @@ -100,7 +68,7 @@ SyncPoller, VirtualNetworkInner> beginCreateOrUp /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. @@ -117,7 +85,7 @@ SyncPoller, VirtualNetworkInner> beginCreateOrUp /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. @@ -133,7 +101,7 @@ VirtualNetworkInner createOrUpdate(String resourceGroupName, String labName, Str /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. @@ -147,10 +115,43 @@ VirtualNetworkInner createOrUpdate(String resourceGroupName, String labName, Str VirtualNetworkInner createOrUpdate(String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork, Context context); + /** + * Allows modifying tags of virtual networks. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the virtual network. + * @param virtualNetwork A virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String labName, String name, + VirtualNetworkFragment virtualNetwork, Context context); + + /** + * Allows modifying tags of virtual networks. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the virtual network. + * @param virtualNetwork A virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkInner update(String resourceGroupName, String labName, String name, + VirtualNetworkFragment virtualNetwork); + /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -164,7 +165,7 @@ VirtualNetworkInner createOrUpdate(String resourceGroupName, String labName, Str /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param context The context to associate with this operation. @@ -180,7 +181,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -193,7 +194,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param context The context to associate with this operation. @@ -205,35 +206,34 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String void delete(String resourceGroupName, String labName, String name, Context context); /** - * Allows modifying tags of virtual networks. All other properties will be ignored. + * List virtual networks in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String labName, String name, - VirtualNetworkFragment virtualNetwork, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); /** - * Allows modifying tags of virtual networks. All other properties will be ignored. + * List virtual networks in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. + * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner update(String resourceGroupName, String labName, String name, - VirtualNetworkFragment virtualNetwork); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableScheduleInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableScheduleInner.java index fa1a5838f5f9..722a16a0650d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableScheduleInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableScheduleInner.java @@ -1,12 +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.devtestlabs.fluent.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -16,12 +16,27 @@ /** * Schedules applicable to a virtual machine. The schedules may have been defined on a VM or on lab level. */ -@Fluent -public final class ApplicableScheduleInner extends Resource { +@Immutable +public final class ApplicableScheduleInner extends ProxyResource { + /* + * The location of the resource. + */ + private String location; + + /* + * The tags of the resource. + */ + private Map tags; + /* * The properties of the resource. */ - private ApplicableSchedulePropertiesInner innerProperties = new ApplicableSchedulePropertiesInner(); + private ApplicableSchedulePropertiesInner innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -41,7 +56,25 @@ public final class ApplicableScheduleInner extends Resource { /** * Creates an instance of ApplicableScheduleInner class. */ - public ApplicableScheduleInner() { + private ApplicableScheduleInner() { + } + + /** + * Get the location property: The location of the resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the tags property: The tags of the resource. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; } /** @@ -53,6 +86,15 @@ private ApplicableSchedulePropertiesInner innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -83,24 +125,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ApplicableScheduleInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApplicableScheduleInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the labVmsShutdown property: The auto-shutdown schedule, if one has been set at the lab or lab resource * level. @@ -111,21 +135,6 @@ public ScheduleInner labVmsShutdown() { return this.innerProperties() == null ? null : this.innerProperties().labVmsShutdown(); } - /** - * Set the labVmsShutdown property: The auto-shutdown schedule, if one has been set at the lab or lab resource - * level. - * - * @param labVmsShutdown the labVmsShutdown value to set. - * @return the ApplicableScheduleInner object itself. - */ - public ApplicableScheduleInner withLabVmsShutdown(ScheduleInner labVmsShutdown) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicableSchedulePropertiesInner(); - } - this.innerProperties().withLabVmsShutdown(labVmsShutdown); - return this; - } - /** * Get the labVmsStartup property: The auto-startup schedule, if one has been set at the lab or lab resource level. * @@ -135,46 +144,15 @@ public ScheduleInner labVmsStartup() { return this.innerProperties() == null ? null : this.innerProperties().labVmsStartup(); } - /** - * Set the labVmsStartup property: The auto-startup schedule, if one has been set at the lab or lab resource level. - * - * @param labVmsStartup the labVmsStartup value to set. - * @return the ApplicableScheduleInner object itself. - */ - public ApplicableScheduleInner withLabVmsStartup(ScheduleInner labVmsStartup) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicableSchedulePropertiesInner(); - } - this.innerProperties().withLabVmsStartup(labVmsStartup); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model ApplicableScheduleInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ApplicableScheduleInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -200,14 +178,16 @@ public static ApplicableScheduleInner fromJson(JsonReader jsonReader) throws IOE deserializedApplicableScheduleInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedApplicableScheduleInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedApplicableScheduleInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedApplicableScheduleInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedApplicableScheduleInner.innerProperties = ApplicableSchedulePropertiesInner.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedApplicableScheduleInner.location = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedApplicableScheduleInner.tags = tags; + } else if ("systemData".equals(fieldName)) { + deserializedApplicableScheduleInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableSchedulePropertiesInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableSchedulePropertiesInner.java index 80829433f287..340d668b8087 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableSchedulePropertiesInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableSchedulePropertiesInner.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.devtestlabs.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; @@ -14,7 +14,7 @@ /** * Properties of a schedules applicable to a virtual machine. */ -@Fluent +@Immutable public final class ApplicableSchedulePropertiesInner implements JsonSerializable { /* * The auto-shutdown schedule, if one has been set at the lab or lab resource level. @@ -29,7 +29,7 @@ public final class ApplicableSchedulePropertiesInner implements JsonSerializable /** * Creates an instance of ApplicableSchedulePropertiesInner class. */ - public ApplicableSchedulePropertiesInner() { + private ApplicableSchedulePropertiesInner() { } /** @@ -42,18 +42,6 @@ public ScheduleInner labVmsShutdown() { return this.labVmsShutdown; } - /** - * Set the labVmsShutdown property: The auto-shutdown schedule, if one has been set at the lab or lab resource - * level. - * - * @param labVmsShutdown the labVmsShutdown value to set. - * @return the ApplicableSchedulePropertiesInner object itself. - */ - public ApplicableSchedulePropertiesInner withLabVmsShutdown(ScheduleInner labVmsShutdown) { - this.labVmsShutdown = labVmsShutdown; - return this; - } - /** * Get the labVmsStartup property: The auto-startup schedule, if one has been set at the lab or lab resource level. * @@ -63,31 +51,6 @@ public ScheduleInner labVmsStartup() { return this.labVmsStartup; } - /** - * Set the labVmsStartup property: The auto-startup schedule, if one has been set at the lab or lab resource level. - * - * @param labVmsStartup the labVmsStartup value to set. - * @return the ApplicableSchedulePropertiesInner object itself. - */ - public ApplicableSchedulePropertiesInner withLabVmsStartup(ScheduleInner labVmsStartup) { - this.labVmsStartup = labVmsStartup; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (labVmsShutdown() != null) { - labVmsShutdown().validate(); - } - if (labVmsStartup() != null) { - labVmsStartup().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInfoInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInfoInner.java index 0c4e4f57ba02..c60aadefc046 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInfoInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInfoInner.java @@ -1,35 +1,36 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.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; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * Information about a generated ARM template. */ -@Fluent +@Immutable public final class ArmTemplateInfoInner implements JsonSerializable { /* * The template's contents. */ - private Object template; + private Map template; /* * The parameters of the ARM template. */ - private Object parameters; + private Map parameters; /** * Creates an instance of ArmTemplateInfoInner class. */ - public ArmTemplateInfoInner() { + private ArmTemplateInfoInner() { } /** @@ -37,57 +38,27 @@ public ArmTemplateInfoInner() { * * @return the template value. */ - public Object template() { + public Map template() { return this.template; } - /** - * Set the template property: The template's contents. - * - * @param template the template value to set. - * @return the ArmTemplateInfoInner object itself. - */ - public ArmTemplateInfoInner withTemplate(Object template) { - this.template = template; - return this; - } - /** * Get the parameters property: The parameters of the ARM template. * * @return the parameters value. */ - public Object parameters() { + public Map parameters() { return this.parameters; } - /** - * Set the parameters property: The parameters of the ARM template. - * - * @param parameters the parameters value to set. - * @return the ArmTemplateInfoInner object itself. - */ - public ArmTemplateInfoInner withParameters(Object parameters) { - this.parameters = parameters; - 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.writeUntypedField("template", this.template); - jsonWriter.writeUntypedField("parameters", this.parameters); + jsonWriter.writeMapField("template", this.template, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("parameters", this.parameters, (writer, element) -> writer.writeUntyped(element)); return jsonWriter.writeEndObject(); } @@ -107,9 +78,11 @@ public static ArmTemplateInfoInner fromJson(JsonReader jsonReader) throws IOExce reader.nextToken(); if ("template".equals(fieldName)) { - deserializedArmTemplateInfoInner.template = reader.readUntyped(); + Map template = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedArmTemplateInfoInner.template = template; } else if ("parameters".equals(fieldName)) { - deserializedArmTemplateInfoInner.parameters = reader.readUntyped(); + Map parameters = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedArmTemplateInfoInner.parameters = parameters; } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInner.java index e42e33c8544b..8711f2f21667 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInner.java @@ -1,12 +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.devtestlabs.fluent.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -19,12 +19,27 @@ /** * An Azure Resource Manager template. */ -@Fluent -public final class ArmTemplateInner extends Resource { +@Immutable +public final class ArmTemplateInner extends ProxyResource { /* * The properties of the resource. */ - private ArmTemplateProperties innerProperties = new ArmTemplateProperties(); + private ArmTemplateProperties innerProperties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -44,7 +59,7 @@ public final class ArmTemplateInner extends Resource { /** * Creates an instance of ArmTemplateInner class. */ - public ArmTemplateInner() { + private ArmTemplateInner() { } /** @@ -56,6 +71,33 @@ private ArmTemplateProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * 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. * @@ -86,24 +128,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ArmTemplateInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ArmTemplateInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the displayName property: The display name of the ARM template. * @@ -145,7 +169,7 @@ public String icon() { * * @return the contents value. */ - public Object contents() { + public Map contents() { return this.innerProperties() == null ? null : this.innerProperties().contents(); } @@ -177,32 +201,15 @@ public Boolean enabled() { return this.innerProperties() == null ? null : this.innerProperties().enabled(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model ArmTemplateInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ArmTemplateInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -228,13 +235,15 @@ public static ArmTemplateInner fromJson(JsonReader jsonReader) throws IOExceptio deserializedArmTemplateInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedArmTemplateInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedArmTemplateInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedArmTemplateInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedArmTemplateInner.innerProperties = ArmTemplateProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedArmTemplateInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedArmTemplateInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedArmTemplateInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateProperties.java index fa7fedba26af..be2710918ac5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -14,6 +14,7 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; +import java.util.Map; /** * Properties of an Azure Resource Manager template. @@ -43,7 +44,7 @@ public final class ArmTemplateProperties implements JsonSerializable contents; /* * The creation date of the armTemplate. @@ -63,7 +64,7 @@ public final class ArmTemplateProperties implements JsonSerializable contents() { return this.contents; } @@ -139,17 +140,6 @@ public Boolean enabled() { return this.enabled; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (parametersValueFilesInfo() != null) { - parametersValueFilesInfo().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -183,7 +173,8 @@ public static ArmTemplateProperties fromJson(JsonReader jsonReader) throws IOExc } else if ("icon".equals(fieldName)) { deserializedArmTemplateProperties.icon = reader.getString(); } else if ("contents".equals(fieldName)) { - deserializedArmTemplateProperties.contents = reader.readUntyped(); + Map contents = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedArmTemplateProperties.contents = contents; } else if ("createdDate".equals(fieldName)) { deserializedArmTemplateProperties.createdDate = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactInner.java index 6aef434a7fb8..860fa12dea4e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactInner.java @@ -1,12 +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.devtestlabs.fluent.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -17,12 +17,27 @@ /** * An artifact. */ -@Fluent -public final class ArtifactInner extends Resource { +@Immutable +public final class ArtifactInner extends ProxyResource { /* * The properties of the resource. */ - private ArtifactProperties innerProperties = new ArtifactProperties(); + private ArtifactProperties innerProperties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -42,7 +57,7 @@ public final class ArtifactInner extends Resource { /** * Creates an instance of ArtifactInner class. */ - public ArtifactInner() { + private ArtifactInner() { } /** @@ -54,6 +69,33 @@ private ArtifactProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * 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. * @@ -84,24 +126,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ArtifactInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ArtifactInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the title property: The artifact's title. * @@ -161,7 +185,7 @@ public String targetOsType() { * * @return the parameters value. */ - public Object parameters() { + public Map parameters() { return this.innerProperties() == null ? null : this.innerProperties().parameters(); } @@ -174,31 +198,15 @@ public OffsetDateTime createdDate() { return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property innerProperties in model ArtifactInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ArtifactInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -224,13 +232,15 @@ public static ArtifactInner fromJson(JsonReader jsonReader) throws IOException { deserializedArtifactInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedArtifactInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedArtifactInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedArtifactInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedArtifactInner.innerProperties = ArtifactProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedArtifactInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedArtifactInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedArtifactInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactProperties.java index f6cdc3677b98..d6a1b6a0a367 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -12,6 +12,7 @@ import com.azure.json.JsonWriter; import java.io.IOException; import java.time.OffsetDateTime; +import java.util.Map; /** * Properties of an artifact. @@ -51,7 +52,7 @@ public final class ArtifactProperties implements JsonSerializable parameters; /* * The artifact's creation date. @@ -61,7 +62,7 @@ public final class ArtifactProperties implements JsonSerializable parameters() { return this.parameters; } @@ -136,14 +137,6 @@ public OffsetDateTime createdDate() { return this.createdDate; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -181,7 +174,8 @@ public static ArtifactProperties fromJson(JsonReader jsonReader) throws IOExcept } else if ("targetOsType".equals(fieldName)) { deserializedArtifactProperties.targetOsType = reader.getString(); } else if ("parameters".equals(fieldName)) { - deserializedArtifactProperties.parameters = reader.readUntyped(); + Map parameters = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedArtifactProperties.parameters = parameters; } else if ("createdDate".equals(fieldName)) { deserializedArtifactProperties.createdDate = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceInner.java index 9ca94af2dfd0..b528174bdb56 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceInner.java @@ -1,12 +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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -20,12 +20,27 @@ * Properties of an artifact source. */ @Fluent -public final class ArtifactSourceInner extends Resource { +public final class ArtifactSourceInner extends ProxyResource { /* * The properties of the resource. */ private ArtifactSourceProperties innerProperties = new ArtifactSourceProperties(); + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -56,6 +71,55 @@ private ArtifactSourceProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ArtifactSourceInner object itself. + */ + public ArtifactSourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the ArtifactSourceInner object itself. + */ + public ArtifactSourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -86,24 +150,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ArtifactSourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ArtifactSourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the displayName property: The artifact source's display name. * @@ -315,32 +361,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model ArtifactSourceInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ArtifactSourceInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -366,13 +395,15 @@ public static ArtifactSourceInner fromJson(JsonReader jsonReader) throws IOExcep deserializedArtifactSourceInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedArtifactSourceInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedArtifactSourceInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedArtifactSourceInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedArtifactSourceInner.innerProperties = ArtifactSourceProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedArtifactSourceInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedArtifactSourceInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedArtifactSourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceProperties.java index 02c751fe30bf..c7df0591c30d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -268,14 +268,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageInner.java index 825f5462a17b..b3e827bd473f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageInner.java @@ -1,12 +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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -23,12 +23,27 @@ * A custom image. */ @Fluent -public final class CustomImageInner extends Resource { +public final class CustomImageInner extends ProxyResource { /* * The properties of the resource. */ private CustomImageProperties innerProperties = new CustomImageProperties(); + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -59,6 +74,55 @@ private CustomImageProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the CustomImageInner object itself. + */ + public CustomImageInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the CustomImageInner object itself. + */ + public CustomImageInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -89,24 +153,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public CustomImageInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomImageInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the vm property: The virtual machine from which the image is to be created. * @@ -343,32 +389,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model CustomImageInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CustomImageInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -394,13 +423,15 @@ public static CustomImageInner fromJson(JsonReader jsonReader) throws IOExceptio deserializedCustomImageInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedCustomImageInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedCustomImageInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedCustomImageInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedCustomImageInner.innerProperties = CustomImageProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCustomImageInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedCustomImageInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedCustomImageInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageProperties.java index f687ff9dbe5f..f5597b3c7bcb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -298,26 +298,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vm() != null) { - vm().validate(); - } - if (vhd() != null) { - vhd().validate(); - } - if (dataDiskStorageInfo() != null) { - dataDiskStorageInfo().forEach(e -> e.validate()); - } - if (customImagePlan() != null) { - customImagePlan().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskInner.java index 749d9b1069fc..db0fd1eeb476 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskInner.java @@ -1,12 +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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -19,12 +19,27 @@ * A Disk. */ @Fluent -public final class DiskInner extends Resource { +public final class DiskInner extends ProxyResource { /* - * The properties of the resource. + * The properties of the disk. */ private DiskProperties innerProperties = new DiskProperties(); + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -47,7 +62,7 @@ public DiskInner() { } /** - * Get the innerProperties property: The properties of the resource. + * Get the innerProperties property: The properties of the disk. * * @return the innerProperties value. */ @@ -55,6 +70,55 @@ private DiskProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the DiskInner object itself. + */ + public DiskInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the DiskInner object itself. + */ + public DiskInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -85,24 +149,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public DiskInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DiskInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the diskType property: The storage type for the disk (i.e. Standard, Premium). * @@ -314,31 +360,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property innerProperties in model DiskInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiskInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -364,13 +394,15 @@ public static DiskInner fromJson(JsonReader jsonReader) throws IOException { deserializedDiskInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedDiskInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedDiskInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDiskInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedDiskInner.innerProperties = DiskProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDiskInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedDiskInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedDiskInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskProperties.java index 9d28c95d1e95..c04adccdaa77 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -267,14 +267,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DtlEnvironmentInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DtlEnvironmentInner.java index 8f261b94b1ac..20d94bb6d030 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DtlEnvironmentInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DtlEnvironmentInner.java @@ -1,12 +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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -18,12 +18,27 @@ * An environment, which is essentially an ARM template deployment. */ @Fluent -public final class DtlEnvironmentInner extends Resource { +public final class DtlEnvironmentInner extends ProxyResource { /* - * The properties of the resource. + * The properties of the environment. */ private EnvironmentProperties innerProperties = new EnvironmentProperties(); + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -46,7 +61,7 @@ public DtlEnvironmentInner() { } /** - * Get the innerProperties property: The properties of the resource. + * Get the innerProperties property: The properties of the environment. * * @return the innerProperties value. */ @@ -54,6 +69,55 @@ private EnvironmentProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the DtlEnvironmentInner object itself. + */ + public DtlEnvironmentInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the DtlEnvironmentInner object itself. + */ + public DtlEnvironmentInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -84,24 +148,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public DtlEnvironmentInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DtlEnvironmentInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the deploymentProperties property: The deployment properties of the environment. * @@ -186,32 +232,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model DtlEnvironmentInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DtlEnvironmentInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -237,13 +266,15 @@ public static DtlEnvironmentInner fromJson(JsonReader jsonReader) throws IOExcep deserializedDtlEnvironmentInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedDtlEnvironmentInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedDtlEnvironmentInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDtlEnvironmentInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedDtlEnvironmentInner.innerProperties = EnvironmentProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDtlEnvironmentInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedDtlEnvironmentInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedDtlEnvironmentInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentProperties.java index 76669d2f7353..5c997a14ddad 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -131,17 +131,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (deploymentProperties() != null) { - deploymentProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EvaluatePoliciesResponseInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EvaluatePoliciesResponseInner.java index a0a95e9a27f0..39c5c5156517 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EvaluatePoliciesResponseInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EvaluatePoliciesResponseInner.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.devtestlabs.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 @@ /** * Response body for evaluating a policy set. */ -@Fluent +@Immutable public final class EvaluatePoliciesResponseInner implements JsonSerializable { /* * Results of evaluating a policy set. @@ -26,7 +26,7 @@ public final class EvaluatePoliciesResponseInner implements JsonSerializable results() { return this.results; } - /** - * Set the results property: Results of evaluating a policy set. - * - * @param results the results value to set. - * @return the EvaluatePoliciesResponseInner object itself. - */ - public EvaluatePoliciesResponseInner withResults(List results) { - this.results = results; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (results() != null) { - results().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaInner.java index 2922ad94e95e..a370a26b807f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaInner.java @@ -1,12 +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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -20,12 +20,27 @@ * A formula for creating a VM, specifying an image base and other parameters. */ @Fluent -public final class FormulaInner extends Resource { +public final class FormulaInner extends ProxyResource { /* - * The properties of the resource. + * The properties of the formula. */ private FormulaProperties innerProperties = new FormulaProperties(); + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -48,7 +63,7 @@ public FormulaInner() { } /** - * Get the innerProperties property: The properties of the resource. + * Get the innerProperties property: The properties of the formula. * * @return the innerProperties value. */ @@ -56,6 +71,55 @@ private FormulaProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -86,24 +150,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public FormulaInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public FormulaInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the description property: The description of the formula. * @@ -232,31 +278,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property innerProperties in model FormulaInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(FormulaInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -282,13 +312,15 @@ public static FormulaInner fromJson(JsonReader jsonReader) throws IOException { deserializedFormulaInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedFormulaInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedFormulaInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedFormulaInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedFormulaInner.innerProperties = FormulaProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFormulaInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedFormulaInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedFormulaInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaProperties.java index 798d3fc7ae2b..5a2676609062 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -182,20 +182,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (formulaContent() != null) { - formulaContent().validate(); - } - if (vm() != null) { - vm().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageInner.java index 1c1e17a61f4e..1f240306543c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageInner.java @@ -1,12 +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.devtestlabs.fluent.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -18,12 +18,27 @@ /** * A gallery image. */ -@Fluent -public final class GalleryImageInner extends Resource { +@Immutable +public final class GalleryImageInner extends ProxyResource { /* - * The properties of the resource. + * The properties of the gallery image. */ - private GalleryImageProperties innerProperties = new GalleryImageProperties(); + private GalleryImageProperties innerProperties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -43,11 +58,11 @@ public final class GalleryImageInner extends Resource { /** * Creates an instance of GalleryImageInner class. */ - public GalleryImageInner() { + private GalleryImageInner() { } /** - * Get the innerProperties property: The properties of the resource. + * Get the innerProperties property: The properties of the gallery image. * * @return the innerProperties value. */ @@ -55,6 +70,33 @@ private GalleryImageProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * 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. * @@ -85,24 +127,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public GalleryImageInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GalleryImageInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the author property: The author of the gallery image. * @@ -112,20 +136,6 @@ public String author() { return this.innerProperties() == null ? null : this.innerProperties().author(); } - /** - * Set the author property: The author of the gallery image. - * - * @param author the author value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withAuthor(String author) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withAuthor(author); - return this; - } - /** * Get the createdDate property: The creation date of the gallery image. * @@ -144,20 +154,6 @@ public String description() { return this.innerProperties() == null ? null : this.innerProperties().description(); } - /** - * Set the description property: The description of the gallery image. - * - * @param description the description value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - /** * Get the imageReference property: The image reference of the gallery image. * @@ -167,20 +163,6 @@ public GalleryImageReference imageReference() { return this.innerProperties() == null ? null : this.innerProperties().imageReference(); } - /** - * Set the imageReference property: The image reference of the gallery image. - * - * @param imageReference the imageReference value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withImageReference(GalleryImageReference imageReference) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withImageReference(imageReference); - return this; - } - /** * Get the icon property: The icon of the gallery image. * @@ -190,20 +172,6 @@ public String icon() { return this.innerProperties() == null ? null : this.innerProperties().icon(); } - /** - * Set the icon property: The icon of the gallery image. - * - * @param icon the icon value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withIcon(String icon) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withIcon(icon); - return this; - } - /** * Get the enabled property: Indicates whether this gallery image is enabled. * @@ -213,20 +181,6 @@ public Boolean enabled() { return this.innerProperties() == null ? null : this.innerProperties().enabled(); } - /** - * Set the enabled property: Indicates whether this gallery image is enabled. - * - * @param enabled the enabled value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withEnabled(Boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - /** * Get the planId property: The third party plan that applies to this image. * @@ -236,20 +190,6 @@ public String planId() { return this.innerProperties() == null ? null : this.innerProperties().planId(); } - /** - * Set the planId property: The third party plan that applies to this image. - * - * @param planId the planId value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withPlanId(String planId) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withPlanId(planId); - return this; - } - /** * Get the isPlanAuthorized property: Indicates if the plan has been authorized for programmatic deployment. * @@ -259,46 +199,15 @@ public Boolean isPlanAuthorized() { return this.innerProperties() == null ? null : this.innerProperties().isPlanAuthorized(); } - /** - * Set the isPlanAuthorized property: Indicates if the plan has been authorized for programmatic deployment. - * - * @param isPlanAuthorized the isPlanAuthorized value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withIsPlanAuthorized(Boolean isPlanAuthorized) { - if (this.innerProperties() == null) { - this.innerProperties = new GalleryImageProperties(); - } - this.innerProperties().withIsPlanAuthorized(isPlanAuthorized); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model GalleryImageInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GalleryImageInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -324,13 +233,15 @@ public static GalleryImageInner fromJson(JsonReader jsonReader) throws IOExcepti deserializedGalleryImageInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedGalleryImageInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedGalleryImageInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedGalleryImageInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedGalleryImageInner.innerProperties = GalleryImageProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGalleryImageInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedGalleryImageInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedGalleryImageInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageProperties.java index 7916c89a32cf..e126007027ff 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageProperties.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.devtestlabs.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * Properties of a gallery image. */ -@Fluent +@Immutable public final class GalleryImageProperties implements JsonSerializable { /* * The author of the gallery image. @@ -62,7 +62,7 @@ public final class GalleryImageProperties implements JsonSerializable { /* * The upload URI for the VHD. @@ -24,7 +24,7 @@ public final class GenerateUploadUriResponseInner implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -59,6 +74,55 @@ private LabCostProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LabCostInner object itself. + */ + public LabCostInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the LabCostInner object itself. + */ + public LabCostInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -89,24 +153,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public LabCostInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public LabCostInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the targetCost property: The target cost properties. * @@ -267,31 +313,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property innerProperties in model LabCostInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(LabCostInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -317,13 +347,15 @@ public static LabCostInner fromJson(JsonReader jsonReader) throws IOException { deserializedLabCostInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedLabCostInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedLabCostInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedLabCostInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedLabCostInner.innerProperties = LabCostProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLabCostInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedLabCostInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedLabCostInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostProperties.java index 1da20dcaeacf..ea2ed6b3614f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -225,26 +225,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetCost() != null) { - targetCost().validate(); - } - if (labCostSummary() != null) { - labCostSummary().validate(); - } - if (labCostDetails() != null) { - labCostDetails().forEach(e -> e.validate()); - } - if (resourceCosts() != null) { - resourceCosts().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabInner.java index 02060978f3c8..6987f5bd0d47 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabInner.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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; +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; @@ -23,11 +24,26 @@ * A lab. */ @Fluent -public final class LabInner extends Resource { +public final class LabInner extends ProxyResource { /* * The properties of the resource. */ - private LabProperties innerProperties; + private LabProperties innerProperties = new LabProperties(); + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -59,6 +75,55 @@ private LabProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LabInner object itself. + */ + public LabInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the LabInner object itself. + */ + public LabInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -89,24 +154,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public LabInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public LabInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the defaultStorageAccount property: The lab's default storage account. * @@ -413,26 +460,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -458,13 +494,15 @@ public static LabInner fromJson(JsonReader jsonReader) throws IOException { deserializedLabInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedLabInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedLabInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedLabInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedLabInner.innerProperties = LabProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLabInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedLabInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedLabInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabProperties.java index 84fdd67f922c..438a88987d04 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -418,20 +418,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (announcement() != null) { - announcement().validate(); - } - if (support() != null) { - support().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVhdInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVhdInner.java index 0fcda7406a0b..32bf1d6a894b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVhdInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVhdInner.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.devtestlabs.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; @@ -14,7 +14,7 @@ /** * Properties of a VHD in the lab. */ -@Fluent +@Immutable public final class LabVhdInner implements JsonSerializable { /* * The URI to the VHD. @@ -24,7 +24,7 @@ public final class LabVhdInner implements JsonSerializable { /** * Creates an instance of LabVhdInner class. */ - public LabVhdInner() { + private LabVhdInner() { } /** @@ -36,25 +36,6 @@ public String id() { return this.id; } - /** - * Set the id property: The URI to the VHD. - * - * @param id the id value to set. - * @return the LabVhdInner object itself. - */ - public LabVhdInner withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterProperties.java index ff0828383867..c4a4a4be2653 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -643,32 +643,6 @@ public List scheduleParameters() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (bulkCreationParameters() != null) { - bulkCreationParameters().validate(); - } - if (artifacts() != null) { - artifacts().forEach(e -> e.validate()); - } - if (galleryImageReference() != null) { - galleryImageReference().validate(); - } - if (networkInterface() != null) { - networkInterface().validate(); - } - if (dataDiskParameters() != null) { - dataDiskParameters().forEach(e -> e.validate()); - } - if (scheduleParameters() != null) { - scheduleParameters().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineInner.java index 859888effd29..0e54aae1030e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineInner.java @@ -1,12 +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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -27,12 +27,27 @@ * A virtual machine. */ @Fluent -public final class LabVirtualMachineInner extends Resource { +public final class LabVirtualMachineInner extends ProxyResource { /* * The properties of the resource. */ private LabVirtualMachinePropertiesInner innerProperties = new LabVirtualMachinePropertiesInner(); + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -63,6 +78,55 @@ private LabVirtualMachinePropertiesInner innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -93,24 +157,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public LabVirtualMachineInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public LabVirtualMachineInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the notes property: The notes of the virtual machine. * @@ -753,32 +799,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model LabVirtualMachineInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(LabVirtualMachineInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -804,14 +833,16 @@ public static LabVirtualMachineInner fromJson(JsonReader jsonReader) throws IOEx deserializedLabVirtualMachineInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedLabVirtualMachineInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedLabVirtualMachineInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedLabVirtualMachineInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedLabVirtualMachineInner.innerProperties = LabVirtualMachinePropertiesInner.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLabVirtualMachineInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedLabVirtualMachineInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedLabVirtualMachineInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachinePropertiesInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachinePropertiesInner.java index b67ab4a94fb5..11fb575c1290 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachinePropertiesInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachinePropertiesInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -782,38 +782,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (artifacts() != null) { - artifacts().forEach(e -> e.validate()); - } - if (artifactDeploymentStatus() != null) { - artifactDeploymentStatus().validate(); - } - if (galleryImageReference() != null) { - galleryImageReference().validate(); - } - if (computeVm() != null) { - computeVm().validate(); - } - if (networkInterface() != null) { - networkInterface().validate(); - } - if (applicableSchedule() != null) { - applicableSchedule().validate(); - } - if (dataDiskParameters() != null) { - dataDiskParameters().forEach(e -> e.validate()); - } - if (scheduleParameters() != null) { - scheduleParameters().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelInner.java index d28b596dc4cf..ed43862c3f53 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelInner.java @@ -1,12 +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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -20,12 +20,27 @@ * A notification. */ @Fluent -public final class NotificationChannelInner extends Resource { +public final class NotificationChannelInner extends ProxyResource { /* * The properties of the resource. */ private NotificationChannelProperties innerProperties = new NotificationChannelProperties(); + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -56,6 +71,55 @@ private NotificationChannelProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the NotificationChannelInner object itself. + */ + public NotificationChannelInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the NotificationChannelInner object itself. + */ + public NotificationChannelInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -86,24 +150,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public NotificationChannelInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public NotificationChannelInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the webhookUrl property: The webhook URL to send notifications to. * @@ -250,32 +296,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model NotificationChannelInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(NotificationChannelInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -301,14 +330,16 @@ public static NotificationChannelInner fromJson(JsonReader jsonReader) throws IO deserializedNotificationChannelInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedNotificationChannelInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedNotificationChannelInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedNotificationChannelInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedNotificationChannelInner.innerProperties = NotificationChannelProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNotificationChannelInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedNotificationChannelInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedNotificationChannelInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelProperties.java index b9620a123ca7..f1bb989f83fd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -197,17 +197,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (events() != null) { - events().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationInner.java new file mode 100644 index 000000000000..dbdba793712e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.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.devtestlabs.models.ActionType; +import com.azure.resourcemanager.devtestlabs.models.OperationDisplay; +import com.azure.resourcemanager.devtestlabs.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * 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; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * 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. + */ + private OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner 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 OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationMetadataInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationMetadataInner.java deleted file mode 100644 index 85e7694e78fd..000000000000 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationMetadataInner.java +++ /dev/null @@ -1,125 +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.devtestlabs.fluent.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.devtestlabs.models.OperationMetadataDisplay; -import java.io.IOException; - -/** - * The REST API operation supported by DevTestLab ResourceProvider. - */ -@Fluent -public final class OperationMetadataInner implements JsonSerializable { - /* - * Operation name: {provider}/{resource}/{operation} - */ - private String name; - - /* - * The object that describes the operations - */ - private OperationMetadataDisplay display; - - /** - * Creates an instance of OperationMetadataInner class. - */ - public OperationMetadataInner() { - } - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationMetadataInner object itself. - */ - public OperationMetadataInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: The object that describes the operations. - * - * @return the display value. - */ - public OperationMetadataDisplay display() { - return this.display; - } - - /** - * Set the display property: The object that describes the operations. - * - * @param display the display value to set. - * @return the OperationMetadataInner object itself. - */ - public OperationMetadataInner withDisplay(OperationMetadataDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeJsonField("display", this.display); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationMetadataInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationMetadataInner 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 OperationMetadataInner. - */ - public static OperationMetadataInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationMetadataInner deserializedOperationMetadataInner = new OperationMetadataInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedOperationMetadataInner.name = reader.getString(); - } else if ("display".equals(fieldName)) { - deserializedOperationMetadataInner.display = OperationMetadataDisplay.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationMetadataInner; - }); - } -} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationResultInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationResultInner.java index e9a332d341c5..e4b8e7a557dc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationResultInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationResultInner.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.devtestlabs.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 @@ /** * An Operation Result. */ -@Fluent +@Immutable public final class OperationResultInner implements JsonSerializable { /* * The operation status. @@ -36,7 +36,7 @@ public final class OperationResultInner implements JsonSerializable tags; + + /* + * The location of the resource. + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -57,6 +72,55 @@ private PolicyProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: The tags of the resource. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags of the resource. + * + * @param tags the tags value to set. + * @return the PolicyInner object itself. + */ + public PolicyInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The location of the resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the resource. + * + * @param location the location value to set. + * @return the PolicyInner object itself. + */ + public PolicyInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -87,24 +151,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public PolicyInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PolicyInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the description property: The description of the policy. * @@ -272,31 +318,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property innerProperties in model PolicyInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PolicyInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -322,13 +352,15 @@ public static PolicyInner fromJson(JsonReader jsonReader) throws IOException { deserializedPolicyInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedPolicyInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedPolicyInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedPolicyInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedPolicyInner.innerProperties = PolicyProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPolicyInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedPolicyInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedPolicyInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyProperties.java index 5fa80928fdc3..f9d7f6d3d43f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -222,14 +222,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/RdpConnectionInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/RdpConnectionInner.java index 3778892dc5b1..e873b2b8388f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/RdpConnectionInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/RdpConnectionInner.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.devtestlabs.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; @@ -14,7 +14,7 @@ /** * Represents a .rdp file. */ -@Fluent +@Immutable public final class RdpConnectionInner implements JsonSerializable { /* * The contents of the .rdp file @@ -24,7 +24,7 @@ public final class RdpConnectionInner implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -59,6 +74,55 @@ private ScheduleProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ScheduleInner object itself. + */ + public ScheduleInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the ScheduleInner object itself. + */ + public ScheduleInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -89,24 +153,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ScheduleInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ScheduleInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the status property: The status of the schedule (i.e. Enabled, Disabled). * @@ -330,31 +376,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property innerProperties in model ScheduleInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ScheduleInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -380,13 +410,15 @@ public static ScheduleInner fromJson(JsonReader jsonReader) throws IOException { deserializedScheduleInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedScheduleInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedScheduleInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedScheduleInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedScheduleInner.innerProperties = ScheduleProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedScheduleInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedScheduleInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedScheduleInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleProperties.java index 1b64beb2ebe1..a497b9f02a13 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -286,26 +286,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (weeklyRecurrence() != null) { - weeklyRecurrence().validate(); - } - if (dailyRecurrence() != null) { - dailyRecurrence().validate(); - } - if (hourlyRecurrence() != null) { - hourlyRecurrence().validate(); - } - if (notificationSettings() != null) { - notificationSettings().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretInner.java index 40ad01068501..e9a345761a95 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretInner.java @@ -1,12 +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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -17,12 +17,27 @@ * A secret. */ @Fluent -public final class SecretInner extends Resource { +public final class SecretInner extends ProxyResource { /* * The properties of the resource. */ private SecretProperties innerProperties = new SecretProperties(); + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -53,6 +68,55 @@ private SecretProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the SecretInner object itself. + */ + public SecretInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the SecretInner object itself. + */ + public SecretInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -83,24 +147,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public SecretInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecretInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the value property: The value of the secret for secret creation. * @@ -142,31 +188,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property innerProperties in model SecretInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecretInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -192,13 +222,15 @@ public static SecretInner fromJson(JsonReader jsonReader) throws IOException { deserializedSecretInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedSecretInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedSecretInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSecretInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedSecretInner.innerProperties = SecretProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSecretInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedSecretInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedSecretInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretProperties.java index b2542dbb77b7..9de5741e2651 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -75,14 +75,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricInner.java index 8c575610091f..aab5e715628c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricInner.java @@ -1,12 +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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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; @@ -17,12 +17,27 @@ * A Service Fabric. */ @Fluent -public final class ServiceFabricInner extends Resource { +public final class ServiceFabricInner extends ProxyResource { /* * The properties of the resource. */ private ServiceFabricPropertiesInner innerProperties = new ServiceFabricPropertiesInner(); + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -53,6 +68,55 @@ private ServiceFabricPropertiesInner innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ServiceFabricInner object itself. + */ + public ServiceFabricInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the ServiceFabricInner object itself. + */ + public ServiceFabricInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -83,24 +147,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ServiceFabricInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServiceFabricInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the externalServiceFabricId property: The backing service fabric resource's id. * @@ -176,32 +222,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model ServiceFabricInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ServiceFabricInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -227,13 +256,15 @@ public static ServiceFabricInner fromJson(JsonReader jsonReader) throws IOExcept deserializedServiceFabricInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedServiceFabricInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedServiceFabricInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedServiceFabricInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedServiceFabricInner.innerProperties = ServiceFabricPropertiesInner.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedServiceFabricInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedServiceFabricInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedServiceFabricInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricPropertiesInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricPropertiesInner.java index 930d5ced1156..5c4e559eb77f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricPropertiesInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricPropertiesInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -116,17 +116,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (applicableSchedule() != null) { - applicableSchedule().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceRunnerInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceRunnerInner.java index d5ba93956e32..67df4572e8e6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceRunnerInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceRunnerInner.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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; +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; @@ -17,12 +18,27 @@ * A container for a managed identity to execute DevTest lab services. */ @Fluent -public final class ServiceRunnerInner extends Resource { +public final class ServiceRunnerInner extends ProxyResource { + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + /* * The identity of the resource. */ private IdentityProperties identity; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -44,6 +60,46 @@ public final class ServiceRunnerInner extends Resource { public ServiceRunnerInner() { } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ServiceRunnerInner object itself. + */ + public ServiceRunnerInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the ServiceRunnerInner object itself. + */ + public ServiceRunnerInner withLocation(String location) { + this.location = location; + return this; + } + /** * Get the identity property: The identity of the resource. * @@ -64,6 +120,15 @@ public ServiceRunnerInner withIdentity(IdentityProperties identity) { return this; } + /** + * 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. * @@ -94,43 +159,14 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ServiceRunnerInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServiceRunnerInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -157,13 +193,15 @@ public static ServiceRunnerInner fromJson(JsonReader jsonReader) throws IOExcept deserializedServiceRunnerInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedServiceRunnerInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedServiceRunnerInner.withLocation(reader.getString()); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedServiceRunnerInner.withTags(tags); + deserializedServiceRunnerInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedServiceRunnerInner.location = reader.getString(); } else if ("identity".equals(fieldName)) { deserializedServiceRunnerInner.identity = IdentityProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedServiceRunnerInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserInner.java index 515721f4a48c..27bd1106d762 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserInner.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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; +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; @@ -16,14 +17,29 @@ import java.util.Map; /** - * Profile of a lab user. + * A user profile. */ @Fluent -public final class UserInner extends Resource { +public final class UserInner extends ProxyResource { /* * The properties of the resource. */ - private UserProperties innerProperties; + private UserProperties innerProperties = new UserProperties(); + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -55,6 +71,55 @@ private UserProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the UserInner object itself. + */ + public UserInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the UserInner object itself. + */ + public UserInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -85,24 +150,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public UserInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UserInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the identity property: The identity of the user. * @@ -176,26 +223,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -221,13 +257,15 @@ public static UserInner fromJson(JsonReader jsonReader) throws IOException { deserializedUserInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedUserInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedUserInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedUserInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedUserInner.innerProperties = UserProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedUserInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedUserInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedUserInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserProperties.java index 357b229f8ca7..a087092deaf1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -118,20 +118,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (secretStore() != null) { - secretStore().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkInner.java index 306bb14e3e6d..c92c1876427e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkInner.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.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; +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; @@ -21,11 +22,26 @@ * A virtual network. */ @Fluent -public final class VirtualNetworkInner extends Resource { +public final class VirtualNetworkInner extends ProxyResource { /* * The properties of the resource. */ - private VirtualNetworkProperties innerProperties; + private VirtualNetworkProperties innerProperties = new VirtualNetworkProperties(); + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -57,6 +73,55 @@ private VirtualNetworkProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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. * @@ -87,24 +152,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public VirtualNetworkInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public VirtualNetworkInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the allowedSubnets property: The allowed subnets of the virtual network. * @@ -233,26 +280,15 @@ public String uniqueIdentifier() { return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -278,13 +314,15 @@ public static VirtualNetworkInner fromJson(JsonReader jsonReader) throws IOExcep deserializedVirtualNetworkInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedVirtualNetworkInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedVirtualNetworkInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedVirtualNetworkInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedVirtualNetworkInner.innerProperties = VirtualNetworkProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualNetworkInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedVirtualNetworkInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedVirtualNetworkInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkProperties.java index e08dfff276e6..78565f1109dd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.fluent.models; @@ -184,23 +184,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (allowedSubnets() != null) { - allowedSubnets().forEach(e -> e.validate()); - } - if (externalSubnets() != null) { - externalSubnets().forEach(e -> e.validate()); - } - if (subnetOverrides() != null) { - subnetOverrides().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/package-info.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/package-info.java index a5f444526ebe..a6f7b6d083e7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/package-info.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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 DevTestLabsClient. + * Package containing the inner data models for DevTestLabs. * The DevTest Labs Client. */ package com.azure.resourcemanager.devtestlabs.fluent.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/package-info.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/package-info.java index 52bc4f67d2bd..f7950a1018a5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/package-info.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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 DevTestLabsClient. + * Package containing the service clients for DevTestLabs. * The DevTest Labs Client. */ package com.azure.resourcemanager.devtestlabs.fluent; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableScheduleImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableScheduleImpl.java index 5e17c0cc2e3c..233e22e7207e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableScheduleImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableScheduleImpl.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.devtestlabs.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner; import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; import com.azure.resourcemanager.devtestlabs.models.ApplicableSchedule; @@ -47,6 +48,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public Schedule labVmsShutdown() { ScheduleInner inner = this.innerModel().labVmsShutdown(); if (inner != null) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableSchedulePropertiesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableSchedulePropertiesImpl.java index 8f05a56ed863..538bbdb8131a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableSchedulePropertiesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableSchedulePropertiesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateImpl.java index 2a625181c1cd..ed9b3436aece 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateImpl.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.devtestlabs.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInner; import com.azure.resourcemanager.devtestlabs.models.ArmTemplate; import com.azure.resourcemanager.devtestlabs.models.ParametersValueFileInfo; @@ -35,10 +36,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -48,6 +45,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String displayName() { return this.innerModel().displayName(); } @@ -64,8 +69,13 @@ public String icon() { return this.innerModel().icon(); } - public Object contents() { - return this.innerModel().contents(); + public Map contents() { + Map inner = this.innerModel().contents(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } } public OffsetDateTime createdDate() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateInfoImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateInfoImpl.java index 16e07eeb2086..d71d204a6a49 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateInfoImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateInfoImpl.java @@ -1,11 +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.devtestlabs.implementation; import com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInfoInner; import com.azure.resourcemanager.devtestlabs.models.ArmTemplateInfo; +import java.util.Collections; +import java.util.Map; public final class ArmTemplateInfoImpl implements ArmTemplateInfo { private ArmTemplateInfoInner innerObject; @@ -18,12 +20,22 @@ public final class ArmTemplateInfoImpl implements ArmTemplateInfo { this.serviceManager = serviceManager; } - public Object template() { - return this.innerModel().template(); + public Map template() { + Map inner = this.innerModel().template(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } } - public Object parameters() { - return this.innerModel().parameters(); + public Map parameters() { + Map inner = this.innerModel().parameters(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } } public ArmTemplateInfoInner innerModel() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesClientImpl.java index 4ff489d86cc0..4e3f7dc3a776 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.devtestlabs.fluent.ArmTemplatesClient; import com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInner; -import com.azure.resourcemanager.devtestlabs.models.ArmTemplateList; +import com.azure.resourcemanager.devtestlabs.implementation.models.ArmTemplateList; import reactor.core.publisher.Mono; /** @@ -42,209 +42,206 @@ public final class ArmTemplatesClientImpl implements ArmTemplatesClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of ArmTemplatesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ArmTemplatesClientImpl(DevTestLabsClientImpl client) { + ArmTemplatesClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(ArmTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientArmTemplates to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientArmTemplates to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientArm") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientArmTemplates") public interface ArmTemplatesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/armtemplates/{name}") + @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("labName") String labName, + @PathParam("artifactSourceName") String artifactSourceName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/armtemplates/{name}") + @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("labName") String labName, + @PathParam("artifactSourceName") String artifactSourceName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/armtemplates") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("artifactSourceName") String artifactSourceName, @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/armtemplates/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/armtemplates") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("artifactSourceName") String artifactSourceName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("artifactSourceName") String artifactSourceName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @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); + @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 azure resource manager templates in a given artifact source. + * Get azure resource manager template. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. + * @param name The name of the azure resource manager template. * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return azure resource manager template along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String artifactSourceName, String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (artifactSourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter artifactSourceName is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String labName, + String artifactSourceName, String name, String expand) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, artifactSourceName, name, expand, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List azure resource manager templates in a given artifact source. + * Get azure resource manager template. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. + * @param name The name of the azure resource manager template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure resource manager template on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String labName, String artifactSourceName, + String name) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get azure resource manager template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param artifactSourceName The name of the artifact source. + * @param name The name of the azure resource manager template. * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return azure resource manager template along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String artifactSourceName, String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (artifactSourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter artifactSourceName is required and cannot be null.")); - } + public Response getWithResponse(String resourceGroupName, String labName, + String artifactSourceName, String name, String expand, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - artifactSourceName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, artifactSourceName, name, expand, accept, context); } /** - * List azure resource manager templates in a given artifact source. + * Get azure resource manager template. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param name The name of the azure resource manager template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. + * @return azure resource manager template. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmTemplateInner get(String resourceGroupName, String labName, String artifactSourceName, String name) { + final String expand = null; + return getWithResponse(resourceGroupName, labName, artifactSourceName, name, expand, Context.NONE).getValue(); } /** * List azure resource manager templates in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. + * @return the response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String artifactSourceName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String artifactSourceName, String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, artifactSourceName, expand, filter, top, + orderby, 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 azure resource manager templates in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -252,202 +249,150 @@ private PagedFlux listAsync(String resourceGroupName, String l */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, - top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + String expand, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * List azure resource manager templates in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName) { + private PagedFlux listAsync(String resourceGroupName, String labName, String artifactSourceName) { final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>( - listAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby)); + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * List azure resource manager templates in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context)); - } - - /** - * Get azure resource manager template. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param artifactSourceName The name of the artifact source. - * @param name The name of the azure resource manager template. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String artifactSourceName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (artifactSourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter artifactSourceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String labName, + String artifactSourceName, String expand, String filter, Integer top, String orderby) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, artifactSourceName, name, expand, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get azure resource manager template. + * List azure resource manager templates in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the azure resource manager template. * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String artifactSourceName, String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (artifactSourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter artifactSourceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String labName, + String artifactSourceName, String expand, String filter, Integer top, String orderby, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - artifactSourceName, name, expand, this.client.getApiVersion(), accept, context); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get azure resource manager template. + * List azure resource manager templates in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the azure resource manager template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String artifactSourceName, - String name) { + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName) { final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); } /** - * Get azure resource manager template. + * List azure resource manager templates in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the azure resource manager template. * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String labName, - String artifactSourceName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, expand, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, + String expand, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Get azure resource manager template. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param artifactSourceName The name of the artifact source. - * @param name The name of the azure resource manager template. + * @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 azure resource manager template. + * @return the response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArmTemplateInner get(String resourceGroupName, String labName, String artifactSourceName, String name) { - final String expand = null; - return getWithResponse(resourceGroupName, labName, artifactSourceName, name, expand, Context.NONE).getValue(); + private Mono> listNextSinglePageAsync(String nextLink) { + 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())); } /** @@ -457,23 +402,14 @@ public ArmTemplateInner get(String resourceGroupName, String labName, String art * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink) { 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())); + 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); } /** @@ -484,22 +420,13 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesImpl.java index 5ba17132be64..135c70550ba2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -27,29 +27,12 @@ public ArmTemplatesImpl(ArmTemplatesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, artifactSourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ArmTemplateImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ArmTemplateImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String labName, String artifactSourceName, String name, String expand, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, labName, artifactSourceName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ArmTemplateImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ArmTemplateImpl(inner.getValue(), this.manager())); } public ArmTemplate get(String resourceGroupName, String labName, String artifactSourceName, String name) { @@ -61,6 +44,19 @@ public ArmTemplate get(String resourceGroupName, String labName, String artifact } } + public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, artifactSourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ArmTemplateImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, + String expand, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ArmTemplateImpl(inner1, this.manager())); + } + private ArmTemplatesClient serviceClient() { return this.innerClient; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactImpl.java index 83d9a4843e9c..e47f6c53e244 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactImpl.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.devtestlabs.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactInner; import com.azure.resourcemanager.devtestlabs.models.Artifact; import java.time.OffsetDateTime; @@ -32,10 +33,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -45,6 +42,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String title() { return this.innerModel().title(); } @@ -69,8 +74,13 @@ public String targetOsType() { return this.innerModel().targetOsType(); } - public Object parameters() { - return this.innerModel().parameters(); + public Map parameters() { + Map inner = this.innerModel().parameters(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } } public OffsetDateTime createdDate() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourceImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourceImpl.java index 5fd142793d53..30da1bec06b3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourceImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourceImpl.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.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactSourceInner; import com.azure.resourcemanager.devtestlabs.models.ArtifactSource; @@ -32,10 +33,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -45,6 +42,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String displayName() { return this.innerModel().displayName(); } @@ -254,6 +259,6 @@ public ArtifactSourceImpl withStatus(EnableStatus status) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesClientImpl.java index 63344881d111..15d983d1a00f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -31,8 +31,8 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.devtestlabs.fluent.ArtifactSourcesClient; import com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactSourceInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.ArtifactSourceList; import com.azure.resourcemanager.devtestlabs.models.ArtifactSourceFragment; -import com.azure.resourcemanager.devtestlabs.models.ArtifactSourceList; import reactor.core.publisher.Mono; /** @@ -47,280 +47,143 @@ public final class ArtifactSourcesClientImpl implements ArtifactSourcesClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of ArtifactSourcesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ArtifactSourcesClientImpl(DevTestLabsClientImpl client) { + ArtifactSourcesClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(ArtifactSourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientArtifactSources to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientArtifactSources to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientArt") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientArtifactSources") public interface ArtifactSourcesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ArtifactSourceInner artifactSource, @HeaderParam("Accept") String accept, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ArtifactSourceInner artifactSource, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}") - @ExpectedResponses({ 200, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ArtifactSourceInner artifactSource, + Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ArtifactSourceFragment artifactSource, @HeaderParam("Accept") String accept, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ArtifactSourceFragment artifactSource, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List artifact sources in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ArtifactSourceFragment artifactSource, + Context context); - /** - * List artifact sources in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, expand, - filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}") + @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("labName") String labName, + @PathParam("name") String name, Context context); - /** - * List artifact sources in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, Context context); - /** - * List artifact sources in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List artifact sources in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List artifact sources in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); - } + @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); - /** - * List artifact sources in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, 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); } /** * Get artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. @@ -332,75 +195,17 @@ public PagedIterable list(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get artifact source. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact source along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get artifact source. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -418,7 +223,7 @@ private Mono getAsync(String resourceGroupName, String labN /** * Get artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. @@ -431,13 +236,15 @@ private Mono getAsync(String resourceGroupName, String labN @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, name, expand, accept, context); } /** * Get artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -454,7 +261,7 @@ public ArtifactSourceInner get(String resourceGroupName, String labName, String /** * Create or replace an existing artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @param artifactSource Properties of an artifact source. @@ -466,85 +273,19 @@ public ArtifactSourceInner get(String resourceGroupName, String labName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, String name, ArtifactSourceInner artifactSource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (artifactSource == null) { - return Mono.error(new IllegalArgumentException("Parameter artifactSource is required and cannot be null.")); - } else { - artifactSource.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), artifactSource, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, artifactSource, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing artifact source. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String labName, String name, ArtifactSourceInner artifactSource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (artifactSource == null) { - return Mono.error(new IllegalArgumentException("Parameter artifactSource is required and cannot be null.")); - } else { - artifactSource.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), artifactSource, accept, context); - } - - /** - * Create or replace an existing artifact source. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @param artifactSource Properties of an artifact source. @@ -563,7 +304,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, /** * Create or replace an existing artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @param artifactSource Properties of an artifact source. @@ -576,13 +317,17 @@ private Mono createOrUpdateAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, ArtifactSourceInner artifactSource, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, name, artifactSource, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, artifactSource, + context); } /** * Create or replace an existing artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @param artifactSource Properties of an artifact source. @@ -598,86 +343,112 @@ public ArtifactSourceInner createOrUpdate(String resourceGroupName, String labNa } /** - * Delete artifact source. + * Allows modifying tags of artifact sources. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. + * @param artifactSource Properties of an artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 properties of an artifact source along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, + String name, ArtifactSourceFragment artifactSource) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, artifactSource, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete artifact source. + * Allows modifying tags of artifact sources. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. + * @param artifactSource Properties of an artifact source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of an artifact source on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, String name, + ArtifactSourceFragment artifactSource) { + return updateWithResponseAsync(resourceGroupName, labName, name, artifactSource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of artifact sources. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the artifact source. + * @param artifactSource Properties of an artifact source. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 properties of an artifact source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + public Response updateWithResponse(String resourceGroupName, String labName, String name, + ArtifactSourceFragment artifactSource, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, artifactSource, + context); + } + + /** + * Allows modifying tags of artifact sources. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the artifact source. + * @param artifactSource Properties of an artifact source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of an artifact source. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactSourceInner update(String resourceGroupName, String labName, String name, + ArtifactSourceFragment artifactSource) { + return updateWithResponse(resourceGroupName, labName, name, artifactSource, Context.NONE).getValue(); + } + + /** + * Delete artifact source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the artifact source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 labName, String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -693,7 +464,7 @@ private Mono deleteAsync(String resourceGroupName, String labName, String /** * Delete artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @param context The context to associate with this operation. @@ -704,13 +475,14 @@ private Mono deleteAsync(String resourceGroupName, String labName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, labName, name, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Delete artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -723,149 +495,163 @@ public void delete(String resourceGroupName, String labName, String name) { } /** - * Allows modifying tags of artifact sources. All other properties will be ignored. + * List artifact sources in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String name, ArtifactSourceFragment artifactSource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (artifactSource == null) { - return Mono.error(new IllegalArgumentException("Parameter artifactSource is required and cannot be null.")); - } else { - artifactSource.validate(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String expand, String filter, Integer top, String orderby) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), artifactSource, accept, context)) + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, 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())); } /** - * Allows modifying tags of artifact sources. All other properties will be ignored. + * List artifact sources in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. - * @param context The context to associate with this operation. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String name, ArtifactSourceFragment artifactSource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (artifactSource == null) { - return Mono.error(new IllegalArgumentException("Parameter artifactSource is required and cannot be null.")); - } else { - artifactSource.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), artifactSource, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of artifact sources. All other properties will be ignored. + * List artifact sources in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List artifact sources in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String name, - ArtifactSourceFragment artifactSource) { - return updateWithResponseAsync(resourceGroupName, labName, name, artifactSource) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of artifact sources. All other properties will be ignored. + * List artifact sources in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String name, - ArtifactSourceFragment artifactSource, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, name, artifactSource, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of artifact sources. All other properties will be ignored. + * List artifact sources in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ArtifactSourceInner update(String resourceGroupName, String labName, String name, - ArtifactSourceFragment artifactSource) { - return updateWithResponse(resourceGroupName, labName, name, artifactSource, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List artifact sources in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -880,13 +666,6 @@ public ArtifactSourceInner update(String resourceGroupName, String labName, Stri */ @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(), @@ -894,6 +673,24 @@ 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -902,22 +699,13 @@ 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesImpl.java index 7620c8f1b2aa..074aaf189a63 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -27,28 +27,12 @@ public ArtifactSourcesImpl(ArtifactSourcesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ArtifactSourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ArtifactSourceImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ArtifactSourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ArtifactSourceImpl(inner.getValue(), this.manager())); } public ArtifactSource get(String resourceGroupName, String labName, String name) { @@ -68,6 +52,18 @@ public void delete(String resourceGroupName, String labName, String name) { this.serviceClient().delete(resourceGroupName, labName, name); } + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ArtifactSourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ArtifactSourceImpl(inner1, this.manager())); + } + public ArtifactSource getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsClientImpl.java index 6c0da43bce46..4ce543fc43bd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -30,7 +30,7 @@ import com.azure.resourcemanager.devtestlabs.fluent.ArtifactsClient; import com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInfoInner; import com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactInner; -import com.azure.resourcemanager.devtestlabs.models.ArtifactList; +import com.azure.resourcemanager.devtestlabs.implementation.models.ArtifactList; import com.azure.resourcemanager.devtestlabs.models.GenerateArmTemplateRequest; import reactor.core.publisher.Mono; @@ -46,221 +46,226 @@ public final class ArtifactsClientImpl implements ArtifactsClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of ArtifactsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ArtifactsClientImpl(DevTestLabsClientImpl client) { + ArtifactsClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(ArtifactsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientArtifacts to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for DevTestLabsManagementClientArtifacts to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientArt") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientArtifacts") public interface ArtifactsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}") + @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("labName") String labName, + @PathParam("artifactSourceName") String artifactSourceName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}") + @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("labName") String labName, + @PathParam("artifactSourceName") String artifactSourceName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("artifactSourceName") String artifactSourceName, @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("artifactSourceName") String artifactSourceName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}/generateArmTemplate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateArmTemplate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("artifactSourceName") String artifactSourceName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GenerateArmTemplateRequest generateArmTemplateRequest, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}/generateArmTemplate") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> generateArmTemplate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response generateArmTemplateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("artifactSourceName") String artifactSourceName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GenerateArmTemplateRequest generateArmTemplateRequest, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GenerateArmTemplateRequest generateArmTemplateRequest, 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); } /** - * List artifacts in a given artifact source. + * Get artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. + * @param name The name of the artifact. * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return artifact along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String artifactSourceName, String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (artifactSourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter artifactSourceName is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String labName, + String artifactSourceName, String name, String expand) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, artifactSourceName, name, expand, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List artifacts in a given artifact source. + * Get artifact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param artifactSourceName The name of the artifact source. + * @param name The name of the artifact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return artifact on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String labName, String artifactSourceName, + String name) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. + * @param name The name of the artifact. * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return artifact along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String artifactSourceName, String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (artifactSourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter artifactSourceName is required and cannot be null.")); - } + public Response getWithResponse(String resourceGroupName, String labName, String artifactSourceName, + String name, String expand, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - artifactSourceName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, artifactSourceName, name, expand, accept, context); } /** - * List artifacts in a given artifact source. + * Get artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param name The name of the artifact. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. + * @return artifact. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ArtifactInner get(String resourceGroupName, String labName, String artifactSourceName, String name) { + final String expand = null; + return getWithResponse(resourceGroupName, labName, artifactSourceName, name, expand, Context.NONE).getValue(); } /** * List artifacts in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. + * @param expand Specify the $expand query. Example: 'properties($select=title)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. + * @return the response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String artifactSourceName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String artifactSourceName, String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, artifactSourceName, expand, filter, top, + orderby, 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 artifacts in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param expand Specify the $expand query. Example: 'properties($select=title)'. * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -268,209 +273,138 @@ private PagedFlux listAsync(String resourceGroupName, String labN */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, - top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + String expand, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * List artifacts in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName) { + private PagedFlux listAsync(String resourceGroupName, String labName, String artifactSourceName) { final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>( - listAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby)); + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * List artifacts in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param expand Specify the $expand query. Example: 'properties($select=title)'. * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context)); - } - - /** - * Get artifact. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param artifactSourceName The name of the artifact source. - * @param name The name of the artifact. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String artifactSourceName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (artifactSourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter artifactSourceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String labName, + String artifactSourceName, String expand, String filter, Integer top, String orderby) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, artifactSourceName, name, expand, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get artifact. + * List artifacts in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the artifact. * @param expand Specify the $expand query. Example: 'properties($select=title)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String artifactSourceName, String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (artifactSourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter artifactSourceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String labName, + String artifactSourceName, String expand, String filter, Integer top, String orderby, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - artifactSourceName, name, expand, this.client.getApiVersion(), accept, context); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get artifact. + * List artifacts in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the artifact. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String artifactSourceName, - String name) { + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName) { final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); } /** - * Get artifact. + * List artifacts in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the artifact. * @param expand Specify the $expand query. Example: 'properties($select=title)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String labName, String artifactSourceName, - String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, expand, context).block(); - } - - /** - * Get artifact. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param artifactSourceName The name of the artifact source. - * @param name The name of the artifact. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ArtifactInner get(String resourceGroupName, String labName, String artifactSourceName, String name) { - final String expand = null; - return getWithResponse(resourceGroupName, labName, artifactSourceName, name, expand, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, + String expand, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** * Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates * the generated artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. @@ -484,39 +418,12 @@ public ArtifactInner get(String resourceGroupName, String labName, String artifa @ServiceMethod(returns = ReturnType.SINGLE) private Mono> generateArmTemplateWithResponseAsync(String resourceGroupName, String labName, String artifactSourceName, String name, GenerateArmTemplateRequest generateArmTemplateRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (artifactSourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter artifactSourceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (generateArmTemplateRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter generateArmTemplateRequest is required and cannot be null.")); - } else { - generateArmTemplateRequest.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.generateArmTemplate(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, labName, artifactSourceName, name, - this.client.getApiVersion(), generateArmTemplateRequest, accept, context)) + .withContext(context -> service.generateArmTemplate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, artifactSourceName, name, contentType, + accept, generateArmTemplateRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -524,62 +431,7 @@ private Mono> generateArmTemplateWithResponseAsyn * Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates * the generated artifact. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param artifactSourceName The name of the artifact source. - * @param name The name of the artifact. - * @param generateArmTemplateRequest Parameters for generating an ARM template for deploying artifacts. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a generated ARM template along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generateArmTemplateWithResponseAsync(String resourceGroupName, - String labName, String artifactSourceName, String name, GenerateArmTemplateRequest generateArmTemplateRequest, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (artifactSourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter artifactSourceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (generateArmTemplateRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter generateArmTemplateRequest is required and cannot be null.")); - } else { - generateArmTemplateRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.generateArmTemplate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, artifactSourceName, name, this.client.getApiVersion(), - generateArmTemplateRequest, accept, context); - } - - /** - * Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates - * the generated artifact. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. @@ -600,7 +452,7 @@ private Mono generateArmTemplateAsync(String resourceGroup * Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates * the generated artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. @@ -615,15 +467,18 @@ private Mono generateArmTemplateAsync(String resourceGroup public Response generateArmTemplateWithResponse(String resourceGroupName, String labName, String artifactSourceName, String name, GenerateArmTemplateRequest generateArmTemplateRequest, Context context) { - return generateArmTemplateWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, - generateArmTemplateRequest, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateArmTemplateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, artifactSourceName, name, contentType, accept, + generateArmTemplateRequest, context); } /** * Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates * the generated artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. @@ -652,13 +507,6 @@ public ArmTemplateInfoInner generateArmTemplate(String resourceGroupName, String */ @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(), @@ -666,6 +514,23 @@ private Mono> listNextSinglePageAsync(String nextLi .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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -674,22 +539,13 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsImpl.java index 63f8ef0d0856..26578d4647c0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -30,28 +30,12 @@ public ArtifactsImpl(ArtifactsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, artifactSourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ArtifactImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ArtifactImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String labName, String artifactSourceName, String name, String expand, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, labName, artifactSourceName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ArtifactImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ArtifactImpl(inner.getValue(), this.manager())); } public Artifact get(String resourceGroupName, String labName, String artifactSourceName, String name) { @@ -63,18 +47,26 @@ public Artifact get(String resourceGroupName, String labName, String artifactSou } } + public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, artifactSourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ArtifactImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, + String expand, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ArtifactImpl(inner1, this.manager())); + } + public Response generateArmTemplateWithResponse(String resourceGroupName, String labName, String artifactSourceName, String name, GenerateArmTemplateRequest generateArmTemplateRequest, Context context) { Response inner = this.serviceClient() .generateArmTemplateWithResponse(resourceGroupName, labName, artifactSourceName, name, generateArmTemplateRequest, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ArmTemplateInfoImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ArmTemplateInfoImpl(inner.getValue(), this.manager())); } public ArmTemplateInfo generateArmTemplate(String resourceGroupName, String labName, String artifactSourceName, diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsClientImpl.java index 73452338b526..05aa25d7e40f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -39,50 +39,68 @@ public final class CostsClientImpl implements CostsClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of CostsClientImpl. * * @param client the instance of the service client containing this operation class. */ - CostsClientImpl(DevTestLabsClientImpl client) { + CostsClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(CostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientCosts to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for DevTestLabsManagementClientCosts to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientCos") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientCosts") public interface CostsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/costs/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/costs/{name}") + @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("labName") String labName, + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/costs/{name}") + @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("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") LabCostInner labCost, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/costs/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LabCostInner labCost, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") LabCostInner labCost, Context context); } /** * Get cost. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @param expand Specify the $expand query. Example: 'properties($expand=labCostDetails)'. @@ -94,75 +112,17 @@ Mono> createOrUpdate(@HostParam("$host") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get cost. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the cost. - * @param expand Specify the $expand query. Example: 'properties($expand=labCostDetails)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cost along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, - String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get cost. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -180,7 +140,7 @@ private Mono getAsync(String resourceGroupName, String labName, St /** * Get cost. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @param expand Specify the $expand query. Example: 'properties($expand=labCostDetails)'. @@ -193,13 +153,15 @@ private Mono getAsync(String resourceGroupName, String labName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, name, expand, accept, context); } /** * Get cost. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -216,7 +178,7 @@ public LabCostInner get(String resourceGroupName, String labName, String name) { /** * Create or replace an existing cost. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @param labCost A cost item. @@ -228,85 +190,19 @@ public LabCostInner get(String resourceGroupName, String labName, String name) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, String name, LabCostInner labCost) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (labCost == null) { - return Mono.error(new IllegalArgumentException("Parameter labCost is required and cannot be null.")); - } else { - labCost.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), labCost, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, labCost, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing cost. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the cost. - * @param labCost A cost item. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a cost item along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String name, LabCostInner labCost, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (labCost == null) { - return Mono.error(new IllegalArgumentException("Parameter labCost is required and cannot be null.")); - } else { - labCost.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), labCost, accept, context); - } - - /** - * Create or replace an existing cost. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @param labCost A cost item. @@ -325,7 +221,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String /** * Create or replace an existing cost. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @param labCost A cost item. @@ -338,13 +234,16 @@ private Mono createOrUpdateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, LabCostInner labCost, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, name, labCost, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, labCost, context); } /** * Create or replace an existing cost. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @param labCost A cost item. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsImpl.java index 96b1f28bcdc8..a4700f65eb24 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -29,12 +29,8 @@ public Response getWithResponse(String resourceGroupName, String labNam Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new LabCostImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LabCostImpl(inner.getValue(), this.manager())); } public LabCost get(String resourceGroupName, String labName, String name) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImageImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImageImpl.java index 5c1e42c99ea6..333058427119 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImageImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImageImpl.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.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.CustomImageInner; import com.azure.resourcemanager.devtestlabs.models.CustomImage; @@ -35,10 +36,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -48,6 +45,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public CustomImagePropertiesFromVm vm() { return this.innerModel().vm(); } @@ -269,6 +274,6 @@ public CustomImageImpl withIsPlanAuthorized(Boolean isPlanAuthorized) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesClientImpl.java index a7894f06f9dc..4762fb164ed7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -28,14 +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.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient; import com.azure.resourcemanager.devtestlabs.fluent.models.CustomImageInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.CustomImageList; import com.azure.resourcemanager.devtestlabs.models.CustomImageFragment; -import com.azure.resourcemanager.devtestlabs.models.CustomImageList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -52,282 +53,145 @@ public final class CustomImagesClientImpl implements CustomImagesClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of CustomImagesClientImpl. * * @param client the instance of the service client containing this operation class. */ - CustomImagesClientImpl(DevTestLabsClientImpl client) { + CustomImagesClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(CustomImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientCustomImages to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientCustomImages to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientCus") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientCustomImages") public interface CustomImagesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CustomImageInner customImage, @HeaderParam("Accept") String accept, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CustomImageInner customImage, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}") - @ExpectedResponses({ 200, 202, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CustomImageInner customImage, + Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CustomImageFragment customImage, @HeaderParam("Accept") String accept, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CustomImageFragment customImage, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List custom images in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CustomImageFragment customImage, + Context context); - /** - * List custom images in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, expand, - filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}") + @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("labName") String labName, + @PathParam("name") String name, Context context); - /** - * List custom images in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}") + @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("labName") String labName, + @PathParam("name") String name, Context context); - /** - * List custom images in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List custom images in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List custom images in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); - } + @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); - /** - * List custom images in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, 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); } /** * Get custom image. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param expand Specify the $expand query. Example: 'properties($select=vm)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -337,77 +201,19 @@ public PagedIterable list(String resourceGroupName, String lab @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get custom image. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom image along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, - String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get custom image. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -423,9 +229,9 @@ private Mono getAsync(String resourceGroupName, String labName /** * Get custom image. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param expand Specify the $expand query. Example: 'properties($select=vm)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -436,15 +242,17 @@ private Mono getAsync(String resourceGroupName, String labName @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, name, expand, accept, context); } /** * Get custom image. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -459,9 +267,9 @@ public CustomImageInner get(String resourceGroupName, String labName, String nam /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -471,131 +279,87 @@ public CustomImageInner get(String resourceGroupName, String labName, String nam @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, String name, CustomImageInner customImage) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (customImage == null) { - return Mono.error(new IllegalArgumentException("Parameter customImage is required and cannot be null.")); - } else { - customImage.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), customImage, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, customImage, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image along with {@link Response} on successful completion of {@link Mono}. + * @return a custom image along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String name, CustomImageInner customImage, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (customImage == null) { - return Mono.error(new IllegalArgumentException("Parameter customImage is required and cannot be null.")); - } else { - customImage.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + CustomImageInner customImage) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), customImage, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, customImage, + Context.NONE); } /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 custom image. + * @return a custom image along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CustomImageInner> - beginCreateOrUpdateAsync(String resourceGroupName, String labName, String name, CustomImageInner customImage) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, customImage); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CustomImageInner.class, CustomImageInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + CustomImageInner customImage, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, customImage, + context); } /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 custom image. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CustomImageInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, String name, CustomImageInner customImage, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, CustomImageInner> + beginCreateOrUpdateAsync(String resourceGroupName, String labName, String name, CustomImageInner customImage) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, customImage, context); + = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, customImage); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CustomImageInner.class, CustomImageInner.class, context); + CustomImageInner.class, CustomImageInner.class, this.client.getContext()); } /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -605,15 +369,17 @@ private PollerFlux, CustomImageInner> beginCreateOr @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CustomImageInner> beginCreateOrUpdate(String resourceGroupName, String labName, String name, CustomImageInner customImage) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, name, customImage).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, labName, name, customImage); + return this.client.getLroResult(response, CustomImageInner.class, + CustomImageInner.class, Context.NONE); } /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -624,15 +390,18 @@ public SyncPoller, CustomImageInner> beginCreateOrU @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CustomImageInner> beginCreateOrUpdate(String resourceGroupName, String labName, String name, CustomImageInner customImage, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, name, customImage, context).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, labName, name, customImage, context); + return this.client.getLroResult(response, CustomImageInner.class, + CustomImageInner.class, context); } /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -649,30 +418,29 @@ private Mono createOrUpdateAsync(String resourceGroupName, Str /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image on successful completion of {@link Mono}. + * @return a custom image. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String name, - CustomImageInner customImage, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, name, customImage, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public CustomImageInner createOrUpdate(String resourceGroupName, String labName, String name, + CustomImageInner customImage) { + return beginCreateOrUpdate(resourceGroupName, labName, name, customImage).getFinalResult(); } /** * Create or replace an existing custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -680,35 +448,100 @@ private Mono createOrUpdateAsync(String resourceGroupName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public CustomImageInner createOrUpdate(String resourceGroupName, String labName, String name, - CustomImageInner customImage) { - return createOrUpdateAsync(resourceGroupName, labName, name, customImage).block(); + CustomImageInner customImage, Context context) { + return beginCreateOrUpdate(resourceGroupName, labName, name, customImage, context).getFinalResult(); } /** - * Create or replace an existing custom image. This operation can take a while to complete. + * Allows modifying tags of custom images. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the CustomImage. + * @param customImage A custom image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a custom image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, + String name, CustomImageFragment customImage) { + 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, labName, name, contentType, accept, customImage, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows modifying tags of custom images. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the CustomImage. + * @param customImage A custom image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a custom image on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, String name, + CustomImageFragment customImage) { + return updateWithResponseAsync(resourceGroupName, labName, name, customImage) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of custom images. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param customImage A custom image. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a custom image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String labName, String name, + CustomImageFragment customImage, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, customImage, + context); + } + + /** + * Allows modifying tags of custom images. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the CustomImage. + * @param customImage A custom image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a custom image. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CustomImageInner createOrUpdate(String resourceGroupName, String labName, String name, - CustomImageInner customImage, Context context) { - return createOrUpdateAsync(resourceGroupName, labName, name, customImage, context).block(); + public CustomImageInner update(String resourceGroupName, String labName, String name, + CustomImageFragment customImage) { + return updateWithResponse(resourceGroupName, labName, name, customImage, Context.NONE).getValue(); } /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -717,115 +550,72 @@ public CustomImageInner createOrUpdate(String resourceGroupName, String labName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param context The context to associate with this operation. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String labName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, Context.NONE); } /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 labName, String name) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); - 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 labName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param context The context to associate with this operation. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 labName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -833,15 +623,16 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { - return this.beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -851,15 +642,16 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name, Context context) { - return this.beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -873,196 +665,192 @@ private Mono deleteAsync(String resourceGroupName, String labName, String /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param context The context to associate with this operation. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 labName, String name, Context context) { - return beginDeleteAsync(resourceGroupName, labName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String labName, String name) { + beginDelete(resourceGroupName, labName, name).getFinalResult(); } /** * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 labName, String name) { - deleteAsync(resourceGroupName, labName, name).block(); + public void delete(String resourceGroupName, String labName, String name, Context context) { + beginDelete(resourceGroupName, labName, name, context).getFinalResult(); } /** - * Delete custom image. This operation can take a while to complete. + * List custom images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param context The context to associate with this operation. + * @param expand Specify the $expand query. Example: 'properties($select=vm)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String name, Context context) { - deleteAsync(resourceGroupName, labName, name, context).block(); + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, 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())); } /** - * Allows modifying tags of custom images. All other properties will be ignored. + * List custom images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param customImage A custom image. + * @param expand Specify the $expand query. Example: 'properties($select=vm)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String name, CustomImageFragment customImage) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (customImage == null) { - return Mono.error(new IllegalArgumentException("Parameter customImage is required and cannot be null.")); - } else { - customImage.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), customImage, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of custom images. All other properties will be ignored. + * List custom images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param customImage A custom image. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String name, CustomImageFragment customImage, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (customImage == null) { - return Mono.error(new IllegalArgumentException("Parameter customImage is required and cannot be null.")); - } else { - customImage.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), customImage, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of custom images. All other properties will be ignored. + * List custom images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param customImage A custom image. + * @param expand Specify the $expand query. Example: 'properties($select=vm)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String name, - CustomImageFragment customImage) { - return updateWithResponseAsync(resourceGroupName, labName, name, customImage) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of custom images. All other properties will be ignored. + * List custom images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param customImage A custom image. + * @param expand Specify the $expand query. Example: 'properties($select=vm)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String name, - CustomImageFragment customImage, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, name, customImage, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of custom images. All other properties will be ignored. + * List custom images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param customImage A custom image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomImageInner update(String resourceGroupName, String labName, String name, - CustomImageFragment customImage) { - return updateWithResponse(resourceGroupName, labName, name, customImage, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List custom images in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=vm)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -1077,13 +865,6 @@ public CustomImageInner update(String resourceGroupName, String labName, String */ @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(), @@ -1091,6 +872,23 @@ private Mono> listNextSinglePageAsync(String nex .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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -1099,22 +897,13 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesImpl.java index 404ce4e77fd8..719d3e702b35 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -27,28 +27,12 @@ public CustomImagesImpl(CustomImagesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomImageImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomImageImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CustomImageImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CustomImageImpl(inner.getValue(), this.manager())); } public CustomImage get(String resourceGroupName, String labName, String name) { @@ -68,6 +52,18 @@ public void delete(String resourceGroupName, String labName, String name, Contex this.serviceClient().delete(resourceGroupName, labName, name, context); } + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomImageImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomImageImpl(inner1, this.manager())); + } + public CustomImage getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsClientBuilder.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsManagementClientBuilder.java similarity index 63% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsClientBuilder.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsManagementClientBuilder.java index 06ac57595b99..00c9fa3153cb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsClientBuilder.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the DevTestLabsClientImpl type. + * A builder for creating a new instance of the DevTestLabsManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = { DevTestLabsClientImpl.class }) -public final class DevTestLabsClientBuilder { +@ServiceClientBuilder(serviceClients = { DevTestLabsManagementClientImpl.class }) +public final class DevTestLabsManagementClientBuilder { /* - * The subscription ID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The subscription ID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the DevTestLabsClientBuilder. + * @param endpoint the endpoint value. + * @return the DevTestLabsManagementClientBuilder. */ - public DevTestLabsClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public DevTestLabsManagementClientBuilder 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. - * @return the DevTestLabsClientBuilder. + * @param subscriptionId the subscriptionId value. + * @return the DevTestLabsManagementClientBuilder. */ - public DevTestLabsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public DevTestLabsManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public DevTestLabsClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the DevTestLabsClientBuilder. + * @return the DevTestLabsManagementClientBuilder. */ - public DevTestLabsClientBuilder environment(AzureEnvironment environment) { + public DevTestLabsManagementClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public DevTestLabsClientBuilder environment(AzureEnvironment environment) { * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the DevTestLabsClientBuilder. + * @return the DevTestLabsManagementClientBuilder. */ - public DevTestLabsClientBuilder pipeline(HttpPipeline pipeline) { + public DevTestLabsManagementClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public DevTestLabsClientBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the DevTestLabsClientBuilder. + * @return the DevTestLabsManagementClientBuilder. */ - public DevTestLabsClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public DevTestLabsManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public DevTestLabsClientBuilder defaultPollInterval(Duration defaultPollInterval * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the DevTestLabsClientBuilder. + * @return the DevTestLabsManagementClientBuilder. */ - public DevTestLabsClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public DevTestLabsManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of DevTestLabsClientImpl with the provided parameters. + * Builds an instance of DevTestLabsManagementClientImpl with the provided parameters. * - * @return an instance of DevTestLabsClientImpl. + * @return an instance of DevTestLabsManagementClientImpl. */ - public DevTestLabsClientImpl buildClient() { + public DevTestLabsManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,8 +131,8 @@ public DevTestLabsClientImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - DevTestLabsClientImpl client = new DevTestLabsClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + DevTestLabsManagementClientImpl client = new DevTestLabsManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsManagementClientImpl.java similarity index 91% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsClientImpl.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsManagementClientImpl.java index 47e038e31503..6f1c373cdfa5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -15,12 +15,15 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.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.devtestlabs.fluent.ArmTemplatesClient; @@ -28,7 +31,7 @@ import com.azure.resourcemanager.devtestlabs.fluent.ArtifactsClient; import com.azure.resourcemanager.devtestlabs.fluent.CostsClient; import com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient; -import com.azure.resourcemanager.devtestlabs.fluent.DevTestLabsClient; +import com.azure.resourcemanager.devtestlabs.fluent.DevTestLabsManagementClient; import com.azure.resourcemanager.devtestlabs.fluent.DisksClient; import com.azure.resourcemanager.devtestlabs.fluent.EnvironmentsClient; import com.azure.resourcemanager.devtestlabs.fluent.FormulasClient; @@ -59,31 +62,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the DevTestLabsClientImpl type. + * Initializes a new instance of the DevTestLabsManagementClientImpl type. */ -@ServiceClient(builder = DevTestLabsClientBuilder.class) -public final class DevTestLabsClientImpl implements DevTestLabsClient { +@ServiceClient(builder = DevTestLabsManagementClientBuilder.class) +public final class DevTestLabsManagementClientImpl implements DevTestLabsManagementClient { /** - * The subscription ID. - */ - private final String subscriptionId; - - /** - * Gets The subscription ID. - * - * @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. */ @@ -92,12 +81,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -105,6 +94,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. */ @@ -176,31 +179,59 @@ public LabsClient getLabs() { } /** - * The OperationsClient object to access its operations. + * The GlobalSchedulesClient object to access its operations. */ - private final OperationsClient operations; + private final GlobalSchedulesClient globalSchedules; /** - * Gets the OperationsClient object to access its operations. + * Gets the GlobalSchedulesClient object to access its operations. * - * @return the OperationsClient object. + * @return the GlobalSchedulesClient object. */ - public OperationsClient getOperations() { - return this.operations; + public GlobalSchedulesClient getGlobalSchedules() { + return this.globalSchedules; } /** - * The GlobalSchedulesClient object to access its operations. + * The SchedulesClient object to access its operations. */ - private final GlobalSchedulesClient globalSchedules; + private final SchedulesClient schedules; /** - * Gets the GlobalSchedulesClient object to access its operations. + * Gets the SchedulesClient object to access its operations. * - * @return the GlobalSchedulesClient object. + * @return the SchedulesClient object. */ - public GlobalSchedulesClient getGlobalSchedules() { - return this.globalSchedules; + public SchedulesClient getSchedules() { + return this.schedules; + } + + /** + * The ServiceFabricSchedulesClient object to access its operations. + */ + private final ServiceFabricSchedulesClient serviceFabricSchedules; + + /** + * Gets the ServiceFabricSchedulesClient object to access its operations. + * + * @return the ServiceFabricSchedulesClient object. + */ + public ServiceFabricSchedulesClient getServiceFabricSchedules() { + return this.serviceFabricSchedules; + } + + /** + * The VirtualMachineSchedulesClient object to access its operations. + */ + private final VirtualMachineSchedulesClient virtualMachineSchedules; + + /** + * Gets the VirtualMachineSchedulesClient object to access its operations. + * + * @return the VirtualMachineSchedulesClient object. + */ + public VirtualMachineSchedulesClient getVirtualMachineSchedules() { + return this.virtualMachineSchedules; } /** @@ -315,20 +346,6 @@ public NotificationChannelsClient getNotificationChannels() { return this.notificationChannels; } - /** - * The PolicySetsClient object to access its operations. - */ - private final PolicySetsClient policySets; - - /** - * Gets the PolicySetsClient object to access its operations. - * - * @return the PolicySetsClient object. - */ - public PolicySetsClient getPolicySets() { - return this.policySets; - } - /** * The PoliciesClient object to access its operations. */ @@ -344,17 +361,17 @@ public PoliciesClient getPolicies() { } /** - * The SchedulesClient object to access its operations. + * The PolicySetsClient object to access its operations. */ - private final SchedulesClient schedules; + private final PolicySetsClient policySets; /** - * Gets the SchedulesClient object to access its operations. + * Gets the PolicySetsClient object to access its operations. * - * @return the SchedulesClient object. + * @return the PolicySetsClient object. */ - public SchedulesClient getSchedules() { - return this.schedules; + public PolicySetsClient getPolicySets() { + return this.policySets; } /** @@ -441,20 +458,6 @@ public ServiceFabricsClient getServiceFabrics() { return this.serviceFabrics; } - /** - * The ServiceFabricSchedulesClient object to access its operations. - */ - private final ServiceFabricSchedulesClient serviceFabricSchedules; - - /** - * Gets the ServiceFabricSchedulesClient object to access its operations. - * - * @return the ServiceFabricSchedulesClient object. - */ - public ServiceFabricSchedulesClient getServiceFabricSchedules() { - return this.serviceFabricSchedules; - } - /** * The VirtualMachinesClient object to access its operations. */ @@ -470,55 +473,57 @@ public VirtualMachinesClient getVirtualMachines() { } /** - * The VirtualMachineSchedulesClient object to access its operations. + * The VirtualNetworksClient object to access its operations. */ - private final VirtualMachineSchedulesClient virtualMachineSchedules; + private final VirtualNetworksClient virtualNetworks; /** - * Gets the VirtualMachineSchedulesClient object to access its operations. + * Gets the VirtualNetworksClient object to access its operations. * - * @return the VirtualMachineSchedulesClient object. + * @return the VirtualNetworksClient object. */ - public VirtualMachineSchedulesClient getVirtualMachineSchedules() { - return this.virtualMachineSchedules; + public VirtualNetworksClient getVirtualNetworks() { + return this.virtualNetworks; } /** - * The VirtualNetworksClient object to access its operations. + * The OperationsClient object to access its operations. */ - private final VirtualNetworksClient virtualNetworks; + private final OperationsClient operations; /** - * Gets the VirtualNetworksClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the VirtualNetworksClient object. + * @return the OperationsClient object. */ - public VirtualNetworksClient getVirtualNetworks() { - return this.virtualNetworks; + public OperationsClient getOperations() { + return this.operations; } /** - * Initializes an instance of DevTestLabsClient client. + * Initializes an instance of DevTestLabsManagementClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The subscription ID. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ - DevTestLabsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String subscriptionId, String endpoint) { + DevTestLabsManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.subscriptionId = subscriptionId; this.apiVersion = "2018-09-15"; this.providerOperations = new ProviderOperationsClientImpl(this); this.labs = new LabsClientImpl(this); - this.operations = new OperationsClientImpl(this); this.globalSchedules = new GlobalSchedulesClientImpl(this); + this.schedules = new SchedulesClientImpl(this); + this.serviceFabricSchedules = new ServiceFabricSchedulesClientImpl(this); + this.virtualMachineSchedules = new VirtualMachineSchedulesClientImpl(this); this.artifactSources = new ArtifactSourcesClientImpl(this); this.armTemplates = new ArmTemplatesClientImpl(this); this.artifacts = new ArtifactsClientImpl(this); @@ -527,19 +532,17 @@ public VirtualNetworksClient getVirtualNetworks() { this.formulas = new FormulasClientImpl(this); this.galleryImages = new GalleryImagesClientImpl(this); this.notificationChannels = new NotificationChannelsClientImpl(this); - this.policySets = new PolicySetsClientImpl(this); this.policies = new PoliciesClientImpl(this); - this.schedules = new SchedulesClientImpl(this); + this.policySets = new PolicySetsClientImpl(this); this.serviceRunners = new ServiceRunnersClientImpl(this); this.users = new UsersClientImpl(this); this.disks = new DisksClientImpl(this); this.environments = new EnvironmentsClientImpl(this); this.secrets = new SecretsClientImpl(this); this.serviceFabrics = new ServiceFabricsClientImpl(this); - this.serviceFabricSchedules = new ServiceFabricSchedulesClientImpl(this); this.virtualMachines = new VirtualMachinesClientImpl(this); - this.virtualMachineSchedules = new VirtualMachineSchedulesClientImpl(this); this.virtualNetworks = new VirtualNetworksClientImpl(this); + this.operations = new OperationsClientImpl(this); } /** @@ -579,6 +582,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. * @@ -668,5 +688,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(DevTestLabsClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(DevTestLabsManagementClientImpl.class); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DiskImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DiskImpl.java index a13fd0472a03..ccfac13211f8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DiskImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DiskImpl.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.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.DiskInner; import com.azure.resourcemanager.devtestlabs.models.AttachDiskProperties; @@ -33,10 +34,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -46,6 +43,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public StorageType diskType() { return this.innerModel().diskType(); } @@ -114,30 +119,30 @@ private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { private String labName; - private String username; + private String userName; private String name; private DiskFragment updateDisk; - public DiskImpl withExistingUser(String resourceGroupName, String labName, String username) { + public DiskImpl withExistingUser(String resourceGroupName, String labName, String userName) { this.resourceGroupName = resourceGroupName; this.labName = labName; - this.username = username; + this.userName = userName; return this; } public Disk create() { this.innerObject = serviceManager.serviceClient() .getDisks() - .createOrUpdate(resourceGroupName, labName, username, name, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, labName, userName, name, this.innerModel(), Context.NONE); return this; } public Disk create(Context context) { this.innerObject = serviceManager.serviceClient() .getDisks() - .createOrUpdate(resourceGroupName, labName, username, name, this.innerModel(), context); + .createOrUpdate(resourceGroupName, labName, userName, name, this.innerModel(), context); return this; } @@ -155,7 +160,7 @@ public DiskImpl update() { public Disk apply() { this.innerObject = serviceManager.serviceClient() .getDisks() - .updateWithResponse(resourceGroupName, labName, username, name, updateDisk, Context.NONE) + .updateWithResponse(resourceGroupName, labName, userName, name, updateDisk, Context.NONE) .getValue(); return this; } @@ -163,7 +168,7 @@ public Disk apply() { public Disk apply(Context context) { this.innerObject = serviceManager.serviceClient() .getDisks() - .updateWithResponse(resourceGroupName, labName, username, name, updateDisk, context) + .updateWithResponse(resourceGroupName, labName, userName, name, updateDisk, context) .getValue(); return this; } @@ -173,7 +178,7 @@ public Disk apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.labName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "labs"); - this.username = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "users"); + this.userName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "users"); this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "disks"); } @@ -181,7 +186,7 @@ public Disk refresh() { String localExpand = null; this.innerObject = serviceManager.serviceClient() .getDisks() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, userName, name, localExpand, Context.NONE) .getValue(); return this; } @@ -190,25 +195,25 @@ public Disk refresh(Context context) { String localExpand = null; this.innerObject = serviceManager.serviceClient() .getDisks() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, userName, name, localExpand, context) .getValue(); return this; } public void attach(AttachDiskProperties attachDiskProperties) { - serviceManager.disks().attach(resourceGroupName, labName, username, name, attachDiskProperties); + serviceManager.disks().attach(resourceGroupName, labName, userName, name, attachDiskProperties); } public void attach(AttachDiskProperties attachDiskProperties, Context context) { - serviceManager.disks().attach(resourceGroupName, labName, username, name, attachDiskProperties, context); + serviceManager.disks().attach(resourceGroupName, labName, userName, name, attachDiskProperties, context); } public void detach(DetachDiskProperties detachDiskProperties) { - serviceManager.disks().detach(resourceGroupName, labName, username, name, detachDiskProperties); + serviceManager.disks().detach(resourceGroupName, labName, userName, name, detachDiskProperties); } public void detach(DetachDiskProperties detachDiskProperties, Context context) { - serviceManager.disks().detach(resourceGroupName, labName, username, name, detachDiskProperties, context); + serviceManager.disks().detach(resourceGroupName, labName, userName, name, detachDiskProperties, context); } public DiskImpl withRegion(Region location) { @@ -272,6 +277,6 @@ public DiskImpl withManagedDiskId(String managedDiskId) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksClientImpl.java index 6dcfe8970ec3..2896022a85d4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -29,16 +29,17 @@ 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.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.DisksClient; import com.azure.resourcemanager.devtestlabs.fluent.models.DiskInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.DiskList; import com.azure.resourcemanager.devtestlabs.models.AttachDiskProperties; import com.azure.resourcemanager.devtestlabs.models.DetachDiskProperties; import com.azure.resourcemanager.devtestlabs.models.DiskFragment; -import com.azure.resourcemanager.devtestlabs.models.DiskList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -55,324 +56,190 @@ public final class DisksClientImpl implements DisksClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of DisksClientImpl. * * @param client the instance of the service client containing this operation class. */ - DisksClientImpl(DevTestLabsClientImpl client) { + DisksClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(DisksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientDisks to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for DevTestLabsManagementClientDisks to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientDis") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientDisks") public interface DisksService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @QueryParam("$expand") String expand, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") DiskInner disk, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DiskInner disk, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}") + @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("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DiskInner disk, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DiskFragment disk, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DiskFragment disk, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}") + @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("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") DiskFragment disk, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks") + @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("labName") String labName, + @PathParam("userName") String userName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}/attach") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> attach(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> attach(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AttachDiskProperties attachDiskProperties, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") AttachDiskProperties attachDiskProperties, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}/attach") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response attachSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") AttachDiskProperties attachDiskProperties, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}/detach") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> detach(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") DetachDiskProperties detachDiskProperties, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}/detach") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> detach(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response detachSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DetachDiskProperties detachDiskProperties, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") DetachDiskProperties detachDiskProperties, 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); - } - - /** - * List disks in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String username, String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List disks in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String username, String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, username, - expand, filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List disks in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List disks in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List disks in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List disks in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String username) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, username, expand, filter, top, orderby)); - } - - /** - * List disks in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, username, expand, filter, top, orderby, 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); } /** * Get disk. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -381,86 +248,21 @@ public PagedIterable list(String resourceGroupName, String labName, S * @return disk along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, String username, + private Mono> getWithResponseAsync(String resourceGroupName, String labName, String userName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get disk. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, String username, - String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get disk. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -468,18 +270,18 @@ private Mono> getWithResponseAsync(String resourceGroupName, * @return disk on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String username, String name) { + private Mono getAsync(String resourceGroupName, String labName, String userName, String name) { final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, username, name, expand) + return getWithResponseAsync(resourceGroupName, labName, userName, name, expand) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get disk. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. * @param context The context to associate with this operation. @@ -489,17 +291,19 @@ private Mono getAsync(String resourceGroupName, String labName, Strin * @return disk along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String labName, String username, String name, + public Response getWithResponse(String resourceGroupName, String labName, String userName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, username, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, name, expand, accept, context); } /** * Get disk. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -507,17 +311,17 @@ public Response getWithResponse(String resourceGroupName, String labN * @return disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner get(String resourceGroupName, String labName, String username, String name) { + public DiskInner get(String resourceGroupName, String labName, String userName, String name) { final String expand = null; - return getWithResponse(resourceGroupName, labName, username, name, expand, Context.NONE).getValue(); + return getWithResponse(resourceGroupName, labName, userName, name, expand, Context.NONE).getValue(); } /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -527,120 +331,71 @@ public DiskInner get(String resourceGroupName, String labName, String username, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, DiskInner disk) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } + String userName, String name, DiskInner disk) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), disk, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, disk, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk along with {@link Response} on successful completion of {@link Mono}. + * @return a Disk along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, DiskInner disk, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String userName, + String name, DiskInner disk) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, name, this.client.getApiVersion(), disk, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, disk, + Context.NONE); } /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 Disk. + * @return a Disk along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DiskInner> beginCreateOrUpdateAsync(String resourceGroupName, - String labName, String username, String name, DiskInner disk) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, username, name, disk); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), DiskInner.class, - DiskInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String userName, + String name, DiskInner disk, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, disk, + context); } /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -648,20 +403,19 @@ private PollerFlux, DiskInner> beginCreateOrUpdateAsync(St */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DiskInner> beginCreateOrUpdateAsync(String resourceGroupName, - String labName, String username, String name, DiskInner disk, Context context) { - context = this.client.mergeContext(context); + String labName, String userName, String name, DiskInner disk) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, username, name, disk, context); + = createOrUpdateWithResponseAsync(resourceGroupName, labName, userName, name, disk); return this.client.getLroResult(mono, this.client.getHttpPipeline(), DiskInner.class, - DiskInner.class, context); + DiskInner.class, this.client.getContext()); } /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -671,16 +425,17 @@ private PollerFlux, DiskInner> beginCreateOrUpdateAsync(St */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DiskInner> beginCreateOrUpdate(String resourceGroupName, String labName, - String username, String name, DiskInner disk) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, disk).getSyncPoller(); + String userName, String name, DiskInner disk) { + Response response = createOrUpdateWithResponse(resourceGroupName, labName, userName, name, disk); + return this.client.getLroResult(response, DiskInner.class, DiskInner.class, Context.NONE); } /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. * @param context The context to associate with this operation. @@ -691,16 +446,18 @@ public SyncPoller, DiskInner> beginCreateOrUpdate(String r */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DiskInner> beginCreateOrUpdate(String resourceGroupName, String labName, - String username, String name, DiskInner disk, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, disk, context).getSyncPoller(); + String userName, String name, DiskInner disk, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, labName, userName, name, disk, context); + return this.client.getLroResult(response, DiskInner.class, DiskInner.class, context); } /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -709,78 +466,144 @@ public SyncPoller, DiskInner> beginCreateOrUpdate(String r * @return a Disk on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String username, String name, + private Mono createOrUpdateAsync(String resourceGroupName, String labName, String userName, String name, DiskInner disk) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, disk).last() + return beginCreateOrUpdateAsync(resourceGroupName, labName, userName, name, disk).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk on successful completion of {@link Mono}. + * @return a Disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String username, String name, - DiskInner disk, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, disk, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public DiskInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, + DiskInner disk) { + return beginCreateOrUpdate(resourceGroupName, labName, userName, name, disk).getFinalResult(); } /** * Create or replace an existing disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner createOrUpdate(String resourceGroupName, String labName, String username, String name, - DiskInner disk) { - return createOrUpdateAsync(resourceGroupName, labName, username, name, disk).block(); + public DiskInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, + DiskInner disk, Context context) { + return beginCreateOrUpdate(resourceGroupName, labName, userName, name, disk, context).getFinalResult(); } /** - * Create or replace an existing disk. This operation can take a while to complete. + * Allows modifying tags of disks. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the disk. + * @param disk A Disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Disk along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, String userName, + String name, DiskFragment disk) { + 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, labName, userName, name, contentType, accept, disk, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows modifying tags of disks. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. + * @param name The name of the disk. + * @param disk A Disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Disk on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, String userName, String name, + DiskFragment disk) { + return updateWithResponseAsync(resourceGroupName, labName, userName, name, disk) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of disks. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. * @param name The name of the disk. * @param disk A Disk. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Disk along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String labName, String userName, + String name, DiskFragment disk, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, disk, + context); + } + + /** + * Allows modifying tags of disks. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the disk. + * @param disk A Disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner createOrUpdate(String resourceGroupName, String labName, String username, String name, - DiskInner disk, Context context) { - return createOrUpdateAsync(resourceGroupName, labName, username, name, disk, context).block(); + public DiskInner update(String resourceGroupName, String labName, String userName, String name, DiskFragment disk) { + return updateWithResponse(resourceGroupName, labName, userName, name, disk, Context.NONE).getValue(); } /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -789,106 +612,59 @@ public DiskInner createOrUpdate(String resourceGroupName, String labName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String labName, - String username, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; + String userName, String name) { return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 labName, - String username, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String labName, String userName, + String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, Context.NONE); } /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 labName, - String username, String name) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, username, name); - 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 labName, String userName, + String name, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, context); } /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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,20 +672,18 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, - String username, String name, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, labName, username, name, context); + String userName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, userName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -917,17 +691,18 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String userName, String name) { - return this.beginDeleteAsync(resourceGroupName, labName, username, name).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, userName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -936,17 +711,18 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String userName, String name, Context context) { - return this.beginDeleteAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, userName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -954,226 +730,223 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, String username, String name) { - return beginDeleteAsync(resourceGroupName, labName, username, name).last() + private Mono deleteAsync(String resourceGroupName, String labName, String userName, String name) { + return beginDeleteAsync(resourceGroupName, labName, userName, name).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 labName, String username, String name, - Context context) { - return beginDeleteAsync(resourceGroupName, labName, username, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String labName, String userName, String name) { + beginDelete(resourceGroupName, labName, userName, name).getFinalResult(); } /** * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 labName, String username, String name) { - deleteAsync(resourceGroupName, labName, username, name).block(); + public void delete(String resourceGroupName, String labName, String userName, String name, Context context) { + beginDelete(resourceGroupName, labName, userName, name, context).getFinalResult(); } /** - * Delete disk. This operation can take a while to complete. + * List disks in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String username, String name, Context context) { - deleteAsync(resourceGroupName, labName, username, name, context).block(); + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String userName, String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, expand, filter, top, orderby, + 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())); } /** - * Allows modifying tags of disks. All other properties will be ignored. + * List disks in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. - * @param disk A Disk. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, String username, - String name, DiskFragment disk) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), disk, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, userName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of disks. All other properties will be ignored. + * List disks in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. - * @param disk A Disk. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, String username, - String name, DiskFragment disk, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, this.client.getApiVersion(), disk, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String userName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, userName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of disks. All other properties will be ignored. + * List disks in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. - * @param disk A Disk. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String username, String name, - DiskFragment disk) { - return updateWithResponseAsync(resourceGroupName, labName, username, name, disk) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String userName, + String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of disks. All other properties will be ignored. + * List disks in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. - * @param disk A Disk. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String username, - String name, DiskFragment disk, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, username, name, disk, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String userName, + String expand, String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of disks. All other properties will be ignored. + * List disks in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. - * @param disk A Disk. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner update(String resourceGroupName, String labName, String username, String name, DiskFragment disk) { - return updateWithResponse(resourceGroupName, labName, username, name, disk, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String userName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, userName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List disks in a given user profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, userName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1183,123 +956,68 @@ public DiskInner update(String resourceGroupName, String labName, String usernam */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> attachWithResponseAsync(String resourceGroupName, String labName, - String username, String name, AttachDiskProperties attachDiskProperties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (attachDiskProperties == null) { - return Mono - .error(new IllegalArgumentException("Parameter attachDiskProperties is required and cannot be null.")); - } else { - attachDiskProperties.validate(); - } - final String accept = "application/json"; + String userName, String name, AttachDiskProperties attachDiskProperties) { + final String contentType = "application/json"; return FluxUtil - .withContext( - context -> service.attach(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, name, this.client.getApiVersion(), attachDiskProperties, accept, context)) + .withContext(context -> service.attach(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, + attachDiskProperties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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>> attachWithResponseAsync(String resourceGroupName, String labName, - String username, String name, AttachDiskProperties attachDiskProperties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (attachDiskProperties == null) { - return Mono - .error(new IllegalArgumentException("Parameter attachDiskProperties is required and cannot be null.")); - } else { - attachDiskProperties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.attach(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, this.client.getApiVersion(), attachDiskProperties, accept, context); + private Response attachWithResponse(String resourceGroupName, String labName, String userName, + String name, AttachDiskProperties attachDiskProperties) { + final String contentType = "application/json"; + return service.attachSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, + attachDiskProperties, Context.NONE); } /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginAttachAsync(String resourceGroupName, String labName, - String username, String name, AttachDiskProperties attachDiskProperties) { - Mono>> mono - = attachWithResponseAsync(resourceGroupName, labName, username, name, attachDiskProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response attachWithResponse(String resourceGroupName, String labName, String userName, + String name, AttachDiskProperties attachDiskProperties, Context context) { + final String contentType = "application/json"; + return service.attachSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, + attachDiskProperties, context); } /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1307,20 +1025,19 @@ private PollerFlux, Void> beginAttachAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginAttachAsync(String resourceGroupName, String labName, - String username, String name, AttachDiskProperties attachDiskProperties, Context context) { - context = this.client.mergeContext(context); + String userName, String name, AttachDiskProperties attachDiskProperties) { Mono>> mono - = attachWithResponseAsync(resourceGroupName, labName, username, name, attachDiskProperties, context); + = attachWithResponseAsync(resourceGroupName, labName, userName, name, attachDiskProperties); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1329,17 +1046,19 @@ private PollerFlux, Void> beginAttachAsync(String resourceGroup * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginAttach(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginAttach(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties) { - return this.beginAttachAsync(resourceGroupName, labName, username, name, attachDiskProperties).getSyncPoller(); + Response response + = attachWithResponse(resourceGroupName, labName, userName, name, attachDiskProperties); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. * @param context The context to associate with this operation. @@ -1349,18 +1068,19 @@ public SyncPoller, Void> beginAttach(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginAttach(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginAttach(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties, Context context) { - return this.beginAttachAsync(resourceGroupName, labName, username, name, attachDiskProperties, context) - .getSyncPoller(); + Response response + = attachWithResponse(resourceGroupName, labName, userName, name, attachDiskProperties, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1369,57 +1089,36 @@ public SyncPoller, Void> beginAttach(String resourceGroupName, * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono attachAsync(String resourceGroupName, String labName, String username, String name, + private Mono attachAsync(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties) { - return beginAttachAsync(resourceGroupName, labName, username, name, attachDiskProperties).last() + return beginAttachAsync(resourceGroupName, labName, userName, name, attachDiskProperties).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 attachAsync(String resourceGroupName, String labName, String username, String name, - AttachDiskProperties attachDiskProperties, Context context) { - return beginAttachAsync(resourceGroupName, labName, username, name, attachDiskProperties, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. - * @param attachDiskProperties Properties of the disk to attach. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 attach(String resourceGroupName, String labName, String username, String name, + public void attach(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties) { - attachAsync(resourceGroupName, labName, username, name, attachDiskProperties).block(); + beginAttach(resourceGroupName, labName, userName, name, attachDiskProperties).getFinalResult(); } /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. * @param context The context to associate with this operation. @@ -1428,18 +1127,18 @@ public void attach(String resourceGroupName, String labName, String username, St * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void attach(String resourceGroupName, String labName, String username, String name, + public void attach(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties, Context context) { - attachAsync(resourceGroupName, labName, username, name, attachDiskProperties, context).block(); + beginAttach(resourceGroupName, labName, userName, name, attachDiskProperties, context).getFinalResult(); } /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1449,39 +1148,12 @@ public void attach(String resourceGroupName, String labName, String username, St */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> detachWithResponseAsync(String resourceGroupName, String labName, - String username, String name, DetachDiskProperties detachDiskProperties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (detachDiskProperties == null) { - return Mono - .error(new IllegalArgumentException("Parameter detachDiskProperties is required and cannot be null.")); - } else { - detachDiskProperties.validate(); - } - final String accept = "application/json"; + String userName, String name, DetachDiskProperties detachDiskProperties) { + final String contentType = "application/json"; return FluxUtil - .withContext( - context -> service.detach(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, name, this.client.getApiVersion(), detachDiskProperties, accept, context)) + .withContext(context -> service.detach(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, + detachDiskProperties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1489,86 +1161,58 @@ private Mono>> detachWithResponseAsync(String resource * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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>> detachWithResponseAsync(String resourceGroupName, String labName, - String username, String name, DetachDiskProperties detachDiskProperties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (detachDiskProperties == null) { - return Mono - .error(new IllegalArgumentException("Parameter detachDiskProperties is required and cannot be null.")); - } else { - detachDiskProperties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.detach(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, this.client.getApiVersion(), detachDiskProperties, accept, context); + private Response detachWithResponse(String resourceGroupName, String labName, String userName, + String name, DetachDiskProperties detachDiskProperties) { + final String contentType = "application/json"; + return service.detachSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, + detachDiskProperties, Context.NONE); } /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginDetachAsync(String resourceGroupName, String labName, - String username, String name, DetachDiskProperties detachDiskProperties) { - Mono>> mono - = detachWithResponseAsync(resourceGroupName, labName, username, name, detachDiskProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response detachWithResponse(String resourceGroupName, String labName, String userName, + String name, DetachDiskProperties detachDiskProperties, Context context) { + final String contentType = "application/json"; + return service.detachSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, + detachDiskProperties, context); } /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1576,21 +1220,20 @@ private PollerFlux, Void> beginDetachAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDetachAsync(String resourceGroupName, String labName, - String username, String name, DetachDiskProperties detachDiskProperties, Context context) { - context = this.client.mergeContext(context); + String userName, String name, DetachDiskProperties detachDiskProperties) { Mono>> mono - = detachWithResponseAsync(resourceGroupName, labName, username, name, detachDiskProperties, context); + = detachWithResponseAsync(resourceGroupName, labName, userName, name, detachDiskProperties); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1599,18 +1242,20 @@ private PollerFlux, Void> beginDetachAsync(String resourceGroup * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDetach(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginDetach(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties) { - return this.beginDetachAsync(resourceGroupName, labName, username, name, detachDiskProperties).getSyncPoller(); + Response response + = detachWithResponse(resourceGroupName, labName, userName, name, detachDiskProperties); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. * @param context The context to associate with this operation. @@ -1620,19 +1265,20 @@ public SyncPoller, Void> beginDetach(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDetach(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginDetach(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties, Context context) { - return this.beginDetachAsync(resourceGroupName, labName, username, name, detachDiskProperties, context) - .getSyncPoller(); + Response response + = detachWithResponse(resourceGroupName, labName, userName, name, detachDiskProperties, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1641,9 +1287,9 @@ public SyncPoller, Void> beginDetach(String resourceGroupName, * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono detachAsync(String resourceGroupName, String labName, String username, String name, + private Mono detachAsync(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties) { - return beginDetachAsync(resourceGroupName, labName, username, name, detachDiskProperties).last() + return beginDetachAsync(resourceGroupName, labName, userName, name, detachDiskProperties).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1651,50 +1297,28 @@ private Mono detachAsync(String resourceGroupName, String labName, String * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 detachAsync(String resourceGroupName, String labName, String username, String name, - DetachDiskProperties detachDiskProperties, Context context) { - return beginDetachAsync(resourceGroupName, labName, username, name, detachDiskProperties, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. - * @param detachDiskProperties Properties of the disk to detach. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 detach(String resourceGroupName, String labName, String username, String name, + public void detach(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties) { - detachAsync(resourceGroupName, labName, username, name, detachDiskProperties).block(); + beginDetach(resourceGroupName, labName, userName, name, detachDiskProperties).getFinalResult(); } /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. * @param context The context to associate with this operation. @@ -1703,9 +1327,9 @@ public void detach(String resourceGroupName, String labName, String username, St * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void detach(String resourceGroupName, String labName, String username, String name, + public void detach(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties, Context context) { - detachAsync(resourceGroupName, labName, username, name, detachDiskProperties, context).block(); + beginDetach(resourceGroupName, labName, userName, name, detachDiskProperties, context).getFinalResult(); } /** @@ -1720,13 +1344,6 @@ public void detach(String resourceGroupName, String labName, String username, St */ @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(), @@ -1734,6 +1351,23 @@ 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -1742,22 +1376,13 @@ 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksImpl.java index 2687920b2057..7e4d7ee81c35 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -28,32 +28,16 @@ public DisksImpl(DisksClient innerClient, com.azure.resourcemanager.devtestlabs. this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName, String username) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, username); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DiskImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, username, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DiskImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String labName, String username, String name, + public Response getWithResponse(String resourceGroupName, String labName, String userName, String name, String expand, Context context) { Response inner - = this.serviceClient().getWithResponse(resourceGroupName, labName, username, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DiskImpl(inner.getValue(), this.manager())); - } else { - return null; - } + = this.serviceClient().getWithResponse(resourceGroupName, labName, userName, name, expand, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DiskImpl(inner.getValue(), this.manager())); } - public Disk get(String resourceGroupName, String labName, String username, String name) { - DiskInner inner = this.serviceClient().get(resourceGroupName, labName, username, name); + public Disk get(String resourceGroupName, String labName, String userName, String name) { + DiskInner inner = this.serviceClient().get(resourceGroupName, labName, userName, name); if (inner != null) { return new DiskImpl(inner, this.manager()); } else { @@ -61,32 +45,44 @@ public Disk get(String resourceGroupName, String labName, String username, Strin } } - public void delete(String resourceGroupName, String labName, String username, String name) { - this.serviceClient().delete(resourceGroupName, labName, username, name); + public void delete(String resourceGroupName, String labName, String userName, String name) { + this.serviceClient().delete(resourceGroupName, labName, userName, name); + } + + public void delete(String resourceGroupName, String labName, String userName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, labName, userName, name, context); + } + + public PagedIterable list(String resourceGroupName, String labName, String userName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, userName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DiskImpl(inner1, this.manager())); } - public void delete(String resourceGroupName, String labName, String username, String name, Context context) { - this.serviceClient().delete(resourceGroupName, labName, username, name, context); + public PagedIterable list(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, userName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DiskImpl(inner1, this.manager())); } - public void attach(String resourceGroupName, String labName, String username, String name, + public void attach(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties) { - this.serviceClient().attach(resourceGroupName, labName, username, name, attachDiskProperties); + this.serviceClient().attach(resourceGroupName, labName, userName, name, attachDiskProperties); } - public void attach(String resourceGroupName, String labName, String username, String name, + public void attach(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties, Context context) { - this.serviceClient().attach(resourceGroupName, labName, username, name, attachDiskProperties, context); + this.serviceClient().attach(resourceGroupName, labName, userName, name, attachDiskProperties, context); } - public void detach(String resourceGroupName, String labName, String username, String name, + public void detach(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties) { - this.serviceClient().detach(resourceGroupName, labName, username, name, detachDiskProperties); + this.serviceClient().detach(resourceGroupName, labName, userName, name, detachDiskProperties); } - public void detach(String resourceGroupName, String labName, String username, String name, + public void detach(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties, Context context) { - this.serviceClient().detach(resourceGroupName, labName, username, name, detachDiskProperties, context); + this.serviceClient().detach(resourceGroupName, labName, userName, name, detachDiskProperties, context); } public Disk getById(String id) { @@ -100,8 +96,8 @@ public Disk getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -111,7 +107,7 @@ public Disk getById(String id) { String.format("The resource ID '%s' is not valid. Missing path segment 'disks'.", id))); } String localExpand = null; - return this.getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, labName, userName, name, localExpand, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, String expand, Context context) { @@ -125,8 +121,8 @@ public Response getByIdWithResponse(String id, String expand, Context cont throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -135,7 +131,7 @@ public Response getByIdWithResponse(String id, String expand, Context cont throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'disks'.", id))); } - return this.getWithResponse(resourceGroupName, labName, username, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, userName, name, expand, context); } public void deleteById(String id) { @@ -149,8 +145,8 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -159,7 +155,7 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'disks'.", id))); } - this.delete(resourceGroupName, labName, username, name, Context.NONE); + this.delete(resourceGroupName, labName, userName, name, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { @@ -173,8 +169,8 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -183,7 +179,7 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'disks'.", id))); } - this.delete(resourceGroupName, labName, username, name, context); + this.delete(resourceGroupName, labName, userName, name, context); } private DisksClient serviceClient() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DtlEnvironmentImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DtlEnvironmentImpl.java index e1d7fa6d3a24..2110e44b3053 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DtlEnvironmentImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DtlEnvironmentImpl.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.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.DtlEnvironmentInner; import com.azure.resourcemanager.devtestlabs.models.DtlEnvironment; @@ -30,10 +31,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -43,6 +40,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public EnvironmentDeploymentProperties deploymentProperties() { return this.innerModel().deploymentProperties(); } @@ -91,30 +96,30 @@ private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { private String labName; - private String username; + private String userName; private String name; private DtlEnvironmentFragment updateDtlEnvironment; - public DtlEnvironmentImpl withExistingUser(String resourceGroupName, String labName, String username) { + public DtlEnvironmentImpl withExistingUser(String resourceGroupName, String labName, String userName) { this.resourceGroupName = resourceGroupName; this.labName = labName; - this.username = username; + this.userName = userName; return this; } public DtlEnvironment create() { this.innerObject = serviceManager.serviceClient() .getEnvironments() - .createOrUpdate(resourceGroupName, labName, username, name, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, labName, userName, name, this.innerModel(), Context.NONE); return this; } public DtlEnvironment create(Context context) { this.innerObject = serviceManager.serviceClient() .getEnvironments() - .createOrUpdate(resourceGroupName, labName, username, name, this.innerModel(), context); + .createOrUpdate(resourceGroupName, labName, userName, name, this.innerModel(), context); return this; } @@ -132,7 +137,7 @@ public DtlEnvironmentImpl update() { public DtlEnvironment apply() { this.innerObject = serviceManager.serviceClient() .getEnvironments() - .updateWithResponse(resourceGroupName, labName, username, name, updateDtlEnvironment, Context.NONE) + .updateWithResponse(resourceGroupName, labName, userName, name, updateDtlEnvironment, Context.NONE) .getValue(); return this; } @@ -140,7 +145,7 @@ public DtlEnvironment apply() { public DtlEnvironment apply(Context context) { this.innerObject = serviceManager.serviceClient() .getEnvironments() - .updateWithResponse(resourceGroupName, labName, username, name, updateDtlEnvironment, context) + .updateWithResponse(resourceGroupName, labName, userName, name, updateDtlEnvironment, context) .getValue(); return this; } @@ -151,7 +156,7 @@ public DtlEnvironment apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.labName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "labs"); - this.username = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "users"); + this.userName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "users"); this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "environments"); } @@ -159,7 +164,7 @@ public DtlEnvironment refresh() { String localExpand = null; this.innerObject = serviceManager.serviceClient() .getEnvironments() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, userName, name, localExpand, Context.NONE) .getValue(); return this; } @@ -168,7 +173,7 @@ public DtlEnvironment refresh(Context context) { String localExpand = null; this.innerObject = serviceManager.serviceClient() .getEnvironments() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, userName, name, localExpand, context) .getValue(); return this; } @@ -204,6 +209,6 @@ public DtlEnvironmentImpl withArmTemplateDisplayName(String armTemplateDisplayNa } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsClientImpl.java index 2ddcc79b02af..a6636f80cc3e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -28,14 +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.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.EnvironmentsClient; import com.azure.resourcemanager.devtestlabs.fluent.models.DtlEnvironmentInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.DtlEnvironmentList; import com.azure.resourcemanager.devtestlabs.models.DtlEnvironmentFragment; -import com.azure.resourcemanager.devtestlabs.models.DtlEnvironmentList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -52,303 +53,147 @@ public final class EnvironmentsClientImpl implements EnvironmentsClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of EnvironmentsClientImpl. * * @param client the instance of the service client containing this operation class. */ - EnvironmentsClientImpl(DevTestLabsClientImpl client) { + EnvironmentsClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(EnvironmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientEnvironments to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientEnvironments to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientEnv") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientEnvironments") public interface EnvironmentsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @QueryParam("$expand") String expand, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DtlEnvironmentInner dtlEnvironment, @HeaderParam("Accept") String accept, - Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DtlEnvironmentInner dtlEnvironment, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments/{name}") - @ExpectedResponses({ 200, 202, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DtlEnvironmentInner dtlEnvironment, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DtlEnvironmentFragment dtlEnvironment, @HeaderParam("Accept") String accept, - Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DtlEnvironmentFragment dtlEnvironment, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List environments in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String username, String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DtlEnvironmentFragment dtlEnvironment, Context context); - /** - * List environments in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String username, String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, username, - expand, filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments/{name}") + @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("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, Context context); - /** - * List environments in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments/{name}") + @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("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, Context context); - /** - * List environments in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments") + @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("labName") String labName, + @PathParam("userName") String userName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List environments in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments") + @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("labName") String labName, + @PathParam("userName") String userName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List environments in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String username) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, username, expand, filter, top, orderby)); - } + @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); - /** - * List environments in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, username, expand, filter, top, orderby, 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); } /** * Get environment. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -358,85 +203,20 @@ public PagedIterable list(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String username, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + String userName, String name, String expand) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get environment. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String username, String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get environment. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -444,18 +224,18 @@ private Mono> getWithResponseAsync(String resource * @return environment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String username, String name) { + private Mono getAsync(String resourceGroupName, String labName, String userName, String name) { final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, username, name, expand) + return getWithResponseAsync(resourceGroupName, labName, userName, name, expand) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get environment. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. * @param context The context to associate with this operation. @@ -465,17 +245,19 @@ private Mono getAsync(String resourceGroupName, String labN * @return environment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String labName, String username, + public Response getWithResponse(String resourceGroupName, String labName, String userName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, username, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, name, expand, accept, context); } /** * Get environment. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -483,17 +265,17 @@ public Response getWithResponse(String resourceGroupName, S * @return environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DtlEnvironmentInner get(String resourceGroupName, String labName, String username, String name) { + public DtlEnvironmentInner get(String resourceGroupName, String labName, String userName, String name) { final String expand = null; - return getWithResponse(resourceGroupName, labName, username, name, expand, Context.NONE).getValue(); + return getWithResponse(resourceGroupName, labName, userName, name, expand, Context.NONE).getValue(); } /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -504,122 +286,71 @@ public DtlEnvironmentInner get(String resourceGroupName, String labName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, DtlEnvironmentInner dtlEnvironment) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (dtlEnvironment == null) { - return Mono.error(new IllegalArgumentException("Parameter dtlEnvironment is required and cannot be null.")); - } else { - dtlEnvironment.validate(); - } + String userName, String name, DtlEnvironmentInner dtlEnvironment) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), dtlEnvironment, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, + dtlEnvironment, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment along with {@link Response} on successful - * completion of {@link Mono}. + * @return an environment, which is essentially an ARM template deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, DtlEnvironmentInner dtlEnvironment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (dtlEnvironment == null) { - return Mono.error(new IllegalArgumentException("Parameter dtlEnvironment is required and cannot be null.")); - } else { - dtlEnvironment.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String userName, + String name, DtlEnvironmentInner dtlEnvironment) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, name, this.client.getApiVersion(), dtlEnvironment, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, + dtlEnvironment, Context.NONE); } /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 environment, which is essentially an ARM template deployment. + * @return an environment, which is essentially an ARM template deployment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DtlEnvironmentInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, String username, String name, DtlEnvironmentInner dtlEnvironment) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, username, name, dtlEnvironment); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DtlEnvironmentInner.class, DtlEnvironmentInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String userName, + String name, DtlEnvironmentInner dtlEnvironment, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, + dtlEnvironment, context); } /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -627,21 +358,19 @@ private PollerFlux, DtlEnvironmentInner> beginCr */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DtlEnvironmentInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, String username, String name, DtlEnvironmentInner dtlEnvironment, - Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String labName, String userName, String name, DtlEnvironmentInner dtlEnvironment) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, username, name, dtlEnvironment, context); + = createOrUpdateWithResponseAsync(resourceGroupName, labName, userName, name, dtlEnvironment); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DtlEnvironmentInner.class, DtlEnvironmentInner.class, context); + DtlEnvironmentInner.class, DtlEnvironmentInner.class, this.client.getContext()); } /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -651,17 +380,19 @@ private PollerFlux, DtlEnvironmentInner> beginCr */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DtlEnvironmentInner> beginCreateOrUpdate( - String resourceGroupName, String labName, String username, String name, DtlEnvironmentInner dtlEnvironment) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, dtlEnvironment) - .getSyncPoller(); + String resourceGroupName, String labName, String userName, String name, DtlEnvironmentInner dtlEnvironment) { + Response response + = createOrUpdateWithResponse(resourceGroupName, labName, userName, name, dtlEnvironment); + return this.client.getLroResult(response, DtlEnvironmentInner.class, + DtlEnvironmentInner.class, Context.NONE); } /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. * @param context The context to associate with this operation. @@ -672,18 +403,20 @@ public SyncPoller, DtlEnvironmentInner> beginCre */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DtlEnvironmentInner> beginCreateOrUpdate( - String resourceGroupName, String labName, String username, String name, DtlEnvironmentInner dtlEnvironment, + String resourceGroupName, String labName, String userName, String name, DtlEnvironmentInner dtlEnvironment, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, dtlEnvironment, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, labName, userName, name, dtlEnvironment, context); + return this.client.getLroResult(response, DtlEnvironmentInner.class, + DtlEnvironmentInner.class, context); } /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -692,78 +425,147 @@ public SyncPoller, DtlEnvironmentInner> beginCre * @return an environment, which is essentially an ARM template deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String username, + private Mono createOrUpdateAsync(String resourceGroupName, String labName, String userName, String name, DtlEnvironmentInner dtlEnvironment) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, dtlEnvironment).last() + return beginCreateOrUpdateAsync(resourceGroupName, labName, userName, name, dtlEnvironment).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment on successful completion of {@link Mono}. + * @return an environment, which is essentially an ARM template deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String username, - String name, DtlEnvironmentInner dtlEnvironment, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, dtlEnvironment, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public DtlEnvironmentInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, + DtlEnvironmentInner dtlEnvironment) { + return beginCreateOrUpdate(resourceGroupName, labName, userName, name, dtlEnvironment).getFinalResult(); } /** * Create or replace an existing environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DtlEnvironmentInner createOrUpdate(String resourceGroupName, String labName, String username, String name, - DtlEnvironmentInner dtlEnvironment) { - return createOrUpdateAsync(resourceGroupName, labName, username, name, dtlEnvironment).block(); + public DtlEnvironmentInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, + DtlEnvironmentInner dtlEnvironment, Context context) { + return beginCreateOrUpdate(resourceGroupName, labName, userName, name, dtlEnvironment, context) + .getFinalResult(); } /** - * Create or replace an existing environment. This operation can take a while to complete. + * Allows modifying tags of environments. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. + * @param name The name of the environment. + * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 environment, which is essentially an ARM template deployment along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, + String userName, String name, DtlEnvironmentFragment dtlEnvironment) { + 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, labName, userName, name, contentType, accept, + dtlEnvironment, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows modifying tags of environments. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the environment. + * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 environment, which is essentially an ARM template deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, String userName, + String name, DtlEnvironmentFragment dtlEnvironment) { + return updateWithResponseAsync(resourceGroupName, labName, userName, name, dtlEnvironment) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of environments. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. * @param name The name of the environment. * @param dtlEnvironment An environment, which is essentially an ARM template deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String labName, String userName, + String name, DtlEnvironmentFragment dtlEnvironment, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, + dtlEnvironment, context); + } + + /** + * Allows modifying tags of environments. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the environment. + * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 environment, which is essentially an ARM template deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DtlEnvironmentInner createOrUpdate(String resourceGroupName, String labName, String username, String name, - DtlEnvironmentInner dtlEnvironment, Context context) { - return createOrUpdateAsync(resourceGroupName, labName, username, name, dtlEnvironment, context).block(); + public DtlEnvironmentInner update(String resourceGroupName, String labName, String userName, String name, + DtlEnvironmentFragment dtlEnvironment) { + return updateWithResponse(resourceGroupName, labName, userName, name, dtlEnvironment, Context.NONE).getValue(); } /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -772,106 +574,59 @@ public DtlEnvironmentInner createOrUpdate(String resourceGroupName, String labNa */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String labName, - String username, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; + String userName, String name) { return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 labName, - String username, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String labName, String userName, + String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, Context.NONE); } /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 labName, - String username, String name) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, username, name); - 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 labName, String userName, + String name, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, context); } /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -879,20 +634,18 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, - String username, String name, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, labName, username, name, context); + String userName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, userName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -900,17 +653,18 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String userName, String name) { - return this.beginDeleteAsync(resourceGroupName, labName, username, name).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, userName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -919,17 +673,18 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String userName, String name, Context context) { - return this.beginDeleteAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, userName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -937,222 +692,215 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, String username, String name) { - return beginDeleteAsync(resourceGroupName, labName, username, name).last() + private Mono deleteAsync(String resourceGroupName, String labName, String userName, String name) { + return beginDeleteAsync(resourceGroupName, labName, userName, name).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 labName, String username, String name, - Context context) { - return beginDeleteAsync(resourceGroupName, labName, username, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String labName, String userName, String name) { + beginDelete(resourceGroupName, labName, userName, name).getFinalResult(); } /** * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 labName, String username, String name) { - deleteAsync(resourceGroupName, labName, username, name).block(); + public void delete(String resourceGroupName, String labName, String userName, String name, Context context) { + beginDelete(resourceGroupName, labName, userName, name, context).getFinalResult(); } /** - * Delete environment. This operation can take a while to complete. + * List environments in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the environment. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String username, String name, Context context) { - deleteAsync(resourceGroupName, labName, username, name, context).block(); + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String userName, String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, expand, filter, top, orderby, + 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())); } /** - * Allows modifying tags of environments. All other properties will be ignored. + * List environments in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, DtlEnvironmentFragment dtlEnvironment) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (dtlEnvironment == null) { - return Mono.error(new IllegalArgumentException("Parameter dtlEnvironment is required and cannot be null.")); - } else { - dtlEnvironment.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, name, this.client.getApiVersion(), dtlEnvironment, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String userName, + String expand, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, userName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of environments. All other properties will be ignored. + * List environments in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, DtlEnvironmentFragment dtlEnvironment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (dtlEnvironment == null) { - return Mono.error(new IllegalArgumentException("Parameter dtlEnvironment is required and cannot be null.")); - } else { - dtlEnvironment.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, this.client.getApiVersion(), dtlEnvironment, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String userName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, userName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of environments. All other properties will be ignored. + * List environments in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String username, - String name, DtlEnvironmentFragment dtlEnvironment) { - return updateWithResponseAsync(resourceGroupName, labName, username, name, dtlEnvironment) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String userName, + String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of environments. All other properties will be ignored. + * List environments in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String username, - String name, DtlEnvironmentFragment dtlEnvironment, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, username, name, dtlEnvironment, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String userName, + String expand, String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of environments. All other properties will be ignored. + * List environments in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DtlEnvironmentInner update(String resourceGroupName, String labName, String username, String name, - DtlEnvironmentFragment dtlEnvironment) { - return updateWithResponse(resourceGroupName, labName, username, name, dtlEnvironment, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String userName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, userName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List environments in a given user profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String userName, + String expand, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, userName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -1167,13 +915,6 @@ public DtlEnvironmentInner update(String resourceGroupName, String labName, Stri */ @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(), @@ -1181,6 +922,24 @@ 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -1189,22 +948,13 @@ 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsImpl.java index 179e2930e00c..49c9820fdc0f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -27,32 +27,16 @@ public EnvironmentsImpl(EnvironmentsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName, String username) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, username); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DtlEnvironmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, username, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DtlEnvironmentImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String labName, String username, + public Response getWithResponse(String resourceGroupName, String labName, String userName, String name, String expand, Context context) { Response inner - = this.serviceClient().getWithResponse(resourceGroupName, labName, username, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DtlEnvironmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } + = this.serviceClient().getWithResponse(resourceGroupName, labName, userName, name, expand, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DtlEnvironmentImpl(inner.getValue(), this.manager())); } - public DtlEnvironment get(String resourceGroupName, String labName, String username, String name) { - DtlEnvironmentInner inner = this.serviceClient().get(resourceGroupName, labName, username, name); + public DtlEnvironment get(String resourceGroupName, String labName, String userName, String name) { + DtlEnvironmentInner inner = this.serviceClient().get(resourceGroupName, labName, userName, name); if (inner != null) { return new DtlEnvironmentImpl(inner, this.manager()); } else { @@ -60,12 +44,24 @@ public DtlEnvironment get(String resourceGroupName, String labName, String usern } } - public void delete(String resourceGroupName, String labName, String username, String name) { - this.serviceClient().delete(resourceGroupName, labName, username, name); + public void delete(String resourceGroupName, String labName, String userName, String name) { + this.serviceClient().delete(resourceGroupName, labName, userName, name); + } + + public void delete(String resourceGroupName, String labName, String userName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, labName, userName, name, context); + } + + public PagedIterable list(String resourceGroupName, String labName, String userName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, userName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DtlEnvironmentImpl(inner1, this.manager())); } - public void delete(String resourceGroupName, String labName, String username, String name, Context context) { - this.serviceClient().delete(resourceGroupName, labName, username, name, context); + public PagedIterable list(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, userName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DtlEnvironmentImpl(inner1, this.manager())); } public DtlEnvironment getById(String id) { @@ -79,8 +75,8 @@ public DtlEnvironment getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -90,7 +86,7 @@ public DtlEnvironment getById(String id) { String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); } String localExpand = null; - return this.getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, labName, userName, name, localExpand, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, String expand, Context context) { @@ -104,8 +100,8 @@ public Response getByIdWithResponse(String id, String expand, Co throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -114,7 +110,7 @@ public Response getByIdWithResponse(String id, String expand, Co throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); } - return this.getWithResponse(resourceGroupName, labName, username, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, userName, name, expand, context); } public void deleteById(String id) { @@ -128,8 +124,8 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -138,7 +134,7 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); } - this.delete(resourceGroupName, labName, username, name, Context.NONE); + this.delete(resourceGroupName, labName, userName, name, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { @@ -152,8 +148,8 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -162,7 +158,7 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); } - this.delete(resourceGroupName, labName, username, name, context); + this.delete(resourceGroupName, labName, userName, name, context); } private EnvironmentsClient serviceClient() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EvaluatePoliciesResponseImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EvaluatePoliciesResponseImpl.java index b2c9b743c816..3142ab4f849b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EvaluatePoliciesResponseImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EvaluatePoliciesResponseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulaImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulaImpl.java index ed4731003f2e..ee95f9efe455 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulaImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulaImpl.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.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.FormulaInner; import com.azure.resourcemanager.devtestlabs.models.Formula; @@ -32,10 +33,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -45,6 +42,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String description() { return this.innerModel().description(); } @@ -219,6 +224,6 @@ public FormulaImpl withVm(FormulaPropertiesFromVm vm) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasClientImpl.java index a0ff34455514..70f9088901ee 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -28,14 +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.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.FormulasClient; import com.azure.resourcemanager.devtestlabs.fluent.models.FormulaInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.FormulaList; import com.azure.resourcemanager.devtestlabs.models.FormulaFragment; -import com.azure.resourcemanager.devtestlabs.models.FormulaList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -52,278 +53,140 @@ public final class FormulasClientImpl implements FormulasClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of FormulasClientImpl. * * @param client the instance of the service client containing this operation class. */ - FormulasClientImpl(DevTestLabsClientImpl client) { + FormulasClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(FormulasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientFormulas to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for DevTestLabsManagementClientFormulas to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientFor") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientFormulas") public interface FormulasService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FormulaInner formula, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FormulaInner formula, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}") - @ExpectedResponses({ 200, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FormulaInner formula, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FormulaFragment formula, @HeaderParam("Accept") String accept, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FormulaFragment formula, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List formulas in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FormulaFragment formula, + Context context); - /** - * List formulas in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, expand, - filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}") + @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("labName") String labName, + @PathParam("name") String name, Context context); - /** - * List formulas in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, Context context); - /** - * List formulas in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List formulas in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List formulas in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); - } + @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); - /** - * List formulas in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, 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); } /** * Get formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param expand Specify the $expand query. Example: 'properties($select=description)'. @@ -335,75 +198,17 @@ public PagedIterable list(String resourceGroupName, String labName @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get formula. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the formula. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return formula along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, - String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get formula. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -421,7 +226,7 @@ private Mono getAsync(String resourceGroupName, String labName, St /** * Get formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param expand Specify the $expand query. Example: 'properties($select=description)'. @@ -434,13 +239,15 @@ private Mono getAsync(String resourceGroupName, String labName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, name, expand, accept, context); } /** * Get formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -457,7 +264,7 @@ public FormulaInner get(String resourceGroupName, String labName, String name) { /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other parameters. @@ -470,112 +277,66 @@ public FormulaInner get(String resourceGroupName, String labName, String name) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, String name, FormulaInner formula) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (formula == null) { - return Mono.error(new IllegalArgumentException("Parameter formula is required and cannot be null.")); - } else { - formula.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), formula, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, formula, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other 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 formula for creating a VM, specifying an image base and other parameters along with {@link Response} on - * successful completion of {@link Mono}. + * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String name, FormulaInner formula, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (formula == null) { - return Mono.error(new IllegalArgumentException("Parameter formula is required and cannot be null.")); - } else { - formula.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + FormulaInner formula) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), formula, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, formula, + Context.NONE); } /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other 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 formula for creating a VM, specifying an image base and other - * parameters. + * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, FormulaInner> beginCreateOrUpdateAsync(String resourceGroupName, - String labName, String name, FormulaInner formula) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, formula); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - FormulaInner.class, FormulaInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + FormulaInner formula, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, formula, context); } /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other 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. @@ -584,18 +345,17 @@ private PollerFlux, FormulaInner> beginCreateOrUpdateAs */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, FormulaInner> beginCreateOrUpdateAsync(String resourceGroupName, - String labName, String name, FormulaInner formula, Context context) { - context = this.client.mergeContext(context); + String labName, String name, FormulaInner formula) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, formula, context); + = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, formula); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - FormulaInner.class, FormulaInner.class, context); + FormulaInner.class, FormulaInner.class, this.client.getContext()); } /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other parameters. @@ -608,13 +368,15 @@ private PollerFlux, FormulaInner> beginCreateOrUpdateAs @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, FormulaInner> beginCreateOrUpdate(String resourceGroupName, String labName, String name, FormulaInner formula) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, name, formula).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, labName, name, formula); + return this.client.getLroResult(response, FormulaInner.class, FormulaInner.class, + Context.NONE); } /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other parameters. @@ -628,13 +390,15 @@ public SyncPoller, FormulaInner> beginCreateOrUpdate(St @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, FormulaInner> beginCreateOrUpdate(String resourceGroupName, String labName, String name, FormulaInner formula, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, name, formula, context).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, labName, name, formula, context); + return this.client.getLroResult(response, FormulaInner.class, FormulaInner.class, + context); } /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other parameters. @@ -654,141 +418,144 @@ private Mono createOrUpdateAsync(String resourceGroupName, String /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other 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 formula for creating a VM, specifying an image base and other parameters on successful completion of - * {@link Mono}. + * @return a formula for creating a VM, specifying an image base and other parameters. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String name, - FormulaInner formula, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, name, formula, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public FormulaInner createOrUpdate(String resourceGroupName, String labName, String name, FormulaInner formula) { + return beginCreateOrUpdate(resourceGroupName, labName, name, formula).getFinalResult(); } /** * Create or replace an existing formula. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other 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 formula for creating a VM, specifying an image base and other parameters. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FormulaInner createOrUpdate(String resourceGroupName, String labName, String name, FormulaInner formula) { - return createOrUpdateAsync(resourceGroupName, labName, name, formula).block(); + public FormulaInner createOrUpdate(String resourceGroupName, String labName, String name, FormulaInner formula, + Context context) { + return beginCreateOrUpdate(resourceGroupName, labName, name, formula, context).getFinalResult(); } /** - * Create or replace an existing formula. This operation can take a while to complete. + * Allows modifying tags of formulas. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param formula A formula for creating a VM, specifying an image base and other 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 formula for creating a VM, specifying an image base and other parameters. + * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FormulaInner createOrUpdate(String resourceGroupName, String labName, String name, FormulaInner formula, - Context context) { - return createOrUpdateAsync(resourceGroupName, labName, name, formula, context).block(); + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, String name, + FormulaFragment formula) { + 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, labName, name, contentType, accept, formula, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete formula. + * Allows modifying tags of formulas. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. + * @param formula A formula for creating a VM, specifying an image base and other 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 Response} on successful completion of {@link Mono}. + * @return a formula for creating a VM, specifying an image base and other parameters on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private Mono updateAsync(String resourceGroupName, String labName, String name, + FormulaFragment formula) { + return updateWithResponseAsync(resourceGroupName, labName, name, formula) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of formulas. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the formula. + * @param formula A formula for creating a VM, specifying an image base and other 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 formula for creating a VM, specifying an image base and other parameters along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String labName, String name, + FormulaFragment formula, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, formula, context); + } + + /** + * Allows modifying tags of formulas. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the formula. + * @param formula A formula for creating a VM, specifying an image base and other 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 a formula for creating a VM, specifying an image base and other parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FormulaInner update(String resourceGroupName, String labName, String name, FormulaFragment formula) { + return updateWithResponse(resourceGroupName, labName, name, formula, Context.NONE).getValue(); } /** * Delete formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 labName, String name, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -804,7 +571,7 @@ private Mono deleteAsync(String resourceGroupName, String labName, String /** * Delete formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param context The context to associate with this operation. @@ -815,13 +582,14 @@ private Mono deleteAsync(String resourceGroupName, String labName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, labName, name, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Delete formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -834,151 +602,163 @@ public void delete(String resourceGroupName, String labName, String name) { } /** - * Allows modifying tags of formulas. All other properties will be ignored. + * List formulas in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other parameters. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response} on - * successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, String name, - FormulaFragment formula) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (formula == null) { - return Mono.error(new IllegalArgumentException("Parameter formula is required and cannot be null.")); - } else { - formula.validate(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String expand, String filter, Integer top, String orderby) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), formula, accept, context)) + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, 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())); } /** - * Allows modifying tags of formulas. All other properties will be ignored. + * List formulas in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other parameters. - * @param context The context to associate with this operation. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response} on - * successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, String name, - FormulaFragment formula, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (formula == null) { - return Mono.error(new IllegalArgumentException("Parameter formula is required and cannot be null.")); - } else { - formula.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), formula, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of formulas. All other properties will be ignored. + * List formulas in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other 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 a formula for creating a VM, specifying an image base and other parameters on successful completion of - * {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List formulas in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String name, - FormulaFragment formula) { - return updateWithResponseAsync(resourceGroupName, labName, name, formula) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of formulas. All other properties will be ignored. + * List formulas in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other parameters. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String name, - FormulaFragment formula, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, name, formula, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of formulas. All other properties will be ignored. + * List formulas in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other 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 a formula for creating a VM, specifying an image base and other parameters. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FormulaInner update(String resourceGroupName, String labName, String name, FormulaFragment formula) { - return updateWithResponse(resourceGroupName, labName, name, formula, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List formulas in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -993,13 +773,6 @@ public FormulaInner update(String resourceGroupName, String labName, String name */ @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(), @@ -1007,6 +780,23 @@ 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -1015,22 +805,13 @@ 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasImpl.java index 9af1a69e80a7..c777fc1aa412 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -27,28 +27,12 @@ public FormulasImpl(FormulasClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FormulaImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FormulaImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new FormulaImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FormulaImpl(inner.getValue(), this.manager())); } public Formula get(String resourceGroupName, String labName, String name) { @@ -68,6 +52,18 @@ public void delete(String resourceGroupName, String labName, String name) { this.serviceClient().delete(resourceGroupName, labName, name); } + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FormulaImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FormulaImpl(inner1, this.manager())); + } + public Formula getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImageImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImageImpl.java index c2517014bbb9..a22e44b7dfab 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImageImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImageImpl.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.devtestlabs.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.GalleryImageInner; import com.azure.resourcemanager.devtestlabs.models.GalleryImage; import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; @@ -34,10 +35,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -47,6 +44,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String author() { return this.innerModel().author(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesClientImpl.java index 9a0765e1393a..31cadb16a007 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.devtestlabs.fluent.GalleryImagesClient; import com.azure.resourcemanager.devtestlabs.fluent.models.GalleryImageInner; -import com.azure.resourcemanager.devtestlabs.models.GalleryImageList; +import com.azure.resourcemanager.devtestlabs.implementation.models.GalleryImageList; import reactor.core.publisher.Mono; /** @@ -42,51 +42,67 @@ public final class GalleryImagesClientImpl implements GalleryImagesClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of GalleryImagesClientImpl. * * @param client the instance of the service client containing this operation class. */ - GalleryImagesClientImpl(DevTestLabsClientImpl client) { + GalleryImagesClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(GalleryImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientGalleryImages to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientGalleryImages to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientGal") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientGalleryImages") public interface GalleryImagesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/galleryimages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/galleryimages") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @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); + @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 gallery images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. @@ -99,25 +115,9 @@ Mono> listNext(@PathParam(value = "nextLink", encoded @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, 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())); @@ -126,52 +126,9 @@ private Mono> listSinglePageAsync(String resour /** * List gallery images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, expand, - filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List gallery images in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. @@ -190,7 +147,7 @@ private PagedFlux listAsync(String resourceGroupName, String /** * List gallery images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -210,9 +167,34 @@ private PagedFlux listAsync(String resourceGroupName, String /** * List gallery images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List gallery images in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. @@ -220,20 +202,22 @@ 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 list operation as paginated response with {@link PagedFlux}. + * @return the response of a list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * List gallery images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -246,15 +230,16 @@ public PagedIterable list(String resourceGroupName, String la final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); } /** * List gallery images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. @@ -267,7 +252,9 @@ public PagedIterable list(String resourceGroupName, String la @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, context)); + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -282,13 +269,6 @@ public PagedIterable list(String resourceGroupName, String la */ @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(), @@ -296,6 +276,24 @@ 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -304,22 +302,13 @@ 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesImpl.java index 9e1ed3dd35b4..1830134c8b9f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GenerateUploadUriResponseImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GenerateUploadUriResponseImpl.java index 75c037adb733..e086d7ddf2cd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GenerateUploadUriResponseImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GenerateUploadUriResponseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesClientImpl.java index b05340003d8e..254c49b3a6fd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -29,15 +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.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient; import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.ScheduleList; import com.azure.resourcemanager.devtestlabs.models.RetargetScheduleProperties; import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; -import com.azure.resourcemanager.devtestlabs.models.ScheduleList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -54,104 +55,184 @@ public final class GlobalSchedulesClientImpl implements GlobalSchedulesClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of GlobalSchedulesClientImpl. * * @param client the instance of the service client containing this operation class. */ - GlobalSchedulesClientImpl(DevTestLabsClientImpl client) { + GlobalSchedulesClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(GlobalSchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientGlobalSchedules to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientGlobalSchedules to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientGlo") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientGlobalSchedules") public interface GlobalSchedulesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/schedules") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$expand") String expand, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$expand") String expand, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScheduleInner schedule, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ScheduleInner schedule, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScheduleInner schedule, Context context); - @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScheduleFragment schedule, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScheduleFragment schedule, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}") + @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("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}") @ExpectedResponses({ 200, 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("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ScheduleFragment schedule, - @HeaderParam("Accept") String accept, Context context); + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/schedules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/schedules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}/execute") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> execute(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> execute(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}/execute") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response executeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}/retarget") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> retarget(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") RetargetScheduleProperties retargetScheduleProperties, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}/retarget") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> retarget(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response retargetSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RetargetScheduleProperties retargetScheduleProperties, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") RetargetScheduleProperties retargetScheduleProperties, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @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 listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -159,862 +240,611 @@ Mono>> retarget(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @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> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List schedules in a subscription. + * Get schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String expand, String filter, Integer top, - String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + String expand) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), expand, - filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List schedules in a subscription. + * Get schedule. * - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String expand, String filter, Integer top, - String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), expand, filter, top, orderby, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List schedules in a subscription. - * - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand, String filter, Integer top, String orderby) { - return new PagedFlux<>(() -> listSinglePageAsync(expand, filter, top, orderby), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List schedules in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>(() -> listSinglePageAsync(expand, filter, top, orderby), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return getByResourceGroupWithResponseAsync(resourceGroupName, name, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List schedules in a subscription. + * Get schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. + * @return schedule along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand, String filter, Integer top, String orderby, + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, String expand, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(expand, filter, top, orderby, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List schedules in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(expand, filter, top, orderby)); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, expand, accept, context); } /** - * List schedules in a subscription. + * Get schedule. * - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String expand, String filter, Integer top, String orderby, - Context context) { - return new PagedIterable<>(listAsync(expand, filter, top, orderby, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ScheduleInner getByResourceGroup(String resourceGroupName, String name) { + final String expand = null; + return getByResourceGroupWithResponse(resourceGroupName, name, expand, Context.NONE).getValue(); } /** - * List schedules in a resource group. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String name, + ScheduleInner schedule) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, schedule, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List schedules in a resource group. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, expand, - filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List schedules in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String expand, String filter, - Integer top, String orderby) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List schedules in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + private Mono createOrUpdateAsync(String resourceGroupName, String name, ScheduleInner schedule) { + return createOrUpdateWithResponseAsync(resourceGroupName, name, schedule) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List schedules in a resource group. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. + * @return a schedule along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String expand, String filter, - Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String name, + ScheduleInner schedule, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, schedule, context); } /** - * List schedules in a resource group. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return a schedule. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, filter, top, orderby)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ScheduleInner createOrUpdate(String resourceGroupName, String name, ScheduleInner schedule) { + return createOrUpdateWithResponse(resourceGroupName, name, schedule, Context.NONE).getValue(); } /** - * List schedules in a resource group. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, - Integer top, String orderby, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, filter, top, orderby, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String name, + ScheduleFragment schedule) { + 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, name, contentType, accept, schedule, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response} on successful completion of {@link Mono}. + * @return a schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, - String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, expand, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono updateAsync(String resourceGroupName, String name, ScheduleFragment schedule) { + return updateWithResponseAsync(resourceGroupName, name, schedule) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response} on successful completion of {@link Mono}. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, - String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + public Response updateWithResponse(String resourceGroupName, String name, ScheduleFragment schedule, + Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - name, expand, this.client.getApiVersion(), accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, schedule, context); } /** - * Get schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule on successful completion of {@link Mono}. + * @return a schedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String name) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, name, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public ScheduleInner update(String resourceGroupName, String name, ScheduleFragment schedule) { + return updateWithResponse(resourceGroupName, name, schedule, Context.NONE).getValue(); } /** - * Get schedule. + * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String name, String expand, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, expand, context).block(); + private Mono> deleteWithResponseAsync(String resourceGroupName, String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get schedule. + * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner getByResourceGroup(String resourceGroupName, String name) { - final String expand = null; - return getByResourceGroupWithResponse(resourceGroupName, name, expand, Context.NONE).getValue(); + private Mono deleteAsync(String resourceGroupName, String name) { + return deleteWithResponseAsync(resourceGroupName, name).flatMap(ignored -> Mono.empty()); } /** - * Create or replace an existing schedule. + * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String name, - ScheduleInner schedule) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), schedule, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public Response deleteWithResponse(String resourceGroupName, String name, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, context); } /** - * Create or replace an existing schedule. + * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String name, - ScheduleInner schedule, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - name, this.client.getApiVersion(), schedule, accept, context); + public void delete(String resourceGroupName, String name) { + deleteWithResponse(resourceGroupName, name, Context.NONE); } /** - * Create or replace an existing schedule. + * List schedules in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String name, ScheduleInner schedule) { - return createOrUpdateWithResponseAsync(resourceGroupName, name, schedule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, expand, filter, top, orderby, 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())); } /** - * Create or replace an existing schedule. + * List schedules in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String name, - ScheduleInner schedule, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, name, schedule, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String expand, String filter, + Integer top, String orderby) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Create or replace an existing schedule. + * List schedules in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param schedule A schedule. + * @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 a schedule. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner createOrUpdate(String resourceGroupName, String name, ScheduleInner schedule) { - return createOrUpdateWithResponse(resourceGroupName, name, schedule, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Delete schedule. + * List schedules in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String expand, + String filter, Integer top, String orderby) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Delete schedule. + * List schedules in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String expand, + String filter, Integer top, String orderby, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, - this.client.getApiVersion(), accept, context); + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Delete schedule. + * List schedules in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @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 A {@link Mono} that completes when a successful response is received. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String name) { - return deleteWithResponseAsync(resourceGroupName, name).flatMap(ignored -> Mono.empty()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, expand, filter, top, orderby), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** - * Delete schedule. + * List schedules in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, name, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, + Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listByResourceGroupSinglePage(resourceGroupName, expand, filter, top, orderby, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** - * Delete schedule. + * List schedules in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String name) { - deleteWithResponse(resourceGroupName, name, Context.NONE); + private Mono> listSinglePageAsync(String expand, String filter, Integer top, + String orderby) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, filter, top, orderby, 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())); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String name, - ScheduleFragment schedule) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), schedule, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String expand, String filter, Integer top, String orderby) { + return new PagedFlux<>(() -> listSinglePageAsync(expand, filter, top, orderby), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String name, - ScheduleFragment schedule, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, - this.client.getApiVersion(), schedule, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>(() -> listSinglePageAsync(expand, filter, top, orderby), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String name, ScheduleFragment schedule) { - return updateWithResponseAsync(resourceGroupName, name, schedule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String name, ScheduleFragment schedule, + private PagedResponse listSinglePage(String expand, String filter, Integer top, String orderby, Context context) { - return updateWithResponseAsync(resourceGroupName, name, schedule, context).block(); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param schedule A schedule. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(() -> listSinglePage(expand, filter, top, orderby), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List schedules in a subscription. + * + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner update(String resourceGroupName, String name, ScheduleFragment schedule) { - return updateWithResponse(resourceGroupName, name, schedule, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String expand, String filter, Integer top, String orderby, + Context context) { + return new PagedIterable<>(() -> listSinglePage(expand, filter, top, orderby, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1022,105 +852,67 @@ public ScheduleInner update(String resourceGroupName, String name, ScheduleFragm */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> executeWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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>> executeWithResponseAsync(String resourceGroupName, String name, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, - this.client.getApiVersion(), accept, context); + private Response executeWithResponse(String resourceGroupName, String name) { + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, Context.NONE); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginExecuteAsync(String resourceGroupName, String name) { - Mono>> mono = executeWithResponseAsync(resourceGroupName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response executeWithResponse(String resourceGroupName, String name, Context context) { + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, context); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginExecuteAsync(String resourceGroupName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = executeWithResponseAsync(resourceGroupName, name, context); + private PollerFlux, Void> beginExecuteAsync(String resourceGroupName, String name) { + Mono>> mono = executeWithResponseAsync(resourceGroupName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1128,14 +920,15 @@ private PollerFlux, Void> beginExecuteAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute(String resourceGroupName, String name) { - return this.beginExecuteAsync(resourceGroupName, name).getSyncPoller(); + Response response = executeWithResponse(resourceGroupName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1144,14 +937,15 @@ public SyncPoller, Void> beginExecute(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute(String resourceGroupName, String name, Context context) { - return this.beginExecuteAsync(resourceGroupName, name, context).getSyncPoller(); + Response response = executeWithResponse(resourceGroupName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1165,39 +959,22 @@ private Mono executeAsync(String resourceGroupName, String name) { /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 executeAsync(String resourceGroupName, String name, Context context) { - return beginExecuteAsync(resourceGroupName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a schedule. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 execute(String resourceGroupName, String name) { - executeAsync(resourceGroupName, name).block(); + beginExecute(resourceGroupName, name).getFinalResult(); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1205,14 +982,14 @@ public void execute(String resourceGroupName, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void execute(String resourceGroupName, String name, Context context) { - executeAsync(resourceGroupName, name, context).block(); + beginExecute(resourceGroupName, name, context).getFinalResult(); } /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1222,103 +999,58 @@ public void execute(String resourceGroupName, String name, Context context) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> retargetWithResponseAsync(String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (retargetScheduleProperties == null) { - return Mono.error( - new IllegalArgumentException("Parameter retargetScheduleProperties is required and cannot be null.")); - } else { - retargetScheduleProperties.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.retarget(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), retargetScheduleProperties, accept, context)) + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.retarget(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, retargetScheduleProperties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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>> retargetWithResponseAsync(String resourceGroupName, String name, - RetargetScheduleProperties retargetScheduleProperties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (retargetScheduleProperties == null) { - return Mono.error( - new IllegalArgumentException("Parameter retargetScheduleProperties is required and cannot be null.")); - } else { - retargetScheduleProperties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.retarget(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, - this.client.getApiVersion(), retargetScheduleProperties, accept, context); + private Response retargetWithResponse(String resourceGroupName, String name, + RetargetScheduleProperties retargetScheduleProperties) { + final String contentType = "application/json"; + return service.retargetSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, retargetScheduleProperties, + Context.NONE); } /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginRetargetAsync(String resourceGroupName, String name, - RetargetScheduleProperties retargetScheduleProperties) { - Mono>> mono - = retargetWithResponseAsync(resourceGroupName, name, retargetScheduleProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response retargetWithResponse(String resourceGroupName, String name, + RetargetScheduleProperties retargetScheduleProperties, Context context) { + final String contentType = "application/json"; + return service.retargetSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, retargetScheduleProperties, context); } /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1326,19 +1058,18 @@ private PollerFlux, Void> beginRetargetAsync(String resourceGro */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRetargetAsync(String resourceGroupName, String name, - RetargetScheduleProperties retargetScheduleProperties, Context context) { - context = this.client.mergeContext(context); + RetargetScheduleProperties retargetScheduleProperties) { Mono>> mono - = retargetWithResponseAsync(resourceGroupName, name, retargetScheduleProperties, context); + = retargetWithResponseAsync(resourceGroupName, name, retargetScheduleProperties); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1348,14 +1079,15 @@ private PollerFlux, Void> beginRetargetAsync(String resourceGro @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRetarget(String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties) { - return this.beginRetargetAsync(resourceGroupName, name, retargetScheduleProperties).getSyncPoller(); + Response response = retargetWithResponse(resourceGroupName, name, retargetScheduleProperties); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1366,14 +1098,16 @@ public SyncPoller, Void> beginRetarget(String resourceGroupName @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRetarget(String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties, Context context) { - return this.beginRetargetAsync(resourceGroupName, name, retargetScheduleProperties, context).getSyncPoller(); + Response response + = retargetWithResponse(resourceGroupName, name, retargetScheduleProperties, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1390,27 +1124,8 @@ private Mono retargetAsync(String resourceGroupName, String name, /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 retargetAsync(String resourceGroupName, String name, - RetargetScheduleProperties retargetScheduleProperties, Context context) { - return beginRetargetAsync(resourceGroupName, name, retargetScheduleProperties, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a schedule's target resource Id. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1418,14 +1133,14 @@ private Mono retargetAsync(String resourceGroupName, String name, */ @ServiceMethod(returns = ReturnType.SINGLE) public void retarget(String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties) { - retargetAsync(resourceGroupName, name, retargetScheduleProperties).block(); + beginRetarget(resourceGroupName, name, retargetScheduleProperties).getFinalResult(); } /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1435,7 +1150,7 @@ public void retarget(String resourceGroupName, String name, RetargetScheduleProp @ServiceMethod(returns = ReturnType.SINGLE) public void retarget(String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties, Context context) { - retargetAsync(resourceGroupName, name, retargetScheduleProperties, context).block(); + beginRetarget(resourceGroupName, name, retargetScheduleProperties, context).getFinalResult(); } /** @@ -1449,23 +1164,34 @@ public void retarget(String resourceGroupName, String name, RetargetScheduleProp * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(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. * @@ -1474,23 +1200,15 @@ private Mono> listBySubscriptionNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1504,23 +1222,34 @@ private Mono> listBySubscriptionNextSinglePageAsync * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(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. * @@ -1529,23 +1258,14 @@ private Mono> listByResourceGroupNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesImpl.java index cdc030953b87..0a3e6d0b9514 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -28,38 +28,12 @@ public GlobalSchedulesImpl(GlobalSchedulesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); - } - - public PagedIterable list(String expand, String filter, Integer top, String orderby, Context context) { - PagedIterable inner = this.serviceClient().list(expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, - Integer top, String orderby, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); - } - public Response getByResourceGroupWithResponse(String resourceGroupName, String name, String expand, Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduleImpl(inner.getValue(), this.manager())); } public Schedule getByResourceGroup(String resourceGroupName, String name) { @@ -79,6 +53,28 @@ public void deleteByResourceGroup(String resourceGroupName, String name) { this.serviceClient().delete(resourceGroupName, name); } + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, + Integer top, String orderby, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + } + + public PagedIterable list(String expand, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = this.serviceClient().list(expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + } + public void execute(String resourceGroupName, String name) { this.serviceClient().execute(resourceGroupName, name); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabCostImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabCostImpl.java index 388eee704eec..de7a3edf9b35 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabCostImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabCostImpl.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.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.LabCostInner; import com.azure.resourcemanager.devtestlabs.models.LabCost; @@ -34,10 +35,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -47,6 +44,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public TargetCostProperties targetCost() { return this.innerModel().targetCost(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabImpl.java index 07fe1a88e189..f4ac19fbc7d2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabImpl.java @@ -1,12 +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.devtestlabs.implementation; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.LabInner; import com.azure.resourcemanager.devtestlabs.models.EnvironmentPermission; @@ -44,10 +45,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -57,6 +54,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String defaultStorageAccount() { return this.innerModel().defaultStorageAccount(); } @@ -361,6 +366,6 @@ public LabImpl withExtendedProperties(Map extendedProperties) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVhdImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVhdImpl.java index 0490dcedb8ca..9bef982b67e8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVhdImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVhdImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineImpl.java index 9eafede6855f..880b31b3fb19 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineImpl.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.devtestlabs.implementation; import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner; import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineInner; @@ -47,10 +48,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -60,6 +57,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String notes() { return this.innerModel().notes(); } @@ -567,6 +572,6 @@ public LabVirtualMachineImpl withScheduleParameters(List> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$expand") String expand, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$expand") String expand, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") LabInner lab, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") LabInner lab, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") LabInner lab, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}") - @ExpectedResponses({ 200, 202, 204 }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") LabFragment lab, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") LabFragment lab, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") LabFragment lab, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}") + @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("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}") + @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("name") String name, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/labs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/labs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/claimAnyVm") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> claimAnyVm(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/claimAnyVm") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> claimAnyVm(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response claimAnyVmSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/createEnvironment") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createEnvironment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/createEnvironment") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createEnvironment(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createEnvironmentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/exportResourceUsage") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> exportResourceUsage(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> exportResourceUsage(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") ExportResourceUsageParameters exportResourceUsageParameters, - @HeaderParam("Accept") String accept, Context context); + Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/exportResourceUsage") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response exportResourceUsageSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ExportResourceUsageParameters exportResourceUsageParameters, + Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/generateUploadUri") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> generateUploadUri(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> generateUploadUri(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GenerateUploadUriParameter generateUploadUriParameter, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GenerateUploadUriParameter generateUploadUriParameter, Context context); - @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/generateUploadUri") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response generateUploadUriSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GenerateUploadUriParameter generateUploadUriParameter, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/importVirtualMachine") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> importVirtualMachine(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> importVirtualMachine(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") ImportLabVirtualMachineRequest importLabVirtualMachineRequest, - @HeaderParam("Accept") String accept, Context context); + Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/importVirtualMachine") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response importVirtualMachineSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ImportLabVirtualMachineRequest importLabVirtualMachineRequest, + Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/listVhds") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVhds(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listVhds(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/listVhds") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + Response listVhdsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listVhdsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List labs in a subscription. - * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String expand, String filter, Integer top, - String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), expand, - filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List labs in a subscription. - * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String expand, String filter, Integer top, String orderby, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), expand, filter, top, orderby, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List labs in a subscription. - * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand, String filter, Integer top, String orderby) { - return new PagedFlux<>(() -> listSinglePageAsync(expand, filter, top, orderby), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List labs in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>(() -> listSinglePageAsync(expand, filter, top, orderby), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List labs in a subscription. - * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand, String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(expand, filter, top, orderby, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List labs in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(expand, filter, top, orderby)); - } - - /** - * List labs in a subscription. - * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>(listAsync(expand, filter, top, orderby, context)); - } - - /** - * List labs in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, String expand, - String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + Response listByResourceGroupNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List labs in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, String expand, - String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, expand, - filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List labs in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String expand, String filter, - Integer top, String orderby) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List labs in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List labs in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String expand, String filter, - Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List labs in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, filter, top, orderby)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVhdsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List labs in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, - Integer top, String orderby, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, filter, top, orderby, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listVhdsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Get lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -571,69 +363,17 @@ public PagedIterable listByResourceGroup(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get lab. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, - String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - name, expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get lab. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -650,7 +390,7 @@ private Mono getByResourceGroupAsync(String resourceGroupName, String /** * Get lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. * @param context The context to associate with this operation. @@ -662,13 +402,15 @@ private Mono getByResourceGroupAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String name, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, expand, context).block(); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, expand, accept, context); } /** * Get lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -684,7 +426,7 @@ public LabInner getByResourceGroup(String resourceGroupName, String name) { /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -695,100 +437,60 @@ public LabInner getByResourceGroup(String resourceGroupName, String name) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String name, LabInner lab) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (lab == null) { - return Mono.error(new IllegalArgumentException("Parameter lab is required and cannot be null.")); - } else { - lab.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), lab, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, lab, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab along with {@link Response} on successful completion of {@link Mono}. + * @return a lab along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String name, - LabInner lab, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (lab == null) { - return Mono.error(new IllegalArgumentException("Parameter lab is required and cannot be null.")); - } else { - lab.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String name, LabInner lab) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - name, this.client.getApiVersion(), lab, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, lab, Context.NONE); } /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 lab. + * @return a lab along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LabInner> beginCreateOrUpdateAsync(String resourceGroupName, String name, - LabInner lab) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, lab); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), LabInner.class, - LabInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String name, LabInner lab, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, lab, context); } /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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,17 +498,16 @@ private PollerFlux, LabInner> beginCreateOrUpdateAsync(Stri */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LabInner> beginCreateOrUpdateAsync(String resourceGroupName, String name, - LabInner lab, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, lab, context); + LabInner lab) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, lab); return this.client.getLroResult(mono, this.client.getHttpPipeline(), LabInner.class, - LabInner.class, context); + LabInner.class, this.client.getContext()); } /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -817,13 +518,14 @@ private PollerFlux, LabInner> beginCreateOrUpdateAsync(Stri @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LabInner> beginCreateOrUpdate(String resourceGroupName, String name, LabInner lab) { - return this.beginCreateOrUpdateAsync(resourceGroupName, name, lab).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, name, lab); + return this.client.getLroResult(response, LabInner.class, LabInner.class, Context.NONE); } /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. * @param context The context to associate with this operation. @@ -835,13 +537,14 @@ public SyncPoller, LabInner> beginCreateOrUpdate(String res @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LabInner> beginCreateOrUpdate(String resourceGroupName, String name, LabInner lab, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, name, lab, context).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, name, lab, context); + return this.client.getLroResult(response, LabInner.class, LabInner.class, context); } /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -858,58 +561,114 @@ private Mono createOrUpdateAsync(String resourceGroupName, String name /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab on successful completion of {@link Mono}. + * @return a lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String name, LabInner lab, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, name, lab, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public LabInner createOrUpdate(String resourceGroupName, String name, LabInner lab) { + return beginCreateOrUpdate(resourceGroupName, name, lab).getFinalResult(); } /** * Create or replace an existing lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LabInner createOrUpdate(String resourceGroupName, String name, LabInner lab) { - return createOrUpdateAsync(resourceGroupName, name, lab).block(); + public LabInner createOrUpdate(String resourceGroupName, String name, LabInner lab, Context context) { + return beginCreateOrUpdate(resourceGroupName, name, lab, context).getFinalResult(); + } + + /** + * Allows modifying tags of labs. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the lab. + * @param lab A lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a lab along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String name, LabFragment lab) { + 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, name, contentType, accept, lab, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows modifying tags of labs. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the lab. + * @param lab A lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a lab on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, LabFragment lab) { + return updateWithResponseAsync(resourceGroupName, name, lab).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of labs. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the lab. + * @param lab A lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a lab along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String name, LabFragment lab, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, lab, context); } /** - * Create or replace an existing lab. This operation can take a while to complete. + * Allows modifying tags of labs. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param lab A lab. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LabInner createOrUpdate(String resourceGroupName, String name, LabInner lab, Context context) { - return createOrUpdateAsync(resourceGroupName, name, lab, context).block(); + public LabInner update(String resourceGroupName, String name, LabFragment lab) { + return updateWithResponse(resourceGroupName, name, lab, Context.NONE).getValue(); } /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -918,104 +677,66 @@ public LabInner createOrUpdate(String resourceGroupName, String name, LabInner l */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 name, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, - this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, Context.NONE); } /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 name) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); - 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 name, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, context); } /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1024,13 +745,14 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { - return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1040,13 +762,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { - return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1061,183 +784,331 @@ private Mono deleteAsync(String resourceGroupName, String name) { /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 name, Context context) { - return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String name) { + beginDelete(resourceGroupName, name).getFinalResult(); } /** * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 name) { - deleteAsync(resourceGroupName, name).block(); + public void delete(String resourceGroupName, String name, Context context) { + beginDelete(resourceGroupName, name, context).getFinalResult(); } /** - * Delete lab. This operation can take a while to complete. + * List labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String name, Context context) { - deleteAsync(resourceGroupName, name, context).block(); + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, String expand, + String filter, Integer top, String orderby) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, expand, filter, top, orderby, 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())); } /** - * Allows modifying tags of labs. All other properties will be ignored. + * List labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param lab A lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String expand, String filter, + Integer top, String orderby) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List labs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List labs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String name, LabFragment lab) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (lab == null) { - return Mono.error(new IllegalArgumentException("Parameter lab is required and cannot be null.")); - } else { - lab.validate(); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String expand, + String filter, Integer top, String orderby) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), lab, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of labs. All other properties will be ignored. + * List labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param lab A lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String name, LabFragment lab, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (lab == null) { - return Mono.error(new IllegalArgumentException("Parameter lab is required and cannot be null.")); - } else { - lab.validate(); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String expand, + String filter, Integer top, String orderby, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, - this.client.getApiVersion(), lab, accept, context); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of labs. All other properties will be ignored. + * List labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param lab A lab. + * @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 a lab on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, expand, filter, top, orderby), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * List labs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, + Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listByResourceGroupSinglePage(resourceGroupName, expand, filter, top, orderby, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * List labs in a subscription. + * + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String name, LabFragment lab) { - return updateWithResponseAsync(resourceGroupName, name, lab).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono> listSinglePageAsync(String expand, String filter, Integer top, + String orderby) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, filter, top, orderby, 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())); } /** - * Allows modifying tags of labs. All other properties will be ignored. + * List labs in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param lab A lab. + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String expand, String filter, Integer top, String orderby) { + return new PagedFlux<>(() -> listSinglePageAsync(expand, filter, top, orderby), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List labs in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>(() -> listSinglePageAsync(expand, filter, top, orderby), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List labs in a subscription. + * + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List labs in a subscription. + * + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String name, LabFragment lab, + private PagedResponse listSinglePage(String expand, String filter, Integer top, String orderby, Context context) { - return updateWithResponseAsync(resourceGroupName, name, lab, context).block(); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of labs. All other properties will be ignored. + * List labs in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param lab A lab. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(() -> listSinglePage(expand, filter, top, orderby), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List labs in a subscription. + * + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabInner update(String resourceGroupName, String name, LabFragment lab) { - return updateWithResponse(resourceGroupName, name, lab, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String expand, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(() -> listSinglePage(expand, filter, top, orderby, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1246,104 +1117,66 @@ public LabInner update(String resourceGroupName, String name, LabFragment lab) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> claimAnyVmWithResponseAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.claimAnyVm(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.claimAnyVm(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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>> claimAnyVmWithResponseAsync(String resourceGroupName, String name, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.claimAnyVm(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, - this.client.getApiVersion(), accept, context); + private Response claimAnyVmWithResponse(String resourceGroupName, String name) { + return service.claimAnyVmSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, Context.NONE); } /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginClaimAnyVmAsync(String resourceGroupName, String name) { - Mono>> mono = claimAnyVmWithResponseAsync(resourceGroupName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response claimAnyVmWithResponse(String resourceGroupName, String name, Context context) { + return service.claimAnyVmSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, context); } /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginClaimAnyVmAsync(String resourceGroupName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = claimAnyVmWithResponseAsync(resourceGroupName, name, context); + private PollerFlux, Void> beginClaimAnyVmAsync(String resourceGroupName, String name) { + Mono>> mono = claimAnyVmWithResponseAsync(resourceGroupName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1352,13 +1185,14 @@ private PollerFlux, Void> beginClaimAnyVmAsync(String resourceG */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaimAnyVm(String resourceGroupName, String name) { - return this.beginClaimAnyVmAsync(resourceGroupName, name).getSyncPoller(); + Response response = claimAnyVmWithResponse(resourceGroupName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1368,13 +1202,14 @@ public SyncPoller, Void> beginClaimAnyVm(String resourceGroupNa */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaimAnyVm(String resourceGroupName, String name, Context context) { - return this.beginClaimAnyVmAsync(resourceGroupName, name, context).getSyncPoller(); + Response response = claimAnyVmWithResponse(resourceGroupName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1389,24 +1224,7 @@ private Mono claimAnyVmAsync(String resourceGroupName, String name) { /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 claimAnyVmAsync(String resourceGroupName, String name, Context context) { - return beginClaimAnyVmAsync(resourceGroupName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1414,13 +1232,13 @@ private Mono claimAnyVmAsync(String resourceGroupName, String name, Contex */ @ServiceMethod(returns = ReturnType.SINGLE) public void claimAnyVm(String resourceGroupName, String name) { - claimAnyVmAsync(resourceGroupName, name).block(); + beginClaimAnyVm(resourceGroupName, name).getFinalResult(); } /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1429,13 +1247,13 @@ public void claimAnyVm(String resourceGroupName, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void claimAnyVm(String resourceGroupName, String name, Context context) { - claimAnyVmAsync(resourceGroupName, name, context).block(); + beginClaimAnyVm(resourceGroupName, name, context).getFinalResult(); } /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1446,104 +1264,61 @@ public void claimAnyVm(String resourceGroupName, String name, Context context) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createEnvironmentWithResponseAsync(String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (labVirtualMachineCreationParameter == null) { - return Mono.error(new IllegalArgumentException( - "Parameter labVirtualMachineCreationParameter is required and cannot be null.")); - } else { - labVirtualMachineCreationParameter.validate(); - } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.createEnvironment(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, name, this.client.getApiVersion(), - labVirtualMachineCreationParameter, accept, context)) + .withContext(context -> service.createEnvironment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, + labVirtualMachineCreationParameter, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createEnvironmentWithResponseAsync(String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (labVirtualMachineCreationParameter == null) { - return Mono.error(new IllegalArgumentException( - "Parameter labVirtualMachineCreationParameter is required and cannot be null.")); - } else { - labVirtualMachineCreationParameter.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createEnvironment(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - name, this.client.getApiVersion(), labVirtualMachineCreationParameter, accept, context); + private Response createEnvironmentWithResponse(String resourceGroupName, String name, + LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { + final String contentType = "application/json"; + return service.createEnvironmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, labVirtualMachineCreationParameter, + Context.NONE); } /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a 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 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> beginCreateEnvironmentAsync(String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { - Mono>> mono - = createEnvironmentWithResponseAsync(resourceGroupName, name, labVirtualMachineCreationParameter); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createEnvironmentWithResponse(String resourceGroupName, String name, + LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Context context) { + final String contentType = "application/json"; + return service.createEnvironmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, labVirtualMachineCreationParameter, + context); } /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a 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. @@ -1551,18 +1326,17 @@ private PollerFlux, Void> beginCreateEnvironmentAsync(String re */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginCreateEnvironmentAsync(String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Context context) { - context = this.client.mergeContext(context); + LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { Mono>> mono - = createEnvironmentWithResponseAsync(resourceGroupName, name, labVirtualMachineCreationParameter, context); + = createEnvironmentWithResponseAsync(resourceGroupName, name, labVirtualMachineCreationParameter); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1573,14 +1347,15 @@ private PollerFlux, Void> beginCreateEnvironmentAsync(String re @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginCreateEnvironment(String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { - return this.beginCreateEnvironmentAsync(resourceGroupName, name, labVirtualMachineCreationParameter) - .getSyncPoller(); + Response response + = createEnvironmentWithResponse(resourceGroupName, name, labVirtualMachineCreationParameter); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a virtual machine. * @param context The context to associate with this operation. @@ -1592,14 +1367,15 @@ public SyncPoller, Void> beginCreateEnvironment(String resource @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginCreateEnvironment(String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Context context) { - return this.beginCreateEnvironmentAsync(resourceGroupName, name, labVirtualMachineCreationParameter, context) - .getSyncPoller(); + Response response + = createEnvironmentWithResponse(resourceGroupName, name, labVirtualMachineCreationParameter, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1617,26 +1393,7 @@ private Mono createEnvironmentAsync(String resourceGroupName, String name, /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param labVirtualMachineCreationParameter Properties for creating a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createEnvironmentAsync(String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Context context) { - return beginCreateEnvironmentAsync(resourceGroupName, name, labVirtualMachineCreationParameter, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create virtual machines in a lab. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1646,13 +1403,13 @@ private Mono createEnvironmentAsync(String resourceGroupName, String name, @ServiceMethod(returns = ReturnType.SINGLE) public void createEnvironment(String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { - createEnvironmentAsync(resourceGroupName, name, labVirtualMachineCreationParameter).block(); + beginCreateEnvironment(resourceGroupName, name, labVirtualMachineCreationParameter).getFinalResult(); } /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a virtual machine. * @param context The context to associate with this operation. @@ -1663,13 +1420,13 @@ public void createEnvironment(String resourceGroupName, String name, @ServiceMethod(returns = ReturnType.SINGLE) public void createEnvironment(String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Context context) { - createEnvironmentAsync(resourceGroupName, name, labVirtualMachineCreationParameter, context).block(); + beginCreateEnvironment(resourceGroupName, name, labVirtualMachineCreationParameter, context).getFinalResult(); } /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1680,104 +1437,61 @@ public void createEnvironment(String resourceGroupName, String name, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> exportResourceUsageWithResponseAsync(String resourceGroupName, String name, ExportResourceUsageParameters exportResourceUsageParameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (exportResourceUsageParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter exportResourceUsageParameters is required and cannot be null.")); - } else { - exportResourceUsageParameters.validate(); - } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.exportResourceUsage(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, name, this.client.getApiVersion(), - exportResourceUsageParameters, accept, context)) + .withContext(context -> service.exportResourceUsage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, exportResourceUsageParameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> exportResourceUsageWithResponseAsync(String resourceGroupName, String name, - ExportResourceUsageParameters exportResourceUsageParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (exportResourceUsageParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter exportResourceUsageParameters is required and cannot be null.")); - } else { - exportResourceUsageParameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.exportResourceUsage(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), exportResourceUsageParameters, accept, context); + private Response exportResourceUsageWithResponse(String resourceGroupName, String name, + ExportResourceUsageParameters exportResourceUsageParameters) { + final String contentType = "application/json"; + return service.exportResourceUsageSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, exportResourceUsageParameters, + Context.NONE); } /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginExportResourceUsageAsync(String resourceGroupName, String name, - ExportResourceUsageParameters exportResourceUsageParameters) { - Mono>> mono - = exportResourceUsageWithResponseAsync(resourceGroupName, name, exportResourceUsageParameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response exportResourceUsageWithResponse(String resourceGroupName, String name, + ExportResourceUsageParameters exportResourceUsageParameters, Context context) { + final String contentType = "application/json"; + return service.exportResourceUsageSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, exportResourceUsageParameters, + context); } /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1785,18 +1499,17 @@ private PollerFlux, Void> beginExportResourceUsageAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExportResourceUsageAsync(String resourceGroupName, String name, - ExportResourceUsageParameters exportResourceUsageParameters, Context context) { - context = this.client.mergeContext(context); + ExportResourceUsageParameters exportResourceUsageParameters) { Mono>> mono - = exportResourceUsageWithResponseAsync(resourceGroupName, name, exportResourceUsageParameters, context); + = exportResourceUsageWithResponseAsync(resourceGroupName, name, exportResourceUsageParameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1807,14 +1520,15 @@ private PollerFlux, Void> beginExportResourceUsageAsync(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExportResourceUsage(String resourceGroupName, String name, ExportResourceUsageParameters exportResourceUsageParameters) { - return this.beginExportResourceUsageAsync(resourceGroupName, name, exportResourceUsageParameters) - .getSyncPoller(); + Response response + = exportResourceUsageWithResponse(resourceGroupName, name, exportResourceUsageParameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. * @param context The context to associate with this operation. @@ -1826,14 +1540,15 @@ public SyncPoller, Void> beginExportResourceUsage(String resour @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExportResourceUsage(String resourceGroupName, String name, ExportResourceUsageParameters exportResourceUsageParameters, Context context) { - return this.beginExportResourceUsageAsync(resourceGroupName, name, exportResourceUsageParameters, context) - .getSyncPoller(); + Response response + = exportResourceUsageWithResponse(resourceGroupName, name, exportResourceUsageParameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1851,26 +1566,7 @@ private Mono exportResourceUsageAsync(String resourceGroupName, String nam /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param exportResourceUsageParameters The parameters of the export operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono exportResourceUsageAsync(String resourceGroupName, String name, - ExportResourceUsageParameters exportResourceUsageParameters, Context context) { - return beginExportResourceUsageAsync(resourceGroupName, name, exportResourceUsageParameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Exports the lab resource usage into a storage account This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1880,13 +1576,13 @@ private Mono exportResourceUsageAsync(String resourceGroupName, String nam @ServiceMethod(returns = ReturnType.SINGLE) public void exportResourceUsage(String resourceGroupName, String name, ExportResourceUsageParameters exportResourceUsageParameters) { - exportResourceUsageAsync(resourceGroupName, name, exportResourceUsageParameters).block(); + beginExportResourceUsage(resourceGroupName, name, exportResourceUsageParameters).getFinalResult(); } /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. * @param context The context to associate with this operation. @@ -1897,13 +1593,13 @@ public void exportResourceUsage(String resourceGroupName, String name, @ServiceMethod(returns = ReturnType.SINGLE) public void exportResourceUsage(String resourceGroupName, String name, ExportResourceUsageParameters exportResourceUsageParameters, Context context) { - exportResourceUsageAsync(resourceGroupName, name, exportResourceUsageParameters, context).block(); + beginExportResourceUsage(resourceGroupName, name, exportResourceUsageParameters, context).getFinalResult(); } /** * Generate a URI for uploading custom disk images to a Lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param generateUploadUriParameter Properties for generating an upload URI. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1915,82 +1611,19 @@ public void exportResourceUsage(String resourceGroupName, String name, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> generateUploadUriWithResponseAsync(String resourceGroupName, String name, GenerateUploadUriParameter generateUploadUriParameter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (generateUploadUriParameter == null) { - return Mono.error( - new IllegalArgumentException("Parameter generateUploadUriParameter is required and cannot be null.")); - } else { - generateUploadUriParameter.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.generateUploadUri(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), generateUploadUriParameter, accept, context)) + .withContext(context -> service.generateUploadUri(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, + generateUploadUriParameter, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Generate a URI for uploading custom disk images to a Lab. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param generateUploadUriParameter Properties for generating an upload URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response body for generating an upload URI along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generateUploadUriWithResponseAsync(String resourceGroupName, - String name, GenerateUploadUriParameter generateUploadUriParameter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (generateUploadUriParameter == null) { - return Mono.error( - new IllegalArgumentException("Parameter generateUploadUriParameter is required and cannot be null.")); - } else { - generateUploadUriParameter.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.generateUploadUri(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - name, this.client.getApiVersion(), generateUploadUriParameter, accept, context); - } - - /** - * Generate a URI for uploading custom disk images to a Lab. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param generateUploadUriParameter Properties for generating an upload URI. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2008,7 +1641,7 @@ private Mono generateUploadUriAsync(String resou /** * Generate a URI for uploading custom disk images to a Lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param generateUploadUriParameter Properties for generating an upload URI. * @param context The context to associate with this operation. @@ -2020,13 +1653,17 @@ private Mono generateUploadUriAsync(String resou @ServiceMethod(returns = ReturnType.SINGLE) public Response generateUploadUriWithResponse(String resourceGroupName, String name, GenerateUploadUriParameter generateUploadUriParameter, Context context) { - return generateUploadUriWithResponseAsync(resourceGroupName, name, generateUploadUriParameter, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.generateUploadUriSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, generateUploadUriParameter, + context); } /** * Generate a URI for uploading custom disk images to a Lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param generateUploadUriParameter Properties for generating an upload URI. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2044,7 +1681,7 @@ public GenerateUploadUriResponseInner generateUploadUri(String resourceGroupName /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. @@ -2056,107 +1693,64 @@ public GenerateUploadUriResponseInner generateUploadUri(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> importVirtualMachineWithResponseAsync(String resourceGroupName, String name, ImportLabVirtualMachineRequest importLabVirtualMachineRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (importLabVirtualMachineRequest == null) { - return Mono.error(new IllegalArgumentException( - "Parameter importLabVirtualMachineRequest is required and cannot be null.")); - } else { - importLabVirtualMachineRequest.validate(); - } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.importVirtualMachine(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, name, this.client.getApiVersion(), - importLabVirtualMachineRequest, accept, context)) + .withContext(context -> service.importVirtualMachine(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, importLabVirtualMachineRequest, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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>> importVirtualMachineWithResponseAsync(String resourceGroupName, - String name, ImportLabVirtualMachineRequest importLabVirtualMachineRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (importLabVirtualMachineRequest == null) { - return Mono.error(new IllegalArgumentException( - "Parameter importLabVirtualMachineRequest is required and cannot be null.")); - } else { - importLabVirtualMachineRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.importVirtualMachine(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), importLabVirtualMachineRequest, accept, context); + private Response importVirtualMachineWithResponse(String resourceGroupName, String name, + ImportLabVirtualMachineRequest importLabVirtualMachineRequest) { + final String contentType = "application/json"; + return service.importVirtualMachineSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, importLabVirtualMachineRequest, + Context.NONE); } /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginImportVirtualMachineAsync(String resourceGroupName, String name, - ImportLabVirtualMachineRequest importLabVirtualMachineRequest) { - Mono>> mono - = importVirtualMachineWithResponseAsync(resourceGroupName, name, importLabVirtualMachineRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response importVirtualMachineWithResponse(String resourceGroupName, String name, + ImportLabVirtualMachineRequest importLabVirtualMachineRequest, Context context) { + final String contentType = "application/json"; + return service.importVirtualMachineSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, importLabVirtualMachineRequest, + context); } /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2164,18 +1758,17 @@ private PollerFlux, Void> beginImportVirtualMachineAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginImportVirtualMachineAsync(String resourceGroupName, String name, - ImportLabVirtualMachineRequest importLabVirtualMachineRequest, Context context) { - context = this.client.mergeContext(context); + ImportLabVirtualMachineRequest importLabVirtualMachineRequest) { Mono>> mono - = importVirtualMachineWithResponseAsync(resourceGroupName, name, importLabVirtualMachineRequest, context); + = importVirtualMachineWithResponseAsync(resourceGroupName, name, importLabVirtualMachineRequest); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. @@ -2187,14 +1780,15 @@ private PollerFlux, Void> beginImportVirtualMachineAsync(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginImportVirtualMachine(String resourceGroupName, String name, ImportLabVirtualMachineRequest importLabVirtualMachineRequest) { - return this.beginImportVirtualMachineAsync(resourceGroupName, name, importLabVirtualMachineRequest) - .getSyncPoller(); + Response response + = importVirtualMachineWithResponse(resourceGroupName, name, importLabVirtualMachineRequest); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. @@ -2207,14 +1801,15 @@ public SyncPoller, Void> beginImportVirtualMachine(String resou @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginImportVirtualMachine(String resourceGroupName, String name, ImportLabVirtualMachineRequest importLabVirtualMachineRequest, Context context) { - return this.beginImportVirtualMachineAsync(resourceGroupName, name, importLabVirtualMachineRequest, context) - .getSyncPoller(); + Response response + = importVirtualMachineWithResponse(resourceGroupName, name, importLabVirtualMachineRequest, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. @@ -2233,27 +1828,7 @@ private Mono importVirtualMachineAsync(String resourceGroupName, String na /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a - * different lab into the current one. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 importVirtualMachineAsync(String resourceGroupName, String name, - ImportLabVirtualMachineRequest importLabVirtualMachineRequest, Context context) { - return beginImportVirtualMachineAsync(resourceGroupName, name, importLabVirtualMachineRequest, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Import a virtual machine into a different lab. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. @@ -2264,13 +1839,13 @@ private Mono importVirtualMachineAsync(String resourceGroupName, String na @ServiceMethod(returns = ReturnType.SINGLE) public void importVirtualMachine(String resourceGroupName, String name, ImportLabVirtualMachineRequest importLabVirtualMachineRequest) { - importVirtualMachineAsync(resourceGroupName, name, importLabVirtualMachineRequest).block(); + beginImportVirtualMachine(resourceGroupName, name, importLabVirtualMachineRequest).getFinalResult(); } /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. @@ -2282,13 +1857,13 @@ public void importVirtualMachine(String resourceGroupName, String name, @ServiceMethod(returns = ReturnType.SINGLE) public void importVirtualMachine(String resourceGroupName, String name, ImportLabVirtualMachineRequest importLabVirtualMachineRequest, Context context) { - importVirtualMachineAsync(resourceGroupName, name, importLabVirtualMachineRequest, context).block(); + beginImportVirtualMachine(resourceGroupName, name, importLabVirtualMachineRequest, context).getFinalResult(); } /** * List disk images available for custom image creation. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2298,25 +1873,10 @@ public void importVirtualMachine(String resourceGroupName, String name, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVhdsSinglePageAsync(String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listVhds(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listVhds(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, 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())); @@ -2325,79 +1885,62 @@ private Mono> listVhdsSinglePageAsync(String resource /** * List disk images available for custom image creation. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVhdsSinglePageAsync(String resourceGroupName, String name, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listVhds(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, - 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 listVhdsAsync(String resourceGroupName, String name) { + return new PagedFlux<>(() -> listVhdsSinglePageAsync(resourceGroupName, name), + nextLink -> listVhdsNextSinglePageAsync(nextLink)); } /** * List disk images available for custom image creation. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. + * @return the response of a list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listVhdsAsync(String resourceGroupName, String name) { - return new PagedFlux<>(() -> listVhdsSinglePageAsync(resourceGroupName, name), - nextLink -> listVhdsNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVhdsSinglePage(String resourceGroupName, String name) { + final String accept = "application/json"; + Response res = service.listVhdsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * List disk images available for custom image creation. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. + * @return the response of a list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listVhdsAsync(String resourceGroupName, String name, Context context) { - return new PagedFlux<>(() -> listVhdsSinglePageAsync(resourceGroupName, name, context), - nextLink -> listVhdsNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVhdsSinglePage(String resourceGroupName, String name, Context context) { + final String accept = "application/json"; + Response res = service.listVhdsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * List disk images available for custom image creation. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2406,13 +1949,14 @@ private PagedFlux listVhdsAsync(String resourceGroupName, String na */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listVhds(String resourceGroupName, String name) { - return new PagedIterable<>(listVhdsAsync(resourceGroupName, name)); + return new PagedIterable<>(() -> listVhdsSinglePage(resourceGroupName, name), + nextLink -> listVhdsNextSinglePage(nextLink)); } /** * List disk images available for custom image creation. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2422,7 +1966,8 @@ public PagedIterable listVhds(String resourceGroupName, String name */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listVhds(String resourceGroupName, String name, Context context) { - return new PagedIterable<>(listVhdsAsync(resourceGroupName, name, context)); + return new PagedIterable<>(() -> listVhdsSinglePage(resourceGroupName, name, context), + nextLink -> listVhdsNextSinglePage(nextLink, context)); } /** @@ -2436,23 +1981,34 @@ public PagedIterable listVhds(String resourceGroupName, String name * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(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. * @@ -2461,23 +2017,15 @@ private Mono> listBySubscriptionNextSinglePageAsync(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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2491,23 +2039,34 @@ private Mono> listBySubscriptionNextSinglePageAsync(Stri * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(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. * @@ -2516,23 +2075,15 @@ private Mono> listByResourceGroupNextSinglePageAsync(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 response of a list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2547,13 +2098,6 @@ private Mono> listByResourceGroupNextSinglePageAsync(Str */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVhdsNextSinglePageAsync(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.listVhdsNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -2562,6 +2106,23 @@ private Mono> listVhdsNextSinglePageAsync(String next .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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVhdsNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listVhdsNextSync(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. * @@ -2570,22 +2131,13 @@ private Mono> listVhdsNextSinglePageAsync(String next * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVhdsNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listVhdsNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listVhdsNext(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.listVhdsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsImpl.java index 2bb41e46c9e8..59116ca564c5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -34,38 +34,12 @@ public LabsImpl(LabsClient innerClient, com.azure.resourcemanager.devtestlabs.De this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); - } - - public PagedIterable list(String expand, String filter, Integer top, String orderby, Context context) { - PagedIterable inner = this.serviceClient().list(expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, Integer top, - String orderby, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); - } - public Response getByResourceGroupWithResponse(String resourceGroupName, String name, String expand, Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new LabImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LabImpl(inner.getValue(), this.manager())); } public Lab getByResourceGroup(String resourceGroupName, String name) { @@ -85,6 +59,28 @@ public void delete(String resourceGroupName, String name, Context context) { this.serviceClient().delete(resourceGroupName, name, context); } + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, Integer top, + String orderby, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); + } + + public PagedIterable list(String expand, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = this.serviceClient().list(expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); + } + public void claimAnyVm(String resourceGroupName, String name) { this.serviceClient().claimAnyVm(resourceGroupName, name); } @@ -117,12 +113,8 @@ public Response generateUploadUriWithResponse(String GenerateUploadUriParameter generateUploadUriParameter, Context context) { Response inner = this.serviceClient() .generateUploadUriWithResponse(resourceGroupName, name, generateUploadUriParameter, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GenerateUploadUriResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GenerateUploadUriResponseImpl(inner.getValue(), this.manager())); } public GenerateUploadUriResponse generateUploadUri(String resourceGroupName, String name, diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelImpl.java index 664453ff5aea..769ca0c2840e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelImpl.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.devtestlabs.implementation; import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.NotificationChannelInner; import com.azure.resourcemanager.devtestlabs.models.Event; @@ -35,10 +36,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -48,6 +45,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String webhookUrl() { return this.innerModel().webhookUrl(); } @@ -244,6 +249,6 @@ public NotificationChannelImpl withEvents(List events) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsClientImpl.java index e19b7f6ea782..272ea1f60a13 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -32,8 +32,8 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient; import com.azure.resourcemanager.devtestlabs.fluent.models.NotificationChannelInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.NotificationChannelList; import com.azure.resourcemanager.devtestlabs.models.NotificationChannelFragment; -import com.azure.resourcemanager.devtestlabs.models.NotificationChannelList; import com.azure.resourcemanager.devtestlabs.models.NotifyParameters; import reactor.core.publisher.Mono; @@ -49,291 +49,163 @@ public final class NotificationChannelsClientImpl implements NotificationChannel /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of NotificationChannelsClientImpl. * * @param client the instance of the service client containing this operation class. */ - NotificationChannelsClientImpl(DevTestLabsClientImpl client) { + NotificationChannelsClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(NotificationChannelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientNotificationChannels to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientNotificationChannels to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientNot") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientNotificationChannels") public interface NotificationChannelsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") NotificationChannelInner notificationChannel, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") NotificationChannelInner notificationChannel, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}") + @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("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") NotificationChannelInner notificationChannel, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") NotificationChannelFragment notificationChannel, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") NotificationChannelFragment notificationChannel, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}") + @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("labName") String labName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}") @ExpectedResponses({ 200, 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("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") NotificationChannelFragment notificationChannel, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}/notify") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> notify(@HostParam("$host") String endpoint, + Mono> notify(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") NotifyParameters notifyParameters, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}/notify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response notifySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") NotifyParameters notifyParameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") NotifyParameters notifyParameters, 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); - } - - /** - * List notification channels in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List notification channels in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, expand, - filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List notification channels in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List notification channels in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List notification channels in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List notification channels in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); - } - - /** - * List notification channels in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, 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); } /** * Get notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. @@ -345,75 +217,17 @@ public PagedIterable list(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get notification channel. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the notification channel. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return notification channel along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get notification channel. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -431,7 +245,7 @@ private Mono getAsync(String resourceGroupName, String /** * Get notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. @@ -444,13 +258,15 @@ private Mono getAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, name, expand, accept, context); } /** * Get notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -467,7 +283,7 @@ public NotificationChannelInner get(String resourceGroupName, String labName, St /** * Create or replace an existing notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notificationChannel A notification. @@ -479,87 +295,19 @@ public NotificationChannelInner get(String resourceGroupName, String labName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, String name, NotificationChannelInner notificationChannel) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (notificationChannel == null) { - return Mono - .error(new IllegalArgumentException("Parameter notificationChannel is required and cannot be null.")); - } else { - notificationChannel.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), notificationChannel, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, + notificationChannel, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing notification channel. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the notification channel. - * @param notificationChannel A notification. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String labName, String name, NotificationChannelInner notificationChannel, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (notificationChannel == null) { - return Mono - .error(new IllegalArgumentException("Parameter notificationChannel is required and cannot be null.")); - } else { - notificationChannel.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), notificationChannel, accept, context); - } - - /** - * Create or replace an existing notification channel. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notificationChannel A notification. @@ -578,7 +326,7 @@ private Mono createOrUpdateAsync(String resourceGroupN /** * Create or replace an existing notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notificationChannel A notification. @@ -591,13 +339,17 @@ private Mono createOrUpdateAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, NotificationChannelInner notificationChannel, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, name, notificationChannel, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, notificationChannel, + context); } /** * Create or replace an existing notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notificationChannel A notification. @@ -614,86 +366,112 @@ public NotificationChannelInner createOrUpdate(String resourceGroupName, String } /** - * Delete notification channel. + * Allows modifying tags of notification channels. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. + * @param notificationChannel A notification. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 a notification along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, + String name, NotificationChannelFragment notificationChannel) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, + notificationChannel, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete notification channel. + * Allows modifying tags of notification channels. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the notification channel. + * @param notificationChannel A notification. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a notification on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, String name, + NotificationChannelFragment notificationChannel) { + return updateWithResponseAsync(resourceGroupName, labName, name, notificationChannel) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of notification channels. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. + * @param notificationChannel A notification. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 a notification along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + public Response updateWithResponse(String resourceGroupName, String labName, String name, + NotificationChannelFragment notificationChannel, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, notificationChannel, + context); + } + + /** + * Allows modifying tags of notification channels. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the notification channel. + * @param notificationChannel A notification. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NotificationChannelInner update(String resourceGroupName, String labName, String name, + NotificationChannelFragment notificationChannel) { + return updateWithResponse(resourceGroupName, labName, name, notificationChannel, Context.NONE).getValue(); } /** * Delete notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the notification channel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 labName, String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete notification channel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -709,7 +487,7 @@ private Mono deleteAsync(String resourceGroupName, String labName, String /** * Delete notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param context The context to associate with this operation. @@ -720,13 +498,14 @@ private Mono deleteAsync(String resourceGroupName, String labName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, labName, name, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Delete notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -739,207 +518,172 @@ public void delete(String resourceGroupName, String labName, String name) { } /** - * Allows modifying tags of notification channels. All other properties will be ignored. + * List notification channels in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the notification channel. - * @param notificationChannel A notification. + * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String name, NotificationChannelFragment notificationChannel) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (notificationChannel == null) { - return Mono - .error(new IllegalArgumentException("Parameter notificationChannel is required and cannot be null.")); - } else { - notificationChannel.validate(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String expand, String filter, Integer top, String orderby) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), notificationChannel, accept, context)) + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, 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())); } /** - * Allows modifying tags of notification channels. All other properties will be ignored. + * List notification channels in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the notification channel. - * @param notificationChannel A notification. - * @param context The context to associate with this operation. + * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String name, NotificationChannelFragment notificationChannel, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (notificationChannel == null) { - return Mono - .error(new IllegalArgumentException("Parameter notificationChannel is required and cannot be null.")); - } else { - notificationChannel.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), notificationChannel, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of notification channels. All other properties will be ignored. + * List notification channels in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the notification channel. - * @param notificationChannel A notification. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List notification channels in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String name, - NotificationChannelFragment notificationChannel) { - return updateWithResponseAsync(resourceGroupName, labName, name, notificationChannel) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, + String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of notification channels. All other properties will be ignored. + * List notification channels in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the notification channel. - * @param notificationChannel A notification. + * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String name, - NotificationChannelFragment notificationChannel, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, name, notificationChannel, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, + String expand, String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of notification channels. All other properties will be ignored. + * List notification channels in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the notification channel. - * @param notificationChannel A notification. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NotificationChannelInner update(String resourceGroupName, String labName, String name, - NotificationChannelFragment notificationChannel) { - return updateWithResponse(resourceGroupName, labName, name, notificationChannel, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); } /** - * Send notification to provided channel. + * List notification channels in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the notification channel. - * @param notifyParameters Properties for generating a Notification. + * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> notifyWithResponseAsync(String resourceGroupName, String labName, String name, - NotifyParameters notifyParameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (notifyParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter notifyParameters is required and cannot be null.")); - } else { - notifyParameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.notify(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), notifyParameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** * Send notification to provided channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notifyParameters Properties for generating a Notification. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -947,41 +691,17 @@ private Mono> notifyWithResponseAsync(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> notifyWithResponseAsync(String resourceGroupName, String labName, String name, - NotifyParameters notifyParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (notifyParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter notifyParameters is required and cannot be null.")); - } else { - notifyParameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.notify(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), notifyParameters, accept, context); + NotifyParameters notifyParameters) { + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.notify(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, notifyParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Send notification to provided channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notifyParameters Properties for generating a Notification. @@ -1000,7 +720,7 @@ private Mono notifyAsync(String resourceGroupName, String labName, String /** * Send notification to provided channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notifyParameters Properties for generating a Notification. @@ -1013,13 +733,15 @@ private Mono notifyAsync(String resourceGroupName, String labName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response notifyWithResponse(String resourceGroupName, String labName, String name, NotifyParameters notifyParameters, Context context) { - return notifyWithResponseAsync(resourceGroupName, labName, name, notifyParameters, context).block(); + final String contentType = "application/json"; + return service.notifySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, notifyParameters, context); } /** * Send notification to provided channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notifyParameters Properties for generating a Notification. @@ -1044,13 +766,6 @@ public void notify(String resourceGroupName, String labName, String name, Notify */ @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(), @@ -1058,6 +773,24 @@ private Mono> listNextSinglePageAsync(St .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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -1066,22 +799,14 @@ private Mono> listNextSinglePageAsync(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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsImpl.java index ff70a351d5b7..854498f4c395 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -28,28 +28,12 @@ public NotificationChannelsImpl(NotificationChannelsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new NotificationChannelImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new NotificationChannelImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new NotificationChannelImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NotificationChannelImpl(inner.getValue(), this.manager())); } public NotificationChannel get(String resourceGroupName, String labName, String name) { @@ -69,6 +53,18 @@ public void delete(String resourceGroupName, String labName, String name) { this.serviceClient().delete(resourceGroupName, labName, name); } + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NotificationChannelImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NotificationChannelImpl(inner1, this.manager())); + } + public Response notifyWithResponse(String resourceGroupName, String labName, String name, NotifyParameters notifyParameters, Context context) { return this.serviceClient().notifyWithResponse(resourceGroupName, labName, name, notifyParameters, context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationImpl.java new file mode 100644 index 000000000000..ce3c29d3103f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationImpl.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.devtestlabs.implementation; + +import com.azure.resourcemanager.devtestlabs.fluent.models.OperationInner; +import com.azure.resourcemanager.devtestlabs.models.ActionType; +import com.azure.resourcemanager.devtestlabs.models.Operation; +import com.azure.resourcemanager.devtestlabs.models.OperationDisplay; +import com.azure.resourcemanager.devtestlabs.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationMetadataImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationMetadataImpl.java deleted file mode 100644 index f2fc01e82245..000000000000 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationMetadataImpl.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.devtestlabs.implementation; - -import com.azure.resourcemanager.devtestlabs.fluent.models.OperationMetadataInner; -import com.azure.resourcemanager.devtestlabs.models.OperationMetadata; -import com.azure.resourcemanager.devtestlabs.models.OperationMetadataDisplay; - -public final class OperationMetadataImpl implements OperationMetadata { - private OperationMetadataInner innerObject; - - private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; - - OperationMetadataImpl(OperationMetadataInner innerObject, - com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public OperationMetadataDisplay display() { - return this.innerModel().display(); - } - - public OperationMetadataInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationResultImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationResultImpl.java index cbb4753417ef..bcbd6d77a595 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationResultImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationsClientImpl.java index 06b5b0bb3655..e656db569b7f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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.devtestlabs.implementation; @@ -37,33 +37,42 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(DevTestLabsClientImpl client) { + OperationsClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientOperations to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientOperations to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientOpe") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/locations/{locationName}/operations/{name}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @PathParam("locationName") String locationName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/locations/{locationName}/operations/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); } @@ -79,61 +88,13 @@ Mono> get(@HostParam("$host") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String locationName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - locationName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get operation. - * - * @param locationName The name of the location. - * @param name The name of the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String name, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), locationName, name, - this.client.getApiVersion(), accept, context); - } - /** * Get operation. * @@ -162,7 +123,9 @@ private Mono getAsync(String locationName, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String locationName, String name, Context context) { - return getWithResponseAsync(locationName, name, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + locationName, name, accept, context); } /** diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationsImpl.java index d43c09992f95..03f7c16f92c5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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.devtestlabs.implementation; @@ -28,12 +28,8 @@ public OperationsImpl(OperationsClient innerClient, public Response getWithResponse(String locationName, String name, Context context) { Response inner = this.serviceClient().getWithResponse(locationName, name, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationResultImpl(inner.getValue(), this.manager())); } public OperationResult get(String locationName, String name) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesClientImpl.java index 9670594f2807..8efa4a1ab1dc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -31,8 +31,8 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.devtestlabs.fluent.PoliciesClient; import com.azure.resourcemanager.devtestlabs.fluent.models.PolicyInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.PolicyList; import com.azure.resourcemanager.devtestlabs.models.PolicyFragment; -import com.azure.resourcemanager.devtestlabs.models.PolicyList; import reactor.core.publisher.Mono; /** @@ -47,301 +47,147 @@ public final class PoliciesClientImpl implements PoliciesClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of PoliciesClientImpl. * * @param client the instance of the service client containing this operation class. */ - PoliciesClientImpl(DevTestLabsClientImpl client) { + PoliciesClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(PoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientPolicies to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for DevTestLabsManagementClientPolicies to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientPol") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientPolicies") public interface PoliciesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("policySetName") String policySetName, @QueryParam("$expand") String expand, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("policySetName") String policySetName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("policySetName") String policySetName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("policySetName") String policySetName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PolicyInner policy, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyInner policy, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}") - @ExpectedResponses({ 200, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("policySetName") String policySetName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyInner policy, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("policySetName") String policySetName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PolicyFragment policy, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyFragment policy, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List policies in a given policy set. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String policySetName, String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (policySetName == null) { - return Mono.error(new IllegalArgumentException("Parameter policySetName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, policySetName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("policySetName") String policySetName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyFragment policy, Context context); - /** - * List policies in a given policy set. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String policySetName, String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (policySetName == null) { - return Mono.error(new IllegalArgumentException("Parameter policySetName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, policySetName, - expand, filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}") + @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("labName") String labName, + @PathParam("policySetName") String policySetName, @PathParam("name") String name, Context context); - /** - * List policies in a given policy set. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String policySetName, - String expand, String filter, Integer top, String orderby) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, policySetName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("policySetName") String policySetName, @PathParam("name") String name, Context context); - /** - * List policies in a given policy set. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String policySetName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, policySetName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies") + @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("labName") String labName, + @PathParam("policySetName") String policySetName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List policies in a given policy set. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String policySetName, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, policySetName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies") + @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("labName") String labName, + @PathParam("policySetName") String policySetName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List policies in a given policy set. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String policySetName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, policySetName, expand, filter, top, orderby)); - } + @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); - /** - * List policies in a given policy set. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String policySetName, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, policySetName, expand, filter, top, orderby, 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); } /** * Get policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -351,85 +197,19 @@ public PagedIterable list(String resourceGroupName, String labName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, String policySetName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (policySetName == null) { - return Mono.error(new IllegalArgumentException("Parameter policySetName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, policySetName, name, expand, this.client.getApiVersion(), accept, context)) + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, policySetName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String policySetName, String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (policySetName == null) { - return Mono.error(new IllegalArgumentException("Parameter policySetName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - policySetName, name, expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get policy. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -445,10 +225,10 @@ private Mono getAsync(String resourceGroupName, String labName, Str /** * Get policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -459,16 +239,18 @@ private Mono getAsync(String resourceGroupName, String labName, Str @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String labName, String policySetName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, policySetName, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, policySetName, name, expand, accept, context); } /** * Get policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -483,10 +265,10 @@ public PolicyInner get(String resourceGroupName, String labName, String policySe /** * Create or replace an existing policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @param policy A Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -496,95 +278,22 @@ public PolicyInner get(String resourceGroupName, String labName, String policySe @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, String policySetName, String name, PolicyInner policy) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (policySetName == null) { - return Mono.error(new IllegalArgumentException("Parameter policySetName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (policy == null) { - return Mono.error(new IllegalArgumentException("Parameter policy is required and cannot be null.")); - } else { - policy.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, policySetName, name, this.client.getApiVersion(), policy, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, policySetName, name, contentType, accept, + policy, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. - * @param policy A 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 Policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String policySetName, String name, PolicyInner policy, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (policySetName == null) { - return Mono.error(new IllegalArgumentException("Parameter policySetName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (policy == null) { - return Mono.error(new IllegalArgumentException("Parameter policy is required and cannot be null.")); - } else { - policy.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, policySetName, name, this.client.getApiVersion(), policy, accept, context); - } - - /** - * Create or replace an existing policy. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @param policy A Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -601,10 +310,10 @@ private Mono createOrUpdateAsync(String resourceGroupName, String l /** * Create or replace an existing policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @param policy A Policy. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -615,17 +324,20 @@ private Mono createOrUpdateAsync(String resourceGroupName, String l @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String labName, String policySetName, String name, PolicyInner policy, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, policySetName, name, policy, context) - .block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, policySetName, name, contentType, accept, + policy, context); } /** * Create or replace an existing policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @param policy A Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -640,98 +352,121 @@ public PolicyInner createOrUpdate(String resourceGroupName, String labName, Stri } /** - * Delete policy. + * Allows modifying tags of policies. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. + * @param policy A Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a Policy along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String policySetName, - String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (policySetName == null) { - return Mono.error(new IllegalArgumentException("Parameter policySetName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, + String policySetName, String name, PolicyFragment policy) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, policySetName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, policySetName, name, contentType, accept, + policy, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete policy. + * Allows modifying tags of policies. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. + * @param policy A Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, String policySetName, String name, + PolicyFragment policy) { + return updateWithResponseAsync(resourceGroupName, labName, policySetName, name, policy) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of policies. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. + * @param policy A 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 Policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String labName, String policySetName, + String name, PolicyFragment policy, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, policySetName, name, contentType, accept, + policy, context); + } + + /** + * Allows modifying tags of policies. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. + * @param policy A Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyInner update(String resourceGroupName, String labName, String policySetName, String name, + PolicyFragment policy) { + return updateWithResponse(resourceGroupName, labName, policySetName, name, policy, Context.NONE).getValue(); + } + + /** + * Delete policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String policySetName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (policySetName == null) { - return Mono.error(new IllegalArgumentException("Parameter policySetName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - policySetName, name, this.client.getApiVersion(), accept, context); + String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, policySetName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -746,10 +481,10 @@ private Mono deleteAsync(String resourceGroupName, String labName, String /** * Delete policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the 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. @@ -759,16 +494,17 @@ private Mono deleteAsync(String resourceGroupName, String labName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String labName, String policySetName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, labName, policySetName, name, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, policySetName, name, context); } /** * Delete policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -779,160 +515,176 @@ public void delete(String resourceGroupName, String labName, String policySetNam } /** - * Allows modifying tags of policies. All other properties will be ignored. + * List policies in a given policy set. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. - * @param policy A Policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Policy along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String policySetName, String name, PolicyFragment policy) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (policySetName == null) { - return Mono.error(new IllegalArgumentException("Parameter policySetName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (policy == null) { - return Mono.error(new IllegalArgumentException("Parameter policy is required and cannot be null.")); - } else { - policy.validate(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String policySetName, String expand, String filter, Integer top, String orderby) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, policySetName, name, this.client.getApiVersion(), policy, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, policySetName, expand, filter, top, + orderby, 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())); } /** - * Allows modifying tags of policies. All other properties will be ignored. + * List policies in a given policy set. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. - * @param policy A Policy. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Policy along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String policySetName, String name, PolicyFragment policy, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (policySetName == null) { - return Mono.error(new IllegalArgumentException("Parameter policySetName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (policy == null) { - return Mono.error(new IllegalArgumentException("Parameter policy is required and cannot be null.")); - } else { - policy.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - policySetName, name, this.client.getApiVersion(), policy, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String policySetName, + String expand, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, policySetName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of policies. All other properties will be ignored. + * List policies in a given policy set. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. - * @param policy A Policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Policy on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String policySetName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, policySetName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List policies in a given policy set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String policySetName, String name, - PolicyFragment policy) { - return updateWithResponseAsync(resourceGroupName, labName, policySetName, name, policy) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String policySetName, + String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, policySetName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of policies. All other properties will be ignored. + * List policies in a given policy set. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. - * @param policy A Policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Policy along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String policySetName, - String name, PolicyFragment policy, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, policySetName, name, policy, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String policySetName, + String expand, String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, policySetName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of policies. All other properties will be ignored. + * List policies in a given policy set. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. - * @param policy A Policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Policy. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyInner update(String resourceGroupName, String labName, String policySetName, String name, - PolicyFragment policy) { - return updateWithResponse(resourceGroupName, labName, policySetName, name, policy, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String policySetName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, policySetName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List policies in a given policy set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String policySetName, + String expand, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, policySetName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -947,13 +699,6 @@ public PolicyInner update(String resourceGroupName, String labName, String polic */ @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(), @@ -961,6 +706,23 @@ 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -969,22 +731,13 @@ 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesImpl.java index 8c7f8a9d1855..de55cd80faec 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -27,28 +27,12 @@ public PoliciesImpl(PoliciesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName, String policySetName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, policySetName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PolicyImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String policySetName, String expand, - String filter, Integer top, String orderby, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, labName, policySetName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PolicyImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String labName, String policySetName, String name, String expand, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, policySetName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PolicyImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PolicyImpl(inner.getValue(), this.manager())); } public Policy get(String resourceGroupName, String labName, String policySetName, String name) { @@ -69,6 +53,18 @@ public void delete(String resourceGroupName, String labName, String policySetNam this.serviceClient().delete(resourceGroupName, labName, policySetName, name); } + public PagedIterable list(String resourceGroupName, String labName, String policySetName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, policySetName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String policySetName, String expand, + String filter, Integer top, String orderby, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, labName, policySetName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PolicyImpl(inner1, this.manager())); + } + public Policy getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicyImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicyImpl.java index c34cb9ec9eb6..37b6b6b6d26e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicyImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicyImpl.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.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.PolicyInner; import com.azure.resourcemanager.devtestlabs.models.Policy; @@ -33,10 +34,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -46,6 +43,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String description() { return this.innerModel().description(); } @@ -241,6 +246,6 @@ public PolicyImpl withEvaluatorType(PolicyEvaluatorType evaluatorType) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsClientImpl.java index 273ac96c4e57..b8845f8675d4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsClientImpl.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.devtestlabs.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; 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; @@ -39,44 +38,53 @@ public final class PolicySetsClientImpl implements PolicySetsClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of PolicySetsClientImpl. * * @param client the instance of the service client containing this operation class. */ - PolicySetsClientImpl(DevTestLabsClientImpl client) { + PolicySetsClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(PolicySetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientPolicySets to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientPolicySets to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientPol") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientPolicySets") public interface PolicySetsService { - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{name}/evaluatePolicies") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> evaluatePolicies(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> evaluatePolicies(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") EvaluatePoliciesRequest evaluatePoliciesRequest, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") EvaluatePoliciesRequest evaluatePoliciesRequest, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{name}/evaluatePolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response evaluatePoliciesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") EvaluatePoliciesRequest evaluatePoliciesRequest, Context context); } /** * Evaluates lab policy. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the policy set. + * @param name The name of the PolicySet. * @param evaluatePoliciesRequest Request body for evaluating a policy set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -87,91 +95,21 @@ Mono> evaluatePolicies(@HostParam("$host @ServiceMethod(returns = ReturnType.SINGLE) private Mono> evaluatePoliciesWithResponseAsync(String resourceGroupName, String labName, String name, EvaluatePoliciesRequest evaluatePoliciesRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (evaluatePoliciesRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter evaluatePoliciesRequest is required and cannot be null.")); - } else { - evaluatePoliciesRequest.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.evaluatePolicies(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), evaluatePoliciesRequest, accept, - context)) + .withContext(context -> service.evaluatePolicies(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, + evaluatePoliciesRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Evaluates lab policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the policy set. - * @param evaluatePoliciesRequest Request body for evaluating a policy set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response body for evaluating a policy set along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> evaluatePoliciesWithResponseAsync(String resourceGroupName, - String labName, String name, EvaluatePoliciesRequest evaluatePoliciesRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (evaluatePoliciesRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter evaluatePoliciesRequest is required and cannot be null.")); - } else { - evaluatePoliciesRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.evaluatePolicies(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), evaluatePoliciesRequest, accept, context); - } - - /** - * Evaluates lab policy. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the policy set. + * @param name The name of the PolicySet. * @param evaluatePoliciesRequest Request body for evaluating a policy set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -188,9 +126,9 @@ private Mono evaluatePoliciesAsync(String resourc /** * Evaluates lab policy. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the policy set. + * @param name The name of the PolicySet. * @param evaluatePoliciesRequest Request body for evaluating a policy set. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -201,16 +139,19 @@ private Mono evaluatePoliciesAsync(String resourc @ServiceMethod(returns = ReturnType.SINGLE) public Response evaluatePoliciesWithResponse(String resourceGroupName, String labName, String name, EvaluatePoliciesRequest evaluatePoliciesRequest, Context context) { - return evaluatePoliciesWithResponseAsync(resourceGroupName, labName, name, evaluatePoliciesRequest, context) - .block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.evaluatePoliciesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, + evaluatePoliciesRequest, context); } /** * Evaluates lab policy. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the policy set. + * @param name The name of the PolicySet. * @param evaluatePoliciesRequest Request body for evaluating a policy set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsImpl.java index e0ede2aaea8f..05f07a61281b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -31,12 +31,8 @@ public Response evaluatePoliciesWithResponse(String re String name, EvaluatePoliciesRequest evaluatePoliciesRequest, Context context) { Response inner = this.serviceClient() .evaluatePoliciesWithResponse(resourceGroupName, labName, name, evaluatePoliciesRequest, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EvaluatePoliciesResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EvaluatePoliciesResponseImpl(inner.getValue(), this.manager())); } public EvaluatePoliciesResponse evaluatePolicies(String resourceGroupName, String labName, String name, diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsClientImpl.java index 14f7a4ab4a77..d6c276849fde 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -26,8 +26,8 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.devtestlabs.fluent.ProviderOperationsClient; -import com.azure.resourcemanager.devtestlabs.fluent.models.OperationMetadataInner; -import com.azure.resourcemanager.devtestlabs.models.ProviderOperationResult; +import com.azure.resourcemanager.devtestlabs.fluent.models.OperationInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -42,138 +42,147 @@ public final class ProviderOperationsClientImpl implements ProviderOperationsCli /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of ProviderOperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ProviderOperationsClientImpl(DevTestLabsClientImpl client) { + ProviderOperationsClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(ProviderOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientProviderOperations to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientProviderOperations to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientPro") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientProviderOperations") public interface ProviderOperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.DevTestLab/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.DevTestLab/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" }) + @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) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @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); } /** - * Result of the request to list REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations 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} 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.")); - } + private Mono> listSinglePageAsync() { final String accept = "application/json"; return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .>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())); } /** - * Result of the request to list REST API operations. + * 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 result of the request to list REST API operations 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)); } /** - * Result of the request to list REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations 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() { + 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); } /** - * Result of the request to list REST API operations. + * 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 result of the request to list REST API operations 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) { + 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); } /** - * Result of the request to list REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Result of the request to list REST API operations. + * 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 result of the request to list REST API operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -183,25 +192,36 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations 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} 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.")); - } + private Mono> listNextSinglePageAsync(String nextLink) { 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)) + .>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 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) { + 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. * @@ -210,22 +230,13 @@ 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 result of the request to list REST API operations 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) { - 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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsImpl.java index aa4a3bdea601..e489ccff87c2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -8,8 +8,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.fluent.ProviderOperationsClient; -import com.azure.resourcemanager.devtestlabs.fluent.models.OperationMetadataInner; -import com.azure.resourcemanager.devtestlabs.models.OperationMetadata; +import com.azure.resourcemanager.devtestlabs.fluent.models.OperationInner; +import com.azure.resourcemanager.devtestlabs.models.Operation; import com.azure.resourcemanager.devtestlabs.models.ProviderOperations; public final class ProviderOperationsImpl implements ProviderOperations { @@ -25,14 +25,14 @@ public ProviderOperationsImpl(ProviderOperationsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationMetadataImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationMetadataImpl(inner1, this.manager())); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private ProviderOperationsClient serviceClient() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/RdpConnectionImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/RdpConnectionImpl.java index 49287554d0cb..eb12eeb31ca5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/RdpConnectionImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/RdpConnectionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ResourceManagerUtils.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ResourceManagerUtils.java index 1560735c43e1..d73bc6803095 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ResourceManagerUtils.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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.devtestlabs.implementation; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ScheduleImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ScheduleImpl.java index 58266f23dfa4..4068fcaa5ae1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ScheduleImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ScheduleImpl.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.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; import com.azure.resourcemanager.devtestlabs.models.DayDetails; @@ -36,10 +37,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -49,6 +46,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public EnableStatus status() { return this.innerModel().status(); } @@ -269,6 +274,6 @@ public ScheduleImpl withTargetResourceId(String targetResourceId) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesClientImpl.java index 20f6e800c11f..fb33fc2c5c5b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -29,14 +29,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.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient; import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.ScheduleList; import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; -import com.azure.resourcemanager.devtestlabs.models.ScheduleList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -53,309 +54,195 @@ public final class SchedulesClientImpl implements SchedulesClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of SchedulesClientImpl. * * @param client the instance of the service client containing this operation class. */ - SchedulesClientImpl(DevTestLabsClientImpl client) { + SchedulesClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(SchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientSchedules to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for DevTestLabsManagementClientSchedules to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientSch") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientSchedules") public interface SchedulesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScheduleInner schedule, @HeaderParam("Accept") String accept, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScheduleInner schedule, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}") + @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("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScheduleInner schedule, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScheduleFragment schedule, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScheduleFragment schedule, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}") @ExpectedResponses({ 200, 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("labName") String labName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScheduleFragment schedule, @HeaderParam("Accept") String accept, - Context context); + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}/execute") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> execute(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> execute(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}/execute") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response executeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}/listApplicable") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listApplicable(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listApplicable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}/listApplicable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listApplicableSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listApplicableNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List schedules in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List schedules in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, expand, - filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List schedules in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List schedules in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List schedules in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List schedules in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listApplicableNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List schedules in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listApplicableNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -365,77 +252,19 @@ public PagedIterable list(String resourceGroupName, String labNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, - String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get schedule. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -451,9 +280,9 @@ private Mono getAsync(String resourceGroupName, String labName, S /** * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -464,15 +293,17 @@ private Mono getAsync(String resourceGroupName, String labName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, name, expand, accept, context); } /** * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -487,9 +318,9 @@ public ScheduleInner get(String resourceGroupName, String labName, String name) /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -499,87 +330,21 @@ public ScheduleInner get(String resourceGroupName, String labName, String name) @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, String name, ScheduleInner schedule) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), schedule, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, schedule, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String name, ScheduleInner schedule, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), schedule, accept, context); - } - - /** - * Create or replace an existing schedule. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -596,9 +361,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, String /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -609,15 +374,18 @@ private Mono createOrUpdateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, ScheduleInner schedule, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, name, schedule, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, schedule, context); } /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -630,88 +398,110 @@ public ScheduleInner createOrUpdate(String resourceGroupName, String labName, St } /** - * Delete schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, String name, + ScheduleFragment schedule) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, schedule, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete schedule. + * Allows modifying tags of schedules. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. + * @param schedule A schedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a schedule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, String name, + ScheduleFragment schedule) { + return updateWithResponseAsync(resourceGroupName, labName, name, schedule) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. + * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + public Response updateWithResponse(String resourceGroupName, String labName, String name, + ScheduleFragment schedule, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, schedule, context); + } + + /** + * Allows modifying tags of schedules. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. + * @param schedule A schedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a schedule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScheduleInner update(String resourceGroupName, String labName, String name, ScheduleFragment schedule) { + return updateWithResponse(resourceGroupName, labName, name, schedule, Context.NONE).getValue(); + } + + /** + * Delete schedule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 labName, String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -725,9 +515,9 @@ private Mono deleteAsync(String resourceGroupName, String labName, String /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -736,15 +526,16 @@ private Mono deleteAsync(String resourceGroupName, String labName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, labName, name, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -755,156 +546,171 @@ public void delete(String resourceGroupName, String labName, String name) { } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given lab. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, String name, - ScheduleFragment schedule) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String expand, String filter, Integer top, String orderby) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), schedule, accept, context)) + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, 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())); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given lab. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, String name, - ScheduleFragment schedule, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), schedule, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given lab. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List schedules in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String name, - ScheduleFragment schedule) { - return updateWithResponseAsync(resourceGroupName, labName, name, schedule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given lab. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String name, - ScheduleFragment schedule, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, name, schedule, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given lab. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner update(String resourceGroupName, String labName, String name, ScheduleFragment schedule) { - return updateWithResponse(resourceGroupName, labName, name, schedule, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List schedules in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -913,116 +719,73 @@ public ScheduleInner update(String resourceGroupName, String labName, String nam @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> executeWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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>> executeWithResponseAsync(String resourceGroupName, String labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + private Response executeWithResponse(String resourceGroupName, String labName, String name) { + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, Context.NONE); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginExecuteAsync(String resourceGroupName, String labName, - String name) { - Mono>> mono = executeWithResponseAsync(resourceGroupName, labName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response executeWithResponse(String resourceGroupName, String labName, String name, + Context context) { + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginExecuteAsync(String resourceGroupName, String labName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = executeWithResponseAsync(resourceGroupName, labName, name, context); + private PollerFlux, Void> beginExecuteAsync(String resourceGroupName, String labName, + String name) { + Mono>> mono = executeWithResponseAsync(resourceGroupName, labName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1030,15 +793,16 @@ private PollerFlux, Void> beginExecuteAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String name) { - return this.beginExecuteAsync(resourceGroupName, labName, name).getSyncPoller(); + Response response = executeWithResponse(resourceGroupName, labName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1048,15 +812,16 @@ public SyncPoller, Void> beginExecute(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String name, Context context) { - return this.beginExecuteAsync(resourceGroupName, labName, name, context).getSyncPoller(); + Response response = executeWithResponse(resourceGroupName, labName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1071,42 +836,24 @@ private Mono executeAsync(String resourceGroupName, String labName, String /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 executeAsync(String resourceGroupName, String labName, String name, Context context) { - return beginExecuteAsync(resourceGroupName, labName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a schedule. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 execute(String resourceGroupName, String labName, String name) { - executeAsync(resourceGroupName, labName, name).block(); + beginExecute(resourceGroupName, labName, name).getFinalResult(); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1114,15 +861,15 @@ public void execute(String resourceGroupName, String labName, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void execute(String resourceGroupName, String labName, String name, Context context) { - executeAsync(resourceGroupName, labName, name, context).block(); + beginExecute(resourceGroupName, labName, name, context).getFinalResult(); } /** * Lists all applicable schedules. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1132,28 +879,10 @@ public void execute(String resourceGroupName, String labName, String name, Conte @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listApplicableSinglePageAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listApplicable(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listApplicable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, 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())); @@ -1162,88 +891,69 @@ private Mono> listApplicableSinglePageAsync(String /** * Lists all applicable schedules. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listApplicableSinglePageAsync(String resourceGroupName, String labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listApplicable(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, 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 listApplicableAsync(String resourceGroupName, String labName, String name) { + return new PagedFlux<>(() -> listApplicableSinglePageAsync(resourceGroupName, labName, name), + nextLink -> listApplicableNextSinglePageAsync(nextLink)); } /** * Lists all applicable schedules. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. + * @return the response of a list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listApplicableAsync(String resourceGroupName, String labName, String name) { - return new PagedFlux<>(() -> listApplicableSinglePageAsync(resourceGroupName, labName, name), - nextLink -> listApplicableNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listApplicableSinglePage(String resourceGroupName, String labName, + String name) { + final String accept = "application/json"; + Response res = service.listApplicableSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Lists all applicable schedules. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. + * @return the response of a list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listApplicableAsync(String resourceGroupName, String labName, String name, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listApplicableSinglePage(String resourceGroupName, String labName, String name, Context context) { - return new PagedFlux<>(() -> listApplicableSinglePageAsync(resourceGroupName, labName, name, context), - nextLink -> listApplicableNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listApplicableSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Lists all applicable schedules. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1251,15 +961,16 @@ private PagedFlux listApplicableAsync(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listApplicable(String resourceGroupName, String labName, String name) { - return new PagedIterable<>(listApplicableAsync(resourceGroupName, labName, name)); + return new PagedIterable<>(() -> listApplicableSinglePage(resourceGroupName, labName, name), + nextLink -> listApplicableNextSinglePage(nextLink)); } /** * Lists all applicable schedules. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1269,7 +980,8 @@ public PagedIterable listApplicable(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listApplicable(String resourceGroupName, String labName, String name, Context context) { - return new PagedIterable<>(listApplicableAsync(resourceGroupName, labName, name, context)); + return new PagedIterable<>(() -> listApplicableSinglePage(resourceGroupName, labName, name, context), + nextLink -> listApplicableNextSinglePage(nextLink, context)); } /** @@ -1284,13 +996,6 @@ public PagedIterable listApplicable(String resourceGroupName, Str */ @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(), @@ -1298,6 +1003,23 @@ private Mono> listNextSinglePageAsync(String nextLi .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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -1306,23 +1028,14 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } /** @@ -1337,13 +1050,6 @@ private Mono> listNextSinglePageAsync(String nextLi */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listApplicableNextSinglePageAsync(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.listApplicableNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -1352,6 +1058,24 @@ private Mono> listApplicableNextSinglePageAsync(Str .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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listApplicableNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listApplicableNextSync(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. * @@ -1360,22 +1084,14 @@ private Mono> listApplicableNextSinglePageAsync(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 response of a list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listApplicableNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listApplicableNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listApplicableNext(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.listApplicableNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesImpl.java index 4e4f5add4601..207f59ea7f28 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -28,28 +28,12 @@ public SchedulesImpl(SchedulesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduleImpl(inner.getValue(), this.manager())); } public Schedule get(String resourceGroupName, String labName, String name) { @@ -65,12 +49,8 @@ public Response createOrUpdateWithResponse(String resourceGroupName, S ScheduleInner schedule, Context context) { Response inner = this.serviceClient().createOrUpdateWithResponse(resourceGroupName, labName, name, schedule, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduleImpl(inner.getValue(), this.manager())); } public Schedule createOrUpdate(String resourceGroupName, String labName, String name, ScheduleInner schedule) { @@ -82,24 +62,12 @@ public Schedule createOrUpdate(String resourceGroupName, String labName, String } } - public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, labName, name, context); - } - - public void delete(String resourceGroupName, String labName, String name) { - this.serviceClient().delete(resourceGroupName, labName, name); - } - public Response updateWithResponse(String resourceGroupName, String labName, String name, ScheduleFragment schedule, Context context) { Response inner = this.serviceClient().updateWithResponse(resourceGroupName, labName, name, schedule, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduleImpl(inner.getValue(), this.manager())); } public Schedule update(String resourceGroupName, String labName, String name, ScheduleFragment schedule) { @@ -111,6 +79,26 @@ public Schedule update(String resourceGroupName, String labName, String name, Sc } } + public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, labName, name, context); + } + + public void delete(String resourceGroupName, String labName, String name) { + this.serviceClient().delete(resourceGroupName, labName, name); + } + + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + } + public void execute(String resourceGroupName, String labName, String name) { this.serviceClient().execute(resourceGroupName, labName, name); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretImpl.java index 376f5338c943..8cc8cad9441a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretImpl.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.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.SecretInner; import com.azure.resourcemanager.devtestlabs.models.Secret; @@ -29,10 +30,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -42,6 +39,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String value() { return this.innerModel().value(); } @@ -78,30 +83,30 @@ private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { private String labName; - private String username; + private String userName; private String name; private SecretFragment updateSecret; - public SecretImpl withExistingUser(String resourceGroupName, String labName, String username) { + public SecretImpl withExistingUser(String resourceGroupName, String labName, String userName) { this.resourceGroupName = resourceGroupName; this.labName = labName; - this.username = username; + this.userName = userName; return this; } public Secret create() { this.innerObject = serviceManager.serviceClient() .getSecrets() - .createOrUpdate(resourceGroupName, labName, username, name, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, labName, userName, name, this.innerModel(), Context.NONE); return this; } public Secret create(Context context) { this.innerObject = serviceManager.serviceClient() .getSecrets() - .createOrUpdate(resourceGroupName, labName, username, name, this.innerModel(), context); + .createOrUpdate(resourceGroupName, labName, userName, name, this.innerModel(), context); return this; } @@ -119,7 +124,7 @@ public SecretImpl update() { public Secret apply() { this.innerObject = serviceManager.serviceClient() .getSecrets() - .updateWithResponse(resourceGroupName, labName, username, name, updateSecret, Context.NONE) + .updateWithResponse(resourceGroupName, labName, userName, name, updateSecret, Context.NONE) .getValue(); return this; } @@ -127,7 +132,7 @@ public Secret apply() { public Secret apply(Context context) { this.innerObject = serviceManager.serviceClient() .getSecrets() - .updateWithResponse(resourceGroupName, labName, username, name, updateSecret, context) + .updateWithResponse(resourceGroupName, labName, userName, name, updateSecret, context) .getValue(); return this; } @@ -137,7 +142,7 @@ public Secret apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.labName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "labs"); - this.username = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "users"); + this.userName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "users"); this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "secrets"); } @@ -145,7 +150,7 @@ public Secret refresh() { String localExpand = null; this.innerObject = serviceManager.serviceClient() .getSecrets() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, userName, name, localExpand, Context.NONE) .getValue(); return this; } @@ -154,7 +159,7 @@ public Secret refresh(Context context) { String localExpand = null; this.innerObject = serviceManager.serviceClient() .getSecrets() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, userName, name, localExpand, context) .getValue(); return this; } @@ -185,6 +190,6 @@ public SecretImpl withValue(String value) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsClientImpl.java index 799f603231c8..616c2a509f52 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -28,14 +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.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.SecretsClient; import com.azure.resourcemanager.devtestlabs.fluent.models.SecretInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.SecretList; import com.azure.resourcemanager.devtestlabs.models.SecretFragment; -import com.azure.resourcemanager.devtestlabs.models.SecretList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -52,300 +53,146 @@ public final class SecretsClientImpl implements SecretsClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of SecretsClientImpl. * * @param client the instance of the service client containing this operation class. */ - SecretsClientImpl(DevTestLabsClientImpl client) { + SecretsClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(SecretsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientSecrets to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for DevTestLabsManagementClientSecrets to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientSec") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientSecrets") public interface SecretsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @QueryParam("$expand") String expand, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") SecretInner secret, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SecretInner secret, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}") + @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("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SecretInner secret, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SecretFragment secret, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SecretFragment secret, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}") + @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("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}") @ExpectedResponses({ 200, 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("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") SecretFragment secret, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets") + @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("labName") String labName, + @PathParam("userName") String userName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @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); - } - - /** - * List secrets in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String username, String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List secrets in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String username, String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, username, - expand, filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List secrets in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List secrets in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List secrets in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List secrets in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String username) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, username, expand, filter, top, orderby)); - } - - /** - * List secrets in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, username, expand, filter, top, orderby, 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); } /** * Get secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param expand Specify the $expand query. Example: 'properties($select=value)'. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -354,86 +201,21 @@ public PagedIterable list(String resourceGroupName, String labName, * @return secret along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, String username, + private Mono> getWithResponseAsync(String resourceGroupName, String labName, String userName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get secret. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the secret. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, String username, - String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get secret. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -441,18 +223,18 @@ private Mono> getWithResponseAsync(String resourceGroupNam * @return secret on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String username, String name) { + private Mono getAsync(String resourceGroupName, String labName, String userName, String name) { final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, username, name, expand) + return getWithResponseAsync(resourceGroupName, labName, userName, name, expand) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param expand Specify the $expand query. Example: 'properties($select=value)'. * @param context The context to associate with this operation. @@ -462,17 +244,19 @@ private Mono getAsync(String resourceGroupName, String labName, Str * @return secret along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String labName, String username, String name, + public Response getWithResponse(String resourceGroupName, String labName, String userName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, username, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, name, expand, accept, context); } /** * Get secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -480,17 +264,17 @@ public Response getWithResponse(String resourceGroupName, String la * @return secret. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecretInner get(String resourceGroupName, String labName, String username, String name) { + public SecretInner get(String resourceGroupName, String labName, String userName, String name) { final String expand = null; - return getWithResponse(resourceGroupName, labName, username, name, expand, Context.NONE).getValue(); + return getWithResponse(resourceGroupName, labName, userName, name, expand, Context.NONE).getValue(); } /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -500,120 +284,71 @@ public SecretInner get(String resourceGroupName, String labName, String username */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, SecretInner secret) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (secret == null) { - return Mono.error(new IllegalArgumentException("Parameter secret is required and cannot be null.")); - } else { - secret.validate(); - } + String userName, String name, SecretInner secret) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), secret, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, + secret, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret along with {@link Response} on successful completion of {@link Mono}. + * @return a secret along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, SecretInner secret, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (secret == null) { - return Mono.error(new IllegalArgumentException("Parameter secret is required and cannot be null.")); - } else { - secret.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String userName, + String name, SecretInner secret) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, name, this.client.getApiVersion(), secret, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, secret, + Context.NONE); } /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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 secret. + * @return a secret along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SecretInner> beginCreateOrUpdateAsync(String resourceGroupName, - String labName, String username, String name, SecretInner secret) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, username, name, secret); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - SecretInner.class, SecretInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String userName, + String name, SecretInner secret, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, secret, + context); } /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -621,20 +356,19 @@ private PollerFlux, SecretInner> beginCreateOrUpdateAsyn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SecretInner> beginCreateOrUpdateAsync(String resourceGroupName, - String labName, String username, String name, SecretInner secret, Context context) { - context = this.client.mergeContext(context); + String labName, String userName, String name, SecretInner secret) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, username, name, secret, context); + = createOrUpdateWithResponseAsync(resourceGroupName, labName, userName, name, secret); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - SecretInner.class, SecretInner.class, context); + SecretInner.class, SecretInner.class, this.client.getContext()); } /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -644,16 +378,18 @@ private PollerFlux, SecretInner> beginCreateOrUpdateAsyn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SecretInner> beginCreateOrUpdate(String resourceGroupName, - String labName, String username, String name, SecretInner secret) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, secret).getSyncPoller(); + String labName, String userName, String name, SecretInner secret) { + Response response = createOrUpdateWithResponse(resourceGroupName, labName, userName, name, secret); + return this.client.getLroResult(response, SecretInner.class, SecretInner.class, + Context.NONE); } /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. * @param context The context to associate with this operation. @@ -664,17 +400,19 @@ public SyncPoller, SecretInner> beginCreateOrUpdate(Stri */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SecretInner> beginCreateOrUpdate(String resourceGroupName, - String labName, String username, String name, SecretInner secret, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, secret, context) - .getSyncPoller(); + String labName, String userName, String name, SecretInner secret, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, labName, userName, name, secret, context); + return this.client.getLroResult(response, SecretInner.class, SecretInner.class, + context); } /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -683,164 +421,166 @@ public SyncPoller, SecretInner> beginCreateOrUpdate(Stri * @return a secret on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String username, + private Mono createOrUpdateAsync(String resourceGroupName, String labName, String userName, String name, SecretInner secret) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, secret).last() + return beginCreateOrUpdateAsync(resourceGroupName, labName, userName, name, secret).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret on successful completion of {@link Mono}. + * @return a secret. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String username, - String name, SecretInner secret, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, secret, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public SecretInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, + SecretInner secret) { + return beginCreateOrUpdate(resourceGroupName, labName, userName, name, secret).getFinalResult(); } /** * Create or replace an existing secret. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a secret. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecretInner createOrUpdate(String resourceGroupName, String labName, String username, String name, - SecretInner secret) { - return createOrUpdateAsync(resourceGroupName, labName, username, name, secret).block(); + public SecretInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, + SecretInner secret, Context context) { + return beginCreateOrUpdate(resourceGroupName, labName, userName, name, secret, context).getFinalResult(); } /** - * Create or replace an existing secret. This operation can take a while to complete. + * Allows modifying tags of secrets. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param secret A secret. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret. + * @return a secret along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecretInner createOrUpdate(String resourceGroupName, String labName, String username, String name, - SecretInner secret, Context context) { - return createOrUpdateAsync(resourceGroupName, labName, username, name, secret, context).block(); + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, + String userName, String name, SecretFragment secret) { + 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, labName, userName, name, contentType, accept, + secret, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete secret. + * Allows modifying tags of secrets. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. + * @param secret A secret. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 a secret on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String username, - String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private Mono updateAsync(String resourceGroupName, String labName, String userName, String name, + SecretFragment secret) { + return updateWithResponseAsync(resourceGroupName, labName, userName, name, secret) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of secrets. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the secret. + * @param secret A secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a secret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String labName, String userName, + String name, SecretFragment secret, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, secret, + context); + } + + /** + * Allows modifying tags of secrets. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the secret. + * @param secret A secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner update(String resourceGroupName, String labName, String userName, String name, + SecretFragment secret) { + return updateWithResponse(resourceGroupName, labName, userName, name, secret, Context.NONE).getValue(); } /** * Delete secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 labName, String username, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, this.client.getApiVersion(), accept, context); + private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String userName, + String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -848,16 +588,16 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, String username, String name) { - return deleteWithResponseAsync(resourceGroupName, labName, username, name).flatMap(ignored -> Mono.empty()); + private Mono deleteAsync(String resourceGroupName, String labName, String userName, String name) { + return deleteWithResponseAsync(resourceGroupName, labName, userName, name).flatMap(ignored -> Mono.empty()); } /** * Delete secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -866,182 +606,199 @@ private Mono deleteAsync(String resourceGroupName, String labName, String * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String labName, String username, String name, + public Response deleteWithResponse(String resourceGroupName, String labName, String userName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, labName, username, name, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, context); } /** * Delete secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 labName, String username, String name) { - deleteWithResponse(resourceGroupName, labName, username, name, Context.NONE); + public void delete(String resourceGroupName, String labName, String userName, String name) { + deleteWithResponse(resourceGroupName, labName, userName, name, Context.NONE); } /** - * Allows modifying tags of secrets. All other properties will be ignored. + * List secrets in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the secret. - * @param secret A secret. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=value)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, SecretFragment secret) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (secret == null) { - return Mono.error(new IllegalArgumentException("Parameter secret is required and cannot be null.")); - } else { - secret.validate(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String userName, String expand, String filter, Integer top, String orderby) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), secret, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, expand, filter, top, orderby, + 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())); } /** - * Allows modifying tags of secrets. All other properties will be ignored. + * List secrets in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the secret. - * @param secret A secret. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=value)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, SecretFragment secret, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (secret == null) { - return Mono.error(new IllegalArgumentException("Parameter secret is required and cannot be null.")); - } else { - secret.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, this.client.getApiVersion(), secret, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, userName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of secrets. All other properties will be ignored. + * List secrets in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the secret. - * @param secret A secret. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String userName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, userName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List secrets in a given user profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=value)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String username, String name, - SecretFragment secret) { - return updateWithResponseAsync(resourceGroupName, labName, username, name, secret) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String userName, + String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of secrets. All other properties will be ignored. + * List secrets in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the secret. - * @param secret A secret. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=value)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String username, - String name, SecretFragment secret, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, username, name, secret, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String userName, + String expand, String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of secrets. All other properties will be ignored. + * List secrets in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the secret. - * @param secret A secret. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecretInner update(String resourceGroupName, String labName, String username, String name, - SecretFragment secret) { - return updateWithResponse(resourceGroupName, labName, username, name, secret, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String userName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, userName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List secrets in a given user profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=value)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, userName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -1056,13 +813,6 @@ public SecretInner update(String resourceGroupName, String labName, String usern */ @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(), @@ -1070,6 +820,23 @@ 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -1078,22 +845,13 @@ 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsImpl.java index 2fd3bb571cc0..73dd5e4309d9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -27,32 +27,16 @@ public SecretsImpl(SecretsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName, String username) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, username); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, username, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String labName, String username, String name, + public Response getWithResponse(String resourceGroupName, String labName, String userName, String name, String expand, Context context) { Response inner - = this.serviceClient().getWithResponse(resourceGroupName, labName, username, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecretImpl(inner.getValue(), this.manager())); - } else { - return null; - } + = this.serviceClient().getWithResponse(resourceGroupName, labName, userName, name, expand, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecretImpl(inner.getValue(), this.manager())); } - public Secret get(String resourceGroupName, String labName, String username, String name) { - SecretInner inner = this.serviceClient().get(resourceGroupName, labName, username, name); + public Secret get(String resourceGroupName, String labName, String userName, String name) { + SecretInner inner = this.serviceClient().get(resourceGroupName, labName, userName, name); if (inner != null) { return new SecretImpl(inner, this.manager()); } else { @@ -60,13 +44,25 @@ public Secret get(String resourceGroupName, String labName, String username, Str } } - public Response deleteWithResponse(String resourceGroupName, String labName, String username, String name, + public Response deleteWithResponse(String resourceGroupName, String labName, String userName, String name, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, labName, username, name, context); + return this.serviceClient().deleteWithResponse(resourceGroupName, labName, userName, name, context); + } + + public void delete(String resourceGroupName, String labName, String userName, String name) { + this.serviceClient().delete(resourceGroupName, labName, userName, name); + } + + public PagedIterable list(String resourceGroupName, String labName, String userName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, userName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); } - public void delete(String resourceGroupName, String labName, String username, String name) { - this.serviceClient().delete(resourceGroupName, labName, username, name); + public PagedIterable list(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, userName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); } public Secret getById(String id) { @@ -80,8 +76,8 @@ public Secret getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -91,7 +87,7 @@ public Secret getById(String id) { String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); } String localExpand = null; - return this.getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, labName, userName, name, localExpand, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, String expand, Context context) { @@ -105,8 +101,8 @@ public Response getByIdWithResponse(String id, String expand, Context co throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -115,7 +111,7 @@ public Response getByIdWithResponse(String id, String expand, Context co throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); } - return this.getWithResponse(resourceGroupName, labName, username, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, userName, name, expand, context); } public void deleteById(String id) { @@ -129,8 +125,8 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -139,7 +135,7 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); } - this.deleteWithResponse(resourceGroupName, labName, username, name, Context.NONE); + this.deleteWithResponse(resourceGroupName, labName, userName, name, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { @@ -153,8 +149,8 @@ public Response deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -163,7 +159,7 @@ public Response deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); } - return this.deleteWithResponse(resourceGroupName, labName, username, name, context); + return this.deleteWithResponse(resourceGroupName, labName, userName, name, context); } private SecretsClient serviceClient() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricImpl.java index 4ef9aad0a822..345eac60e438 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricImpl.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.devtestlabs.implementation; import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner; import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricInner; @@ -32,10 +33,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -45,6 +42,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String externalServiceFabricId() { return this.innerModel().externalServiceFabricId(); } @@ -94,30 +99,30 @@ private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { private String labName; - private String username; + private String userName; private String name; private ServiceFabricFragment updateServiceFabric; - public ServiceFabricImpl withExistingUser(String resourceGroupName, String labName, String username) { + public ServiceFabricImpl withExistingUser(String resourceGroupName, String labName, String userName) { this.resourceGroupName = resourceGroupName; this.labName = labName; - this.username = username; + this.userName = userName; return this; } public ServiceFabric create() { this.innerObject = serviceManager.serviceClient() .getServiceFabrics() - .createOrUpdate(resourceGroupName, labName, username, name, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, labName, userName, name, this.innerModel(), Context.NONE); return this; } public ServiceFabric create(Context context) { this.innerObject = serviceManager.serviceClient() .getServiceFabrics() - .createOrUpdate(resourceGroupName, labName, username, name, this.innerModel(), context); + .createOrUpdate(resourceGroupName, labName, userName, name, this.innerModel(), context); return this; } @@ -135,7 +140,7 @@ public ServiceFabricImpl update() { public ServiceFabric apply() { this.innerObject = serviceManager.serviceClient() .getServiceFabrics() - .updateWithResponse(resourceGroupName, labName, username, name, updateServiceFabric, Context.NONE) + .updateWithResponse(resourceGroupName, labName, userName, name, updateServiceFabric, Context.NONE) .getValue(); return this; } @@ -143,7 +148,7 @@ public ServiceFabric apply() { public ServiceFabric apply(Context context) { this.innerObject = serviceManager.serviceClient() .getServiceFabrics() - .updateWithResponse(resourceGroupName, labName, username, name, updateServiceFabric, context) + .updateWithResponse(resourceGroupName, labName, userName, name, updateServiceFabric, context) .getValue(); return this; } @@ -154,7 +159,7 @@ public ServiceFabric apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.labName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "labs"); - this.username = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "users"); + this.userName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "users"); this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "servicefabrics"); } @@ -162,7 +167,7 @@ public ServiceFabric refresh() { String localExpand = null; this.innerObject = serviceManager.serviceClient() .getServiceFabrics() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, userName, name, localExpand, Context.NONE) .getValue(); return this; } @@ -171,34 +176,34 @@ public ServiceFabric refresh(Context context) { String localExpand = null; this.innerObject = serviceManager.serviceClient() .getServiceFabrics() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, userName, name, localExpand, context) .getValue(); return this; } public Response listApplicableSchedulesWithResponse(Context context) { return serviceManager.serviceFabrics() - .listApplicableSchedulesWithResponse(resourceGroupName, labName, username, name, context); + .listApplicableSchedulesWithResponse(resourceGroupName, labName, userName, name, context); } public ApplicableSchedule listApplicableSchedules() { - return serviceManager.serviceFabrics().listApplicableSchedules(resourceGroupName, labName, username, name); + return serviceManager.serviceFabrics().listApplicableSchedules(resourceGroupName, labName, userName, name); } public void start() { - serviceManager.serviceFabrics().start(resourceGroupName, labName, username, name); + serviceManager.serviceFabrics().start(resourceGroupName, labName, userName, name); } public void start(Context context) { - serviceManager.serviceFabrics().start(resourceGroupName, labName, username, name, context); + serviceManager.serviceFabrics().start(resourceGroupName, labName, userName, name, context); } public void stop() { - serviceManager.serviceFabrics().stop(resourceGroupName, labName, username, name); + serviceManager.serviceFabrics().stop(resourceGroupName, labName, userName, name); } public void stop(Context context) { - serviceManager.serviceFabrics().stop(resourceGroupName, labName, username, name, context); + serviceManager.serviceFabrics().stop(resourceGroupName, labName, userName, name, context); } public ServiceFabricImpl withRegion(Region location) { @@ -232,6 +237,6 @@ public ServiceFabricImpl withEnvironmentId(String environmentId) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricPropertiesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricPropertiesImpl.java index 00861734c695..358a189134b2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricPropertiesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricPropertiesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesClientImpl.java index 0eff89817566..6dbc228bb4d8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -29,14 +29,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.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient; import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.ScheduleList; import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; -import com.azure.resourcemanager.devtestlabs.models.ScheduleList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -53,605 +54,386 @@ public final class ServiceFabricSchedulesClientImpl implements ServiceFabricSche /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of ServiceFabricSchedulesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ServiceFabricSchedulesClientImpl(DevTestLabsClientImpl client) { + ServiceFabricSchedulesClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(ServiceFabricSchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientServiceFabricSchedules to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientServiceFabricSchedules to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientSer") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientServiceFabricSchedules") public interface ServiceFabricSchedulesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("serviceFabricName") String serviceFabricName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("serviceFabricName") String serviceFabricName, + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("serviceFabricName") String serviceFabricName, - @PathParam("name") String name, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("serviceFabricName") String serviceFabricName, + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("serviceFabricName") String serviceFabricName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScheduleInner schedule, @HeaderParam("Accept") String accept, + @PathParam("userName") String userName, @PathParam("serviceFabricName") String serviceFabricName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScheduleInner schedule, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}") + @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("labName") String labName, + @PathParam("userName") String userName, @PathParam("serviceFabricName") String serviceFabricName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScheduleInner schedule, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("serviceFabricName") String serviceFabricName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScheduleFragment schedule, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("serviceFabricName") String serviceFabricName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScheduleFragment schedule, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}") + @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("labName") String labName, + @PathParam("userName") String userName, @PathParam("serviceFabricName") String serviceFabricName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}") @ExpectedResponses({ 200, 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("labName") String labName, - @PathParam("userName") String username, @PathParam("serviceFabricName") String serviceFabricName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("serviceFabricName") String serviceFabricName, + @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("serviceFabricName") String serviceFabricName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScheduleFragment schedule, @HeaderParam("Accept") String accept, - Context context); + @PathParam("userName") String userName, @PathParam("serviceFabricName") String serviceFabricName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules") + @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("labName") String labName, + @PathParam("userName") String userName, @PathParam("serviceFabricName") String serviceFabricName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}/execute") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> execute(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> execute(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("serviceFabricName") String serviceFabricName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("serviceFabricName") String serviceFabricName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}/execute") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response executeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("serviceFabricName") String serviceFabricName, + @PathParam("name") String name, 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); } /** - * List schedules in a given service fabric. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String username, String serviceFabricName, String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (serviceFabricName == null) { - return Mono - .error(new IllegalArgumentException("Parameter serviceFabricName is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String labName, + String userName, String serviceFabricName, String name, String expand) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, serviceFabricName, expand, filter, top, orderby, - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, serviceFabricName, name, expand, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List schedules in a given service fabric. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String username, String serviceFabricName, String expand, String filter, Integer top, String orderby, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (serviceFabricName == null) { - return Mono - .error(new IllegalArgumentException("Parameter serviceFabricName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, username, - serviceFabricName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List schedules in a given service fabric. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username, - String serviceFabricName, String expand, String filter, Integer top, String orderby) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, username, serviceFabricName, - expand, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List schedules in a given service fabric. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username, - String serviceFabricName) { + private Mono getAsync(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name) { final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, username, serviceFabricName, - expand, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); + return getWithResponseAsync(resourceGroupName, labName, userName, serviceFabricName, name, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List schedules in a given service fabric. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. + * @return schedule along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username, - String serviceFabricName, String expand, String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, username, serviceFabricName, - expand, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, String expand, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, serviceFabricName, name, expand, accept, context); } /** - * List schedules in a given service fabric. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String username, - String serviceFabricName) { + @ServiceMethod(returns = ReturnType.SINGLE) + public ScheduleInner get(String resourceGroupName, String labName, String userName, String serviceFabricName, + String name) { final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>( - listAsync(resourceGroupName, labName, username, serviceFabricName, expand, filter, top, orderby)); - } - - /** - * List schedules in a given service fabric. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String username, - String serviceFabricName, String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, username, serviceFabricName, expand, filter, top, orderby, context)); + return getWithResponse(resourceGroupName, labName, userName, serviceFabricName, name, expand, Context.NONE) + .getValue(); } /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response} on successful completion of {@link Mono}. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String username, String serviceFabricName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (serviceFabricName == null) { - return Mono - .error(new IllegalArgumentException("Parameter serviceFabricName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, + String userName, String serviceFabricName, String name, ScheduleInner schedule) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, serviceFabricName, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, serviceFabricName, name, + contentType, accept, schedule, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get schedule. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String username, String serviceFabricName, String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (serviceFabricName == null) { - return Mono - .error(new IllegalArgumentException("Parameter serviceFabricName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, serviceFabricName, name, expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule on successful completion of {@link Mono}. + * @return a schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String username, - String serviceFabricName, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name, expand) + private Mono createOrUpdateAsync(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, ScheduleInner schedule) { + return createOrUpdateWithResponseAsync(resourceGroupName, labName, userName, serviceFabricName, name, schedule) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. + * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name, expand, context) - .block(); - } - - /** - * Get schedule. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner get(String resourceGroupName, String labName, String username, String serviceFabricName, - String name) { - final String expand = null; - return getWithResponse(resourceGroupName, labName, username, serviceFabricName, name, expand, Context.NONE) - .getValue(); + public Response createOrUpdateWithResponse(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, ScheduleInner schedule, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, serviceFabricName, name, contentType, + accept, schedule, context); } /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. + * @return a schedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String username, String serviceFabricName, String name, ScheduleInner schedule) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (serviceFabricName == null) { - return Mono - .error(new IllegalArgumentException("Parameter serviceFabricName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, serviceFabricName, name, this.client.getApiVersion(), schedule, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public ScheduleInner createOrUpdate(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, ScheduleInner schedule) { + return createOrUpdateWithResponse(resourceGroupName, labName, userName, serviceFabricName, name, schedule, + Context.NONE).getValue(); } /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param schedule A schedule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String username, String serviceFabricName, String name, ScheduleInner schedule, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (serviceFabricName == null) { - return Mono - .error(new IllegalArgumentException("Parameter serviceFabricName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, + String userName, String serviceFabricName, String name, ScheduleFragment schedule) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, serviceFabricName, name, this.client.getApiVersion(), schedule, accept, context); + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, serviceFabricName, name, + contentType, accept, schedule, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -659,20 +441,20 @@ private Mono> createOrUpdateWithResponseAsync(String res * @return a schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, ScheduleInner schedule) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name, schedule) + private Mono updateAsync(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, ScheduleFragment schedule) { + return updateWithResponseAsync(resourceGroupName, labName, userName, serviceFabricName, name, schedule) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -681,20 +463,23 @@ private Mono createOrUpdateAsync(String resourceGroupName, String * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, ScheduleInner schedule, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name, schedule, - context).block(); + public Response updateWithResponse(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, ScheduleFragment schedule, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, serviceFabricName, name, contentType, + accept, schedule, context); } /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -702,137 +487,61 @@ public Response createOrUpdateWithResponse(String resourceGroupNa * @return a schedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner createOrUpdate(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, ScheduleInner schedule) { - return createOrUpdateWithResponse(resourceGroupName, labName, username, serviceFabricName, name, schedule, - Context.NONE).getValue(); + public ScheduleInner update(String resourceGroupName, String labName, String userName, String serviceFabricName, + String name, ScheduleFragment schedule) { + return updateWithResponse(resourceGroupName, labName, userName, serviceFabricName, name, schedule, Context.NONE) + .getValue(); } /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 labName, String username, + private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String userName, String serviceFabricName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (serviceFabricName == null) { - return Mono - .error(new IllegalArgumentException("Parameter serviceFabricName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, serviceFabricName, name, this.client.getApiVersion(), accept, context)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, serviceFabricName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 labName, String username, - String serviceFabricName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (serviceFabricName == null) { - return Mono - .error(new IllegalArgumentException("Parameter serviceFabricName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, serviceFabricName, name, this.client.getApiVersion(), accept, context); - } - - /** - * Delete schedule. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 labName, String username, String serviceFabricName, + private Mono deleteAsync(String resourceGroupName, String labName, String userName, String serviceFabricName, String name) { - return deleteWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name) + return deleteWithResponseAsync(resourceGroupName, labName, userName, serviceFabricName, name) .flatMap(ignored -> Mono.empty()); } /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -840,210 +549,217 @@ private Mono deleteAsync(String resourceGroupName, String labName, String * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String labName, String username, + public Response deleteWithResponse(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, serviceFabricName, name, context); } /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 labName, String username, String serviceFabricName, + public void delete(String resourceGroupName, String labName, String userName, String serviceFabricName, String name) { - deleteWithResponse(resourceGroupName, labName, username, serviceFabricName, name, Context.NONE); + deleteWithResponse(resourceGroupName, labName, userName, serviceFabricName, name, Context.NONE); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given service fabric. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String username, String serviceFabricName, String name, ScheduleFragment schedule) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (serviceFabricName == null) { - return Mono - .error(new IllegalArgumentException("Parameter serviceFabricName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String userName, String serviceFabricName, String expand, String filter, Integer top, String orderby) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, serviceFabricName, name, this.client.getApiVersion(), schedule, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, serviceFabricName, expand, + filter, top, orderby, 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())); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given service fabric. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String username, String serviceFabricName, String name, ScheduleFragment schedule, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (serviceFabricName == null) { - return Mono - .error(new IllegalArgumentException("Parameter serviceFabricName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, serviceFabricName, name, this.client.getApiVersion(), schedule, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String userName, + String serviceFabricName, String expand, String filter, Integer top, String orderby) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, userName, serviceFabricName, + expand, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given service fabric. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String userName, + String serviceFabricName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, userName, serviceFabricName, + expand, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List schedules in a given service fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, ScheduleFragment schedule) { - return updateWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name, schedule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String userName, + String serviceFabricName, String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, serviceFabricName, expand, filter, + top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given service fabric. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, ScheduleFragment schedule, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name, schedule, context) - .block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String userName, + String serviceFabricName, String expand, String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, serviceFabricName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given service fabric. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner update(String resourceGroupName, String labName, String username, String serviceFabricName, - String name, ScheduleFragment schedule) { - return updateWithResponse(resourceGroupName, labName, username, serviceFabricName, name, schedule, Context.NONE) - .getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String userName, + String serviceFabricName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, userName, serviceFabricName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List schedules in a given service fabric. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String userName, + String serviceFabricName, String expand, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, labName, userName, serviceFabricName, expand, + filter, top, orderby, context), nextLink -> listNextSinglePage(nextLink, context)); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1051,119 +767,62 @@ public ScheduleInner update(String resourceGroupName, String labName, String use */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> executeWithResponseAsync(String resourceGroupName, String labName, - String username, String serviceFabricName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (serviceFabricName == null) { - return Mono - .error(new IllegalArgumentException("Parameter serviceFabricName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, serviceFabricName, name, this.client.getApiVersion(), accept, - context)) + String userName, String serviceFabricName, String name) { + return FluxUtil.withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, serviceFabricName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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>> executeWithResponseAsync(String resourceGroupName, String labName, - String username, String serviceFabricName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (serviceFabricName == null) { - return Mono - .error(new IllegalArgumentException("Parameter serviceFabricName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, serviceFabricName, name, this.client.getApiVersion(), accept, context); + private Response executeWithResponse(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name) { + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, serviceFabricName, name, + Context.NONE); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginExecuteAsync(String resourceGroupName, String labName, - String username, String serviceFabricName, String name) { - Mono>> mono - = executeWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response executeWithResponse(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, Context context) { + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, serviceFabricName, name, context); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1171,41 +830,42 @@ private PollerFlux, Void> beginExecuteAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync(String resourceGroupName, String labName, - String username, String serviceFabricName, String name, Context context) { - context = this.client.mergeContext(context); + String userName, String serviceFabricName, String name) { Mono>> mono - = executeWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name, context); + = executeWithResponseAsync(resourceGroupName, labName, userName, serviceFabricName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked 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> beginExecute(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String userName, String serviceFabricName, String name) { - return this.beginExecuteAsync(resourceGroupName, labName, username, serviceFabricName, name).getSyncPoller(); + Response response + = executeWithResponse(resourceGroupName, labName, userName, serviceFabricName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1213,88 +873,68 @@ public SyncPoller, Void> beginExecute(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, Context context) { - return this.beginExecuteAsync(resourceGroupName, labName, username, serviceFabricName, name, context) - .getSyncPoller(); + Response response + = executeWithResponse(resourceGroupName, labName, userName, serviceFabricName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 executeAsync(String resourceGroupName, String labName, String username, String serviceFabricName, + private Mono executeAsync(String resourceGroupName, String labName, String userName, String serviceFabricName, String name) { - return beginExecuteAsync(resourceGroupName, labName, username, serviceFabricName, name).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a schedule. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 executeAsync(String resourceGroupName, String labName, String username, String serviceFabricName, - String name, Context context) { - return beginExecuteAsync(resourceGroupName, labName, username, serviceFabricName, name, context).last() + return beginExecuteAsync(resourceGroupName, labName, userName, serviceFabricName, name).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 execute(String resourceGroupName, String labName, String username, String serviceFabricName, + public void execute(String resourceGroupName, String labName, String userName, String serviceFabricName, String name) { - executeAsync(resourceGroupName, labName, username, serviceFabricName, name).block(); + beginExecute(resourceGroupName, labName, userName, serviceFabricName, name).getFinalResult(); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 execute(String resourceGroupName, String labName, String username, String serviceFabricName, + public void execute(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, Context context) { - executeAsync(resourceGroupName, labName, username, serviceFabricName, name, context).block(); + beginExecute(resourceGroupName, labName, userName, serviceFabricName, name, context).getFinalResult(); } /** @@ -1309,13 +949,6 @@ public void execute(String resourceGroupName, String labName, String username, S */ @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(), @@ -1323,6 +956,23 @@ private Mono> listNextSinglePageAsync(String nextLi .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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -1331,22 +981,13 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesImpl.java index 0f7a973d56a5..7d32d655e50a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -28,35 +28,17 @@ public ServiceFabricSchedulesImpl(ServiceFabricSchedulesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName, String username, - String serviceFabricName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, username, serviceFabricName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String username, - String serviceFabricName, String expand, String filter, Integer top, String orderby, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, labName, username, serviceFabricName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String labName, String username, + public Response getWithResponse(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, String expand, Context context) { Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, labName, username, serviceFabricName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + .getWithResponse(resourceGroupName, labName, userName, serviceFabricName, name, expand, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduleImpl(inner.getValue(), this.manager())); } - public Schedule get(String resourceGroupName, String labName, String username, String serviceFabricName, + public Schedule get(String resourceGroupName, String labName, String userName, String serviceFabricName, String name) { - ScheduleInner inner = this.serviceClient().get(resourceGroupName, labName, username, serviceFabricName, name); + ScheduleInner inner = this.serviceClient().get(resourceGroupName, labName, userName, serviceFabricName, name); if (inner != null) { return new ScheduleImpl(inner, this.manager()); } else { @@ -64,23 +46,19 @@ public Schedule get(String resourceGroupName, String labName, String username, S } } - public Response createOrUpdateWithResponse(String resourceGroupName, String labName, String username, + public Response createOrUpdateWithResponse(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, ScheduleInner schedule, Context context) { Response inner = this.serviceClient() - .createOrUpdateWithResponse(resourceGroupName, labName, username, serviceFabricName, name, schedule, + .createOrUpdateWithResponse(resourceGroupName, labName, userName, serviceFabricName, name, schedule, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduleImpl(inner.getValue(), this.manager())); } - public Schedule createOrUpdate(String resourceGroupName, String labName, String username, String serviceFabricName, + public Schedule createOrUpdate(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, ScheduleInner schedule) { ScheduleInner inner = this.serviceClient() - .createOrUpdate(resourceGroupName, labName, username, serviceFabricName, name, schedule); + .createOrUpdate(resourceGroupName, labName, userName, serviceFabricName, name, schedule); if (inner != null) { return new ScheduleImpl(inner, this.manager()); } else { @@ -88,33 +66,18 @@ public Schedule createOrUpdate(String resourceGroupName, String labName, String } } - public Response deleteWithResponse(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, labName, username, serviceFabricName, name, context); - } - - public void delete(String resourceGroupName, String labName, String username, String serviceFabricName, - String name) { - this.serviceClient().delete(resourceGroupName, labName, username, serviceFabricName, name); - } - - public Response updateWithResponse(String resourceGroupName, String labName, String username, + public Response updateWithResponse(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, ScheduleFragment schedule, Context context) { Response inner = this.serviceClient() - .updateWithResponse(resourceGroupName, labName, username, serviceFabricName, name, schedule, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + .updateWithResponse(resourceGroupName, labName, userName, serviceFabricName, name, schedule, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduleImpl(inner.getValue(), this.manager())); } - public Schedule update(String resourceGroupName, String labName, String username, String serviceFabricName, + public Schedule update(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, ScheduleFragment schedule) { ScheduleInner inner - = this.serviceClient().update(resourceGroupName, labName, username, serviceFabricName, name, schedule); + = this.serviceClient().update(resourceGroupName, labName, userName, serviceFabricName, name, schedule); if (inner != null) { return new ScheduleImpl(inner, this.manager()); } else { @@ -122,14 +85,39 @@ public Schedule update(String resourceGroupName, String labName, String username } } - public void execute(String resourceGroupName, String labName, String username, String serviceFabricName, + public Response deleteWithResponse(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, labName, userName, serviceFabricName, name, context); + } + + public void delete(String resourceGroupName, String labName, String userName, String serviceFabricName, + String name) { + this.serviceClient().delete(resourceGroupName, labName, userName, serviceFabricName, name); + } + + public PagedIterable list(String resourceGroupName, String labName, String userName, + String serviceFabricName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, userName, serviceFabricName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String userName, + String serviceFabricName, String expand, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, labName, userName, serviceFabricName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + } + + public void execute(String resourceGroupName, String labName, String userName, String serviceFabricName, String name) { - this.serviceClient().execute(resourceGroupName, labName, username, serviceFabricName, name); + this.serviceClient().execute(resourceGroupName, labName, userName, serviceFabricName, name); } - public void execute(String resourceGroupName, String labName, String username, String serviceFabricName, + public void execute(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, Context context) { - this.serviceClient().execute(resourceGroupName, labName, username, serviceFabricName, name, context); + this.serviceClient().execute(resourceGroupName, labName, userName, serviceFabricName, name, context); } private ServiceFabricSchedulesClient serviceClient() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsClientImpl.java index b2e018879a0f..a0b4db8570ce 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -29,6 +29,7 @@ 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.polling.PollerFlux; @@ -36,8 +37,8 @@ import com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient; import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner; import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.ServiceFabricList; import com.azure.resourcemanager.devtestlabs.models.ServiceFabricFragment; -import com.azure.resourcemanager.devtestlabs.models.ServiceFabricList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -54,333 +55,203 @@ public final class ServiceFabricsClientImpl implements ServiceFabricsClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of ServiceFabricsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ServiceFabricsClientImpl(DevTestLabsClientImpl client) { + ServiceFabricsClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(ServiceFabricsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientServiceFabrics to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientServiceFabrics to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientSer") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientServiceFabrics") public interface ServiceFabricsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @QueryParam("$expand") String expand, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ServiceFabricInner serviceFabric, @HeaderParam("Accept") String accept, - Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServiceFabricInner serviceFabric, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}") + @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("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServiceFabricInner serviceFabric, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServiceFabricFragment serviceFabric, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServiceFabricFragment serviceFabric, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}") + @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("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics") + @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("labName") String labName, + @PathParam("userName") String userName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ServiceFabricFragment serviceFabric, @HeaderParam("Accept") String accept, - Context context); + @PathParam("userName") String userName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}/listApplicableSchedules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listApplicableSchedules(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listApplicableSchedules(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}/listApplicableSchedules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listApplicableSchedulesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}/start") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> start(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}/start") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response startSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}/stop") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("userName") String userName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}/stop") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response stopSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("userName") String userName, @PathParam("name") String name, 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); - } - - /** - * List service fabrics in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String username, String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List service fabrics in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String username, String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, username, - expand, filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List service fabrics in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List service fabrics in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List service fabrics in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List service fabrics in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String username) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, username, expand, filter, top, orderby)); - } + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List service fabrics in a given user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, username, expand, filter, top, orderby, 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); } /** * Get service fabric. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -390,85 +261,20 @@ public PagedIterable list(String resourceGroupName, String l */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String username, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + String userName, String name, String expand) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get service fabric. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service fabric along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String username, String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get service fabric. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -476,18 +282,18 @@ private Mono> getWithResponseAsync(String resourceG * @return service fabric on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String username, String name) { + private Mono getAsync(String resourceGroupName, String labName, String userName, String name) { final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, username, name, expand) + return getWithResponseAsync(resourceGroupName, labName, userName, name, expand) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get service fabric. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. * @param context The context to associate with this operation. @@ -497,17 +303,19 @@ private Mono getAsync(String resourceGroupName, String labNa * @return service fabric along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String labName, String username, + public Response getWithResponse(String resourceGroupName, String labName, String userName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, username, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, name, expand, accept, context); } /** * Get service fabric. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -515,17 +323,17 @@ public Response getWithResponse(String resourceGroupName, St * @return service fabric. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceFabricInner get(String resourceGroupName, String labName, String username, String name) { + public ServiceFabricInner get(String resourceGroupName, String labName, String userName, String name) { final String expand = null; - return getWithResponse(resourceGroupName, labName, username, name, expand, Context.NONE).getValue(); + return getWithResponse(resourceGroupName, labName, userName, name, expand, Context.NONE).getValue(); } /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -535,121 +343,71 @@ public ServiceFabricInner get(String resourceGroupName, String labName, String u */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, ServiceFabricInner serviceFabric) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (serviceFabric == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceFabric is required and cannot be null.")); - } else { - serviceFabric.validate(); - } + String userName, String name, ServiceFabricInner serviceFabric) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), serviceFabric, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, + serviceFabric, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric along with {@link Response} on successful completion of {@link Mono}. + * @return a Service Fabric along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, ServiceFabricInner serviceFabric, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (serviceFabric == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceFabric is required and cannot be null.")); - } else { - serviceFabric.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String userName, + String name, ServiceFabricInner serviceFabric) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, name, this.client.getApiVersion(), serviceFabric, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, + serviceFabric, Context.NONE); } /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a Service Fabric. + * @return a Service Fabric along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServiceFabricInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, String username, String name, ServiceFabricInner serviceFabric) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, username, name, serviceFabric); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServiceFabricInner.class, ServiceFabricInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String userName, + String name, ServiceFabricInner serviceFabric, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, + serviceFabric, context); } /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -657,21 +415,19 @@ private PollerFlux, ServiceFabricInner> beginCrea */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServiceFabricInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, String username, String name, ServiceFabricInner serviceFabric, - Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String labName, String userName, String name, ServiceFabricInner serviceFabric) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, username, name, serviceFabric, context); + = createOrUpdateWithResponseAsync(resourceGroupName, labName, userName, name, serviceFabric); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServiceFabricInner.class, ServiceFabricInner.class, context); + ServiceFabricInner.class, ServiceFabricInner.class, this.client.getContext()); } /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -681,16 +437,19 @@ private PollerFlux, ServiceFabricInner> beginCrea */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServiceFabricInner> beginCreateOrUpdate(String resourceGroupName, - String labName, String username, String name, ServiceFabricInner serviceFabric) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, serviceFabric).getSyncPoller(); + String labName, String userName, String name, ServiceFabricInner serviceFabric) { + Response response + = createOrUpdateWithResponse(resourceGroupName, labName, userName, name, serviceFabric); + return this.client.getLroResult(response, ServiceFabricInner.class, + ServiceFabricInner.class, Context.NONE); } /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. * @param context The context to associate with this operation. @@ -701,17 +460,19 @@ public SyncPoller, ServiceFabricInner> beginCreat */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServiceFabricInner> beginCreateOrUpdate(String resourceGroupName, - String labName, String username, String name, ServiceFabricInner serviceFabric, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, serviceFabric, context) - .getSyncPoller(); + String labName, String userName, String name, ServiceFabricInner serviceFabric, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, labName, userName, name, serviceFabric, context); + return this.client.getLroResult(response, ServiceFabricInner.class, + ServiceFabricInner.class, context); } /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -720,78 +481,145 @@ public SyncPoller, ServiceFabricInner> beginCreat * @return a Service Fabric on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String username, + private Mono createOrUpdateAsync(String resourceGroupName, String labName, String userName, String name, ServiceFabricInner serviceFabric) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, serviceFabric).last() + return beginCreateOrUpdateAsync(resourceGroupName, labName, userName, name, serviceFabric).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric on successful completion of {@link Mono}. + * @return a Service Fabric. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String username, - String name, ServiceFabricInner serviceFabric, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, serviceFabric, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public ServiceFabricInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, + ServiceFabricInner serviceFabric) { + return beginCreateOrUpdate(resourceGroupName, labName, userName, name, serviceFabric).getFinalResult(); } /** * Create or replace an existing service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Service Fabric. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceFabricInner createOrUpdate(String resourceGroupName, String labName, String username, String name, - ServiceFabricInner serviceFabric) { - return createOrUpdateAsync(resourceGroupName, labName, username, name, serviceFabric).block(); + public ServiceFabricInner createOrUpdate(String resourceGroupName, String labName, String userName, String name, + ServiceFabricInner serviceFabric, Context context) { + return beginCreateOrUpdate(resourceGroupName, labName, userName, name, serviceFabric, context).getFinalResult(); } /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Allows modifying tags of service fabrics. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the service fabric. + * @param serviceFabric A Service Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, + String userName, String name, ServiceFabricFragment serviceFabric) { + 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, labName, userName, name, contentType, accept, + serviceFabric, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows modifying tags of service fabrics. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the service fabric. + * @param serviceFabric A Service Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, String userName, String name, + ServiceFabricFragment serviceFabric) { + return updateWithResponseAsync(resourceGroupName, labName, userName, name, serviceFabric) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of service fabrics. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param serviceFabric A Service Fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String labName, String userName, + String name, ServiceFabricFragment serviceFabric, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, contentType, accept, + serviceFabric, context); + } + + /** + * Allows modifying tags of service fabrics. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param userName The name of the user profile. + * @param name The name of the service fabric. + * @param serviceFabric A Service Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Service Fabric. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceFabricInner createOrUpdate(String resourceGroupName, String labName, String username, String name, - ServiceFabricInner serviceFabric, Context context) { - return createOrUpdateAsync(resourceGroupName, labName, username, name, serviceFabric, context).block(); + public ServiceFabricInner update(String resourceGroupName, String labName, String userName, String name, + ServiceFabricFragment serviceFabric) { + return updateWithResponse(resourceGroupName, labName, userName, name, serviceFabric, Context.NONE).getValue(); } /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -800,106 +628,59 @@ public ServiceFabricInner createOrUpdate(String resourceGroupName, String labNam */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String labName, - String username, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; + String userName, String name) { return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String labName, - String username, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String labName, String userName, + String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, Context.NONE); } /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, - String username, String name) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, username, name); - 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 labName, String userName, + String name, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, context); } /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -907,20 +688,18 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, - String username, String name, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, labName, username, name, context); + String userName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, userName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -928,17 +707,18 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String userName, String name) { - return this.beginDeleteAsync(resourceGroupName, labName, username, name).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, userName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -947,17 +727,18 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String userName, String name, Context context) { - return this.beginDeleteAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, userName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -965,275 +746,224 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, String username, String name) { - return beginDeleteAsync(resourceGroupName, labName, username, name).last() + private Mono deleteAsync(String resourceGroupName, String labName, String userName, String name) { + return beginDeleteAsync(resourceGroupName, labName, userName, name).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, String username, String name, - Context context) { - return beginDeleteAsync(resourceGroupName, labName, username, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String labName, String userName, String name) { + beginDelete(resourceGroupName, labName, userName, name).getFinalResult(); } /** * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String username, String name) { - deleteAsync(resourceGroupName, labName, username, name).block(); + public void delete(String resourceGroupName, String labName, String userName, String name, Context context) { + beginDelete(resourceGroupName, labName, userName, name, context).getFinalResult(); } /** - * Delete service fabric. This operation can take a while to complete. + * List service fabrics in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String username, String name, Context context) { - deleteAsync(resourceGroupName, labName, username, name, context).block(); + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String userName, String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, expand, filter, top, orderby, + 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())); } /** - * Allows modifying tags of service fabrics. All other properties will be ignored. + * List service fabrics in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, ServiceFabricFragment serviceFabric) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (serviceFabric == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceFabric is required and cannot be null.")); - } else { - serviceFabric.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, username, name, this.client.getApiVersion(), serviceFabric, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String userName, + String expand, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, userName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of service fabrics. All other properties will be ignored. + * List service fabrics in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String username, String name, ServiceFabricFragment serviceFabric, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (serviceFabric == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceFabric is required and cannot be null.")); - } else { - serviceFabric.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, this.client.getApiVersion(), serviceFabric, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String userName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, userName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of service fabrics. All other properties will be ignored. + * List service fabrics in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String username, String name, - ServiceFabricFragment serviceFabric) { - return updateWithResponseAsync(resourceGroupName, labName, username, name, serviceFabric) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String userName, + String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of service fabrics. All other properties will be ignored. + * List service fabrics in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String username, - String name, ServiceFabricFragment serviceFabric, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, username, name, serviceFabric, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String userName, + String expand, String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of service fabrics. All other properties will be ignored. + * List service fabrics in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceFabricInner update(String resourceGroupName, String labName, String username, String name, - ServiceFabricFragment serviceFabric) { - return updateWithResponse(resourceGroupName, labName, username, name, serviceFabric, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String userName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, userName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); } /** - * Lists the applicable start/stop schedules, if any. + * List service fabrics in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listApplicableSchedulesWithResponseAsync(String resourceGroupName, - String labName, String username, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listApplicableSchedules(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String userName, + String expand, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, userName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1242,40 +972,21 @@ private Mono> listApplicableSchedulesWithRespo */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listApplicableSchedulesWithResponseAsync(String resourceGroupName, - String labName, String username, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + String labName, String userName, String name) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listApplicableSchedules(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), accept, context); + return FluxUtil + .withContext( + context -> service.listApplicableSchedules(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1284,17 +995,17 @@ private Mono> listApplicableSchedulesWithRespo */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listApplicableSchedulesAsync(String resourceGroupName, String labName, - String username, String name) { - return listApplicableSchedulesWithResponseAsync(resourceGroupName, labName, username, name) + String userName, String name) { + return listApplicableSchedulesWithResponseAsync(resourceGroupName, labName, userName, name) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1304,16 +1015,18 @@ private Mono listApplicableSchedulesAsync(String resour */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listApplicableSchedulesWithResponse(String resourceGroupName, - String labName, String username, String name, Context context) { - return listApplicableSchedulesWithResponseAsync(resourceGroupName, labName, username, name, context).block(); + String labName, String userName, String name, Context context) { + final String accept = "application/json"; + return service.listApplicableSchedulesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, accept, context); } /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1321,17 +1034,17 @@ public Response listApplicableSchedulesWithResponse(Str * @return schedules applicable to a virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicableScheduleInner listApplicableSchedules(String resourceGroupName, String labName, String username, + public ApplicableScheduleInner listApplicableSchedules(String resourceGroupName, String labName, String userName, String name) { - return listApplicableSchedulesWithResponse(resourceGroupName, labName, username, name, Context.NONE).getValue(); + return listApplicableSchedulesWithResponse(resourceGroupName, labName, userName, name, Context.NONE).getValue(); } /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1340,106 +1053,59 @@ public ApplicableScheduleInner listApplicableSchedules(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync(String resourceGroupName, String labName, - String username, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; + String userName, String name) { return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync(String resourceGroupName, String labName, - String username, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, this.client.getApiVersion(), accept, context); + private Response startWithResponse(String resourceGroupName, String labName, String userName, + String name) { + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, Context.NONE); } /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync(String resourceGroupName, String labName, - String username, String name) { - Mono>> mono = startWithResponseAsync(resourceGroupName, labName, username, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String resourceGroupName, String labName, String userName, + String name, Context context) { + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, context); } /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1447,20 +1113,18 @@ private PollerFlux, Void> beginStartAsync(String resourceGroupN */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStartAsync(String resourceGroupName, String labName, - String username, String name, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = startWithResponseAsync(resourceGroupName, labName, username, name, context); + String userName, String name) { + Mono>> mono = startWithResponseAsync(resourceGroupName, labName, userName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1468,17 +1132,18 @@ private PollerFlux, Void> beginStartAsync(String resourceGroupN * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginStart(String resourceGroupName, String labName, String userName, String name) { - return this.beginStartAsync(resourceGroupName, labName, username, name).getSyncPoller(); + Response response = startWithResponse(resourceGroupName, labName, userName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1487,71 +1152,52 @@ public SyncPoller, Void> beginStart(String resourceGroupName, S * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginStart(String resourceGroupName, String labName, String userName, String name, Context context) { - return this.beginStartAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); - } - - /** - * Start a service fabric. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String labName, String username, String name) { - return beginStartAsync(resourceGroupName, labName, username, name).last() - .flatMap(this.client::getLroFinalResultOrError); + Response response = startWithResponse(resourceGroupName, labName, userName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String labName, String username, String name, - Context context) { - return beginStartAsync(resourceGroupName, labName, username, name, context).last() + private Mono startAsync(String resourceGroupName, String labName, String userName, String name) { + return beginStartAsync(resourceGroupName, labName, userName, name).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String labName, String username, String name) { - startAsync(resourceGroupName, labName, username, name).block(); + public void start(String resourceGroupName, String labName, String userName, String name) { + beginStart(resourceGroupName, labName, userName, name).getFinalResult(); } /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1559,16 +1205,16 @@ public void start(String resourceGroupName, String labName, String username, Str * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String labName, String username, String name, Context context) { - startAsync(resourceGroupName, labName, username, name, context).block(); + public void start(String resourceGroupName, String labName, String userName, String name, Context context) { + beginStart(resourceGroupName, labName, userName, name, context).getFinalResult(); } /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1577,127 +1223,78 @@ public void start(String resourceGroupName, String labName, String username, Str */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> stopWithResponseAsync(String resourceGroupName, String labName, - String username, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; + String userName, String name) { return FluxUtil - .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, username, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, userName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync(String resourceGroupName, String labName, - String username, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - username, name, this.client.getApiVersion(), accept, context); + private Response stopWithResponse(String resourceGroupName, String labName, String userName, + String name) { + return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, name, Context.NONE); } /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync(String resourceGroupName, String labName, String username, - String name) { - Mono>> mono = stopWithResponseAsync(resourceGroupName, labName, username, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response stopWithResponse(String resourceGroupName, String labName, String userName, + String name, Context context) { + return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, userName, name, context); } /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync(String resourceGroupName, String labName, String username, - String name, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = stopWithResponseAsync(resourceGroupName, labName, username, name, context); + private PollerFlux, Void> beginStopAsync(String resourceGroupName, String labName, String userName, + String name) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, labName, userName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1705,17 +1302,18 @@ private PollerFlux, Void> beginStopAsync(String resourceGroupNa * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginStop(String resourceGroupName, String labName, String userName, String name) { - return this.beginStopAsync(resourceGroupName, labName, username, name).getSyncPoller(); + Response response = stopWithResponse(resourceGroupName, labName, userName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1724,17 +1322,18 @@ public SyncPoller, Void> beginStop(String resourceGroupName, St * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop(String resourceGroupName, String labName, String username, + public SyncPoller, Void> beginStop(String resourceGroupName, String labName, String userName, String name, Context context) { - return this.beginStopAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); + Response response = stopWithResponse(resourceGroupName, labName, userName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1742,62 +1341,61 @@ public SyncPoller, Void> beginStop(String resourceGroupName, St * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String labName, String username, String name) { - return beginStopAsync(resourceGroupName, labName, username, name).last() + private Mono stopAsync(String resourceGroupName, String labName, String userName, String name) { + return beginStopAsync(resourceGroupName, labName, userName, name).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String labName, String username, String name, - Context context) { - return beginStopAsync(resourceGroupName, labName, username, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void stop(String resourceGroupName, String labName, String userName, String name) { + beginStop(resourceGroupName, labName, userName, name).getFinalResult(); } /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String labName, String username, String name) { - stopAsync(resourceGroupName, labName, username, name).block(); + public void stop(String resourceGroupName, String labName, String userName, String name, Context context) { + beginStop(resourceGroupName, labName, userName, name, context).getFinalResult(); } /** - * Stop a service fabric This operation can take a while to complete. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. - * @param context The context to associate with this operation. + * @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 list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String labName, String username, String name, Context context) { - stopAsync(resourceGroupName, labName, username, name, context).block(); + private Mono> listNextSinglePageAsync(String nextLink) { + 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())); } /** @@ -1807,23 +1405,15 @@ public void stop(String resourceGroupName, String labName, String username, 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink) { 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())); + 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); } /** @@ -1834,22 +1424,13 @@ 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsImpl.java index d852e7589313..85d598a3a36d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -29,32 +29,16 @@ public ServiceFabricsImpl(ServiceFabricsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName, String username) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, username); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceFabricImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, username, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceFabricImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceGroupName, String labName, String username, + public Response getWithResponse(String resourceGroupName, String labName, String userName, String name, String expand, Context context) { Response inner - = this.serviceClient().getWithResponse(resourceGroupName, labName, username, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServiceFabricImpl(inner.getValue(), this.manager())); - } else { - return null; - } + = this.serviceClient().getWithResponse(resourceGroupName, labName, userName, name, expand, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ServiceFabricImpl(inner.getValue(), this.manager())); } - public ServiceFabric get(String resourceGroupName, String labName, String username, String name) { - ServiceFabricInner inner = this.serviceClient().get(resourceGroupName, labName, username, name); + public ServiceFabric get(String resourceGroupName, String labName, String userName, String name) { + ServiceFabricInner inner = this.serviceClient().get(resourceGroupName, labName, userName, name); if (inner != null) { return new ServiceFabricImpl(inner, this.manager()); } else { @@ -62,30 +46,38 @@ public ServiceFabric get(String resourceGroupName, String labName, String userna } } - public void delete(String resourceGroupName, String labName, String username, String name) { - this.serviceClient().delete(resourceGroupName, labName, username, name); + public void delete(String resourceGroupName, String labName, String userName, String name) { + this.serviceClient().delete(resourceGroupName, labName, userName, name); } - public void delete(String resourceGroupName, String labName, String username, String name, Context context) { - this.serviceClient().delete(resourceGroupName, labName, username, name, context); + public void delete(String resourceGroupName, String labName, String userName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, labName, userName, name, context); + } + + public PagedIterable list(String resourceGroupName, String labName, String userName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, userName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceFabricImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, userName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceFabricImpl(inner1, this.manager())); } public Response listApplicableSchedulesWithResponse(String resourceGroupName, String labName, - String username, String name, Context context) { + String userName, String name, Context context) { Response inner = this.serviceClient() - .listApplicableSchedulesWithResponse(resourceGroupName, labName, username, name, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicableScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + .listApplicableSchedulesWithResponse(resourceGroupName, labName, userName, name, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApplicableScheduleImpl(inner.getValue(), this.manager())); } - public ApplicableSchedule listApplicableSchedules(String resourceGroupName, String labName, String username, + public ApplicableSchedule listApplicableSchedules(String resourceGroupName, String labName, String userName, String name) { ApplicableScheduleInner inner - = this.serviceClient().listApplicableSchedules(resourceGroupName, labName, username, name); + = this.serviceClient().listApplicableSchedules(resourceGroupName, labName, userName, name); if (inner != null) { return new ApplicableScheduleImpl(inner, this.manager()); } else { @@ -93,20 +85,20 @@ public ApplicableSchedule listApplicableSchedules(String resourceGroupName, Stri } } - public void start(String resourceGroupName, String labName, String username, String name) { - this.serviceClient().start(resourceGroupName, labName, username, name); + public void start(String resourceGroupName, String labName, String userName, String name) { + this.serviceClient().start(resourceGroupName, labName, userName, name); } - public void start(String resourceGroupName, String labName, String username, String name, Context context) { - this.serviceClient().start(resourceGroupName, labName, username, name, context); + public void start(String resourceGroupName, String labName, String userName, String name, Context context) { + this.serviceClient().start(resourceGroupName, labName, userName, name, context); } - public void stop(String resourceGroupName, String labName, String username, String name) { - this.serviceClient().stop(resourceGroupName, labName, username, name); + public void stop(String resourceGroupName, String labName, String userName, String name) { + this.serviceClient().stop(resourceGroupName, labName, userName, name); } - public void stop(String resourceGroupName, String labName, String username, String name, Context context) { - this.serviceClient().stop(resourceGroupName, labName, username, name, context); + public void stop(String resourceGroupName, String labName, String userName, String name, Context context) { + this.serviceClient().stop(resourceGroupName, labName, userName, name, context); } public ServiceFabric getById(String id) { @@ -120,8 +112,8 @@ public ServiceFabric getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -131,7 +123,7 @@ public ServiceFabric getById(String id) { String.format("The resource ID '%s' is not valid. Missing path segment 'servicefabrics'.", id))); } String localExpand = null; - return this.getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, labName, userName, name, localExpand, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, String expand, Context context) { @@ -145,8 +137,8 @@ public Response getByIdWithResponse(String id, String expand, Con throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -155,7 +147,7 @@ public Response getByIdWithResponse(String id, String expand, Con throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'servicefabrics'.", id))); } - return this.getWithResponse(resourceGroupName, labName, username, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, userName, name, expand, context); } public void deleteById(String id) { @@ -169,8 +161,8 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -179,7 +171,7 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'servicefabrics'.", id))); } - this.delete(resourceGroupName, labName, username, name, Context.NONE); + this.delete(resourceGroupName, labName, userName, name, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { @@ -193,8 +185,8 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String username = ResourceManagerUtils.getValueFromIdByName(id, "users"); - if (username == null) { + String userName = ResourceManagerUtils.getValueFromIdByName(id, "users"); + if (userName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } @@ -203,7 +195,7 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'servicefabrics'.", id))); } - this.delete(resourceGroupName, labName, username, name, context); + this.delete(resourceGroupName, labName, userName, name, context); } private ServiceFabricsClient serviceClient() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnerImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnerImpl.java index 9765b94942e9..b83945740474 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnerImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnerImpl.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.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceRunnerInner; import com.azure.resourcemanager.devtestlabs.models.IdentityProperties; @@ -29,10 +30,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -42,10 +39,18 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + public IdentityProperties identity() { return this.innerModel().identity(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public Region region() { return Region.fromName(this.regionName()); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersClientImpl.java index c163e6bfff81..d0bd712a9967 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -40,62 +40,87 @@ public final class ServiceRunnersClientImpl implements ServiceRunnersClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of ServiceRunnersClientImpl. * * @param client the instance of the service client containing this operation class. */ - ServiceRunnersClientImpl(DevTestLabsClientImpl client) { + ServiceRunnersClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(ServiceRunnersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientServiceRunners to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientServiceRunners to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientSer") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientServiceRunners") public interface ServiceRunnersService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners/{name}") + @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("labName") String labName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ServiceRunnerInner serviceRunner, @HeaderParam("Accept") String accept, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ServiceRunnerInner serviceRunner, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners/{name}") + @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("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ServiceRunnerInner serviceRunner, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners/{name}") + @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("labName") String labName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners/{name}") @ExpectedResponses({ 200, 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("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, Context context); } /** * Get service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -106,74 +131,17 @@ Mono> delete(@HostParam("$host") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get service runner. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the service runner. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service runner along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, name, - this.client.getApiVersion(), accept, context); - } - - /** - * Get service runner. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -189,7 +157,7 @@ private Mono getAsync(String resourceGroupName, String labNa /** * Get service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @param context The context to associate with this operation. @@ -201,13 +169,15 @@ private Mono getAsync(String resourceGroupName, String labNa @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String labName, String name, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, name, accept, context); } /** * Get service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -223,7 +193,7 @@ public ServiceRunnerInner get(String resourceGroupName, String labName, String n /** * Create or replace an existing service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @param serviceRunner A container for a managed identity to execute DevTest lab services. @@ -236,86 +206,19 @@ public ServiceRunnerInner get(String resourceGroupName, String labName, String n @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (serviceRunner == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceRunner is required and cannot be null.")); - } else { - serviceRunner.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), serviceRunner, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, serviceRunner, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing service runner. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the service runner. - * @param serviceRunner A container for a managed identity to execute DevTest lab services. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a container for a managed identity to execute DevTest lab services along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String name, ServiceRunnerInner serviceRunner, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (serviceRunner == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceRunner is required and cannot be null.")); - } else { - serviceRunner.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), serviceRunner, accept, context); - } - - /** - * Create or replace an existing service runner. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @param serviceRunner A container for a managed identity to execute DevTest lab services. @@ -335,7 +238,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, S /** * Create or replace an existing service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @param serviceRunner A container for a managed identity to execute DevTest lab services. @@ -348,13 +251,17 @@ private Mono createOrUpdateAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, name, serviceRunner, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, serviceRunner, + context); } /** * Create or replace an existing service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @param serviceRunner A container for a managed identity to execute DevTest lab services. @@ -372,7 +279,7 @@ public ServiceRunnerInner createOrUpdate(String resourceGroupName, String labNam /** * Delete service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -382,74 +289,16 @@ public ServiceRunnerInner createOrUpdate(String resourceGroupName, String labNam */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete service runner. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the service runner. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 labName, String name, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); - } - - /** - * Delete service runner. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -465,7 +314,7 @@ private Mono deleteAsync(String resourceGroupName, String labName, String /** * Delete service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @param context The context to associate with this operation. @@ -476,13 +325,14 @@ private Mono deleteAsync(String resourceGroupName, String labName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, labName, name, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Delete service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersImpl.java index 94dc43d6ba8e..61195041ff3b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -30,12 +30,8 @@ public Response getWithResponse(String resourceGroupName, String Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServiceRunnerImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ServiceRunnerImpl(inner.getValue(), this.manager())); } public ServiceRunner get(String resourceGroupName, String labName, String name) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UserImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UserImpl.java index e15c3b3a4ded..bf092328d5d2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UserImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UserImpl.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.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.UserInner; import com.azure.resourcemanager.devtestlabs.models.User; @@ -32,10 +33,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -45,6 +42,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public UserIdentity identity() { return this.innerModel().identity(); } @@ -197,6 +202,6 @@ public UserImpl withSecretStore(UserSecretStore secretStore) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersClientImpl.java index b7213738f8c9..a86e7c96e97b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -28,14 +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.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.UsersClient; import com.azure.resourcemanager.devtestlabs.fluent.models.UserInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.UserList; import com.azure.resourcemanager.devtestlabs.models.UserFragment; -import com.azure.resourcemanager.devtestlabs.models.UserList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -52,277 +53,138 @@ public final class UsersClientImpl implements UsersClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of UsersClientImpl. * * @param client the instance of the service client containing this operation class. */ - UsersClientImpl(DevTestLabsClientImpl client) { + UsersClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(UsersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientUsers to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for DevTestLabsManagementClientUsers to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientUse") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientUsers") public interface UsersService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UserInner user, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") UserInner user, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{name}") - @ExpectedResponses({ 200, 202, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") UserInner user, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UserFragment user, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") UserFragment user, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List user profiles in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") UserFragment user, Context context); - /** - * List user profiles in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, expand, - filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{name}") + @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("labName") String labName, + @PathParam("name") String name, Context context); - /** - * List user profiles in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{name}") + @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("labName") String labName, + @PathParam("name") String name, Context context); - /** - * List user profiles in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List user profiles in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List user profiles in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); - } + @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); - /** - * List user profiles in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, 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); } /** * Get user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param expand Specify the $expand query. Example: 'properties($select=identity)'. @@ -334,75 +196,17 @@ public PagedIterable list(String resourceGroupName, String labName, S @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get user profile. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user profile along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, - String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get user profile. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -420,7 +224,7 @@ private Mono getAsync(String resourceGroupName, String labName, Strin /** * Get user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param expand Specify the $expand query. Example: 'properties($select=identity)'. @@ -433,13 +237,15 @@ private Mono getAsync(String resourceGroupName, String labName, Strin @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, name, expand, accept, context); } /** * Get user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -456,158 +262,112 @@ public UserInner get(String resourceGroupName, String labName, String name) { /** * Create or replace an existing user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user along with {@link Response} on successful completion of {@link Mono}. + * @return a user profile along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, String name, UserInner user) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (user == null) { - return Mono.error(new IllegalArgumentException("Parameter user is required and cannot be null.")); - } else { - user.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), user, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, user, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user along with {@link Response} on successful completion of {@link Mono}. + * @return a user profile along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String name, UserInner user, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (user == null) { - return Mono.error(new IllegalArgumentException("Parameter user is required and cannot be null.")); - } else { - user.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + UserInner user) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), user, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, user, Context.NONE); } /** * Create or replace an existing user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of profile of a lab user. + * @return a user profile along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, UserInner> beginCreateOrUpdateAsync(String resourceGroupName, - String labName, String name, UserInner user) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, user); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), UserInner.class, - UserInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + UserInner user, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, user, context); } /** * Create or replace an existing user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of profile of a lab user. + * @return the {@link PollerFlux} for polling of a user profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, UserInner> beginCreateOrUpdateAsync(String resourceGroupName, - String labName, String name, UserInner user, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, user, context); + String labName, String name, UserInner user) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, user); return this.client.getLroResult(mono, this.client.getHttpPipeline(), UserInner.class, - UserInner.class, context); + UserInner.class, this.client.getContext()); } /** * Create or replace an existing user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of profile of a lab user. + * @return the {@link SyncPoller} for polling of a user profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, UserInner> beginCreateOrUpdate(String resourceGroupName, String labName, String name, UserInner user) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, name, user).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, labName, name, user); + return this.client.getLroResult(response, UserInner.class, UserInner.class, Context.NONE); } /** * Create or replace an existing user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. @@ -615,25 +375,26 @@ public SyncPoller, UserInner> beginCreateOrUpdate(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 SyncPoller} for polling of profile of a lab user. + * @return the {@link SyncPoller} for polling of a user profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, UserInner> beginCreateOrUpdate(String resourceGroupName, String labName, String name, UserInner user, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, name, user, context).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, labName, name, user, context); + return this.client.getLroResult(response, UserInner.class, UserInner.class, context); } /** * Create or replace an existing user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user on successful completion of {@link Mono}. + * @return a user profile on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String labName, String name, UserInner user) { @@ -644,7 +405,24 @@ private Mono createOrUpdateAsync(String resourceGroupName, String lab /** * Create or replace an existing user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the user profile. + * @param user Profile of a lab user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a user profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserInner createOrUpdate(String resourceGroupName, String labName, String name, UserInner user) { + return beginCreateOrUpdate(resourceGroupName, labName, name, user).getFinalResult(); + } + + /** + * Create or replace an existing user profile. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. @@ -652,36 +430,59 @@ private Mono createOrUpdateAsync(String resourceGroupName, String lab * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user on successful completion of {@link Mono}. + * @return a user profile. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String name, UserInner user, + public UserInner createOrUpdate(String resourceGroupName, String labName, String name, UserInner user, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, name, user, context).last() - .flatMap(this.client::getLroFinalResultOrError); + return beginCreateOrUpdate(resourceGroupName, labName, name, user, context).getFinalResult(); } /** - * Create or replace an existing user profile. This operation can take a while to complete. + * Allows modifying tags of user profiles. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return a user profile along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner createOrUpdate(String resourceGroupName, String labName, String name, UserInner user) { - return createOrUpdateAsync(resourceGroupName, labName, name, user).block(); + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, String name, + UserFragment user) { + 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, labName, name, contentType, accept, user, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or replace an existing user profile. This operation can take a while to complete. + * Allows modifying tags of user profiles. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the user profile. + * @param user Profile of a lab user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a user profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, String name, UserFragment user) { + return updateWithResponseAsync(resourceGroupName, labName, name, user) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of user profiles. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param user Profile of a lab user. @@ -689,18 +490,38 @@ public UserInner createOrUpdate(String resourceGroupName, String labName, 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 profile of a lab user. + * @return a user profile along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner createOrUpdate(String resourceGroupName, String labName, String name, UserInner user, - Context context) { - return createOrUpdateAsync(resourceGroupName, labName, name, user, context).block(); + public Response updateWithResponse(String resourceGroupName, String labName, String name, + UserFragment user, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, user, context); + } + + /** + * Allows modifying tags of user profiles. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the user profile. + * @param user Profile of a lab user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a user profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserInner update(String resourceGroupName, String labName, String name, UserFragment user) { + return updateWithResponse(resourceGroupName, labName, name, user, Context.NONE).getValue(); } /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -711,113 +532,70 @@ public UserInner createOrUpdate(String resourceGroupName, String labName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user 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 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 labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String labName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, Context.NONE); } /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user 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 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 labName, String name) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); - 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 labName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user 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 the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -827,13 +605,14 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { - return this.beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @param context The context to associate with this operation. @@ -845,13 +624,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name, Context context) { - return this.beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -867,194 +647,192 @@ private Mono deleteAsync(String resourceGroupName, String labName, String /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user 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 {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, String name, Context context) { - return beginDeleteAsync(resourceGroupName, labName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String labName, String name) { + beginDelete(resourceGroupName, labName, name).getFinalResult(); } /** * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String name) { - deleteAsync(resourceGroupName, labName, name).block(); + public void delete(String resourceGroupName, String labName, String name, Context context) { + beginDelete(resourceGroupName, labName, name, context).getFinalResult(); } /** - * Delete user profile. This operation can take a while to complete. + * List user profiles in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the user profile. - * @param context The context to associate with this operation. + * @param expand Specify the $expand query. Example: 'properties($select=identity)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String name, Context context) { - deleteAsync(resourceGroupName, labName, name, context).block(); + private Mono> listSinglePageAsync(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, 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())); } /** - * Allows modifying tags of user profiles. All other properties will be ignored. + * List user profiles in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the user profile. - * @param user Profile of a lab user. + * @param expand Specify the $expand query. Example: 'properties($select=identity)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, String name, - UserFragment user) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (user == null) { - return Mono.error(new IllegalArgumentException("Parameter user is required and cannot be null.")); - } else { - user.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), user, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of user profiles. All other properties will be ignored. + * List user profiles in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the user profile. - * @param user Profile of a lab user. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, String name, - UserFragment user, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (user == null) { - return Mono.error(new IllegalArgumentException("Parameter user is required and cannot be null.")); - } else { - user.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), user, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of user profiles. All other properties will be ignored. + * List user profiles in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the user profile. - * @param user Profile of a lab user. + * @param expand Specify the $expand query. Example: 'properties($select=identity)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String name, UserFragment user) { - return updateWithResponseAsync(resourceGroupName, labName, name, user) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of user profiles. All other properties will be ignored. + * List user profiles in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the user profile. - * @param user Profile of a lab user. + * @param expand Specify the $expand query. Example: 'properties($select=identity)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String name, - UserFragment user, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, name, user, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of user profiles. All other properties will be ignored. + * List user profiles in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the user profile. - * @param user Profile of a lab user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner update(String resourceGroupName, String labName, String name, UserFragment user) { - return updateWithResponse(resourceGroupName, labName, name, user, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List user profiles in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=identity)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -1069,13 +847,6 @@ public UserInner update(String resourceGroupName, String labName, String name, U */ @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(), @@ -1083,6 +854,23 @@ 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -1091,22 +879,13 @@ 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersImpl.java index 6c7c8d18e84e..87ce9395052a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -26,28 +26,12 @@ public UsersImpl(UsersClient innerClient, com.azure.resourcemanager.devtestlabs. this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, - String orderby, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new UserImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new UserImpl(inner.getValue(), this.manager())); } public User get(String resourceGroupName, String labName, String name) { @@ -67,6 +51,18 @@ public void delete(String resourceGroupName, String labName, String name, Contex this.serviceClient().delete(resourceGroupName, labName, name, context); } + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, + String orderby, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); + } + public User getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesClientImpl.java index e2ad8e135a21..0053e8f8e152 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -29,14 +29,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.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient; import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.ScheduleList; import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; -import com.azure.resourcemanager.devtestlabs.models.ScheduleList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -53,314 +54,170 @@ public final class VirtualMachineSchedulesClientImpl implements VirtualMachineSc /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of VirtualMachineSchedulesClientImpl. * * @param client the instance of the service client containing this operation class. */ - VirtualMachineSchedulesClientImpl(DevTestLabsClientImpl client) { + VirtualMachineSchedulesClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(VirtualMachineSchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientVirtualMachineSchedules to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientVirtualMachineSchedules to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientVir") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientVirtualMachineSchedules") public interface VirtualMachineSchedulesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("virtualMachineName") String virtualMachineName, @QueryParam("$expand") String expand, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("virtualMachineName") String virtualMachineName, @PathParam("name") String name, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("virtualMachineName") String virtualMachineName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("virtualMachineName") String virtualMachineName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ScheduleInner schedule, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScheduleInner schedule, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}") + @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("labName") String labName, + @PathParam("virtualMachineName") String virtualMachineName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScheduleInner schedule, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("virtualMachineName") String virtualMachineName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScheduleFragment schedule, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("virtualMachineName") String virtualMachineName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScheduleFragment schedule, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}") + @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("labName") String labName, + @PathParam("virtualMachineName") String virtualMachineName, @PathParam("name") String name, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}") @ExpectedResponses({ 200, 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("labName") String labName, @PathParam("virtualMachineName") String virtualMachineName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("virtualMachineName") String virtualMachineName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ScheduleFragment schedule, - @HeaderParam("Accept") String accept, Context context); + @PathParam("virtualMachineName") String virtualMachineName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules") + @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("labName") String labName, + @PathParam("virtualMachineName") String virtualMachineName, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}/execute") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> execute(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> execute(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("virtualMachineName") String virtualMachineName, @PathParam("name") String name, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}/execute") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response executeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("virtualMachineName") String virtualMachineName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + 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); - } - - /** - * List schedules in a given virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String virtualMachineName, String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby, - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List schedules in a given virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String virtualMachineName, String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - virtualMachineName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List schedules in a given virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List schedules in a given virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String virtualMachineName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List schedules in a given virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, virtualMachineName, expand, filter, - top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List schedules in a given virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String virtualMachineName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>( - listAsync(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby)); - } - - /** - * List schedules in a given virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby, 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); } /** * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -370,88 +227,21 @@ public PagedIterable list(String resourceGroupName, String labNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, String virtualMachineName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, virtualMachineName, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, virtualMachineName, name, expand, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String virtualMachineName, String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - virtualMachineName, name, expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get schedule. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -468,10 +258,10 @@ private Mono getAsync(String resourceGroupName, String labName, S /** * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -482,16 +272,18 @@ private Mono getAsync(String resourceGroupName, String labName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String labName, String virtualMachineName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, virtualMachineName, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, virtualMachineName, name, expand, accept, context); } /** * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -506,10 +298,10 @@ public ScheduleInner get(String resourceGroupName, String labName, String virtua /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -519,98 +311,22 @@ public ScheduleInner get(String resourceGroupName, String labName, String virtua @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, String virtualMachineName, String name, ScheduleInner schedule) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, virtualMachineName, name, this.client.getApiVersion(), schedule, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, virtualMachineName, name, contentType, + accept, schedule, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String virtualMachineName, String name, ScheduleInner schedule, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, virtualMachineName, name, this.client.getApiVersion(), schedule, accept, context); - } - - /** - * Create or replace an existing schedule. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -627,10 +343,10 @@ private Mono createOrUpdateAsync(String resourceGroupName, String /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -641,17 +357,20 @@ private Mono createOrUpdateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String labName, String virtualMachineName, String name, ScheduleInner schedule, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, virtualMachineName, name, schedule, context) - .block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, virtualMachineName, name, contentType, accept, + schedule, context); } /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -666,100 +385,122 @@ public ScheduleInner createOrUpdate(String resourceGroupName, String labName, St } /** - * Delete schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, - String virtualMachineName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, + String virtualMachineName, String name, ScheduleFragment schedule) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, virtualMachineName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, virtualMachineName, name, contentType, + accept, schedule, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. + * @param schedule A schedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a schedule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, String virtualMachineName, + String name, ScheduleFragment schedule) { + return updateWithResponseAsync(resourceGroupName, labName, virtualMachineName, name, schedule) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of schedules. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. + * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a schedule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String labName, + String virtualMachineName, String name, ScheduleFragment schedule, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, virtualMachineName, name, contentType, accept, + schedule, context); + } + + /** + * Allows modifying tags of schedules. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. + * @param schedule A schedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a schedule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScheduleInner update(String resourceGroupName, String labName, String virtualMachineName, String name, + ScheduleFragment schedule) { + return updateWithResponse(resourceGroupName, labName, virtualMachineName, name, schedule, Context.NONE) + .getValue(); + } + + /** + * Delete schedule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 labName, - String virtualMachineName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - virtualMachineName, name, this.client.getApiVersion(), accept, context); + String virtualMachineName, String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, virtualMachineName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -774,10 +515,10 @@ private Mono deleteAsync(String resourceGroupName, String labName, String /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -787,16 +528,17 @@ private Mono deleteAsync(String resourceGroupName, String labName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String labName, String virtualMachineName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, labName, virtualMachineName, name, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, virtualMachineName, name, context); } /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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,173 +549,185 @@ public void delete(String resourceGroupName, String labName, String virtualMachi } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given virtual machine. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String virtualMachineName, String name, ScheduleFragment schedule) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String virtualMachineName, String expand, String filter, Integer top, String orderby) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, virtualMachineName, name, this.client.getApiVersion(), schedule, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, virtualMachineName, expand, filter, top, + orderby, 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())); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given virtual machine. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String virtualMachineName, String name, ScheduleFragment schedule, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (schedule == null) { - return Mono.error(new IllegalArgumentException("Parameter schedule is required and cannot be null.")); - } else { - schedule.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - virtualMachineName, name, this.client.getApiVersion(), schedule, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String virtualMachineName, + String expand, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given virtual machine. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String virtualMachineName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List schedules in a given virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String virtualMachineName, - String name, ScheduleFragment schedule) { - return updateWithResponseAsync(resourceGroupName, labName, virtualMachineName, name, schedule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, + String virtualMachineName, String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given virtual machine. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, - String virtualMachineName, String name, ScheduleFragment schedule, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, virtualMachineName, name, schedule, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, + String virtualMachineName, String expand, String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given virtual machine. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner update(String resourceGroupName, String labName, String virtualMachineName, String name, - ScheduleFragment schedule) { - return updateWithResponse(resourceGroupName, labName, virtualMachineName, name, schedule, Context.NONE) - .getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String virtualMachineName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List schedules in a given virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String virtualMachineName, + String expand, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -982,108 +736,58 @@ public ScheduleInner update(String resourceGroupName, String labName, String vir @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> executeWithResponseAsync(String resourceGroupName, String labName, String virtualMachineName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, virtualMachineName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, virtualMachineName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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>> executeWithResponseAsync(String resourceGroupName, String labName, - String virtualMachineName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - virtualMachineName, name, this.client.getApiVersion(), accept, context); + private Response executeWithResponse(String resourceGroupName, String labName, + String virtualMachineName, String name) { + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, virtualMachineName, name, Context.NONE); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is 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> beginExecuteAsync(String resourceGroupName, String labName, - String virtualMachineName, String name) { - Mono>> mono - = executeWithResponseAsync(resourceGroupName, labName, virtualMachineName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response executeWithResponse(String resourceGroupName, String labName, + String virtualMachineName, String name, Context context) { + return service.executeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, virtualMachineName, name, context); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1091,21 +795,20 @@ private PollerFlux, Void> beginExecuteAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync(String resourceGroupName, String labName, - String virtualMachineName, String name, Context context) { - context = this.client.mergeContext(context); + String virtualMachineName, String name) { Mono>> mono - = executeWithResponseAsync(resourceGroupName, labName, virtualMachineName, name, context); + = executeWithResponseAsync(resourceGroupName, labName, virtualMachineName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1114,16 +817,17 @@ private PollerFlux, Void> beginExecuteAsync(String resourceGrou @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String virtualMachineName, String name) { - return this.beginExecuteAsync(resourceGroupName, labName, virtualMachineName, name).getSyncPoller(); + Response response = executeWithResponse(resourceGroupName, labName, virtualMachineName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1133,16 +837,18 @@ public SyncPoller, Void> beginExecute(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String virtualMachineName, String name, Context context) { - return this.beginExecuteAsync(resourceGroupName, labName, virtualMachineName, name, context).getSyncPoller(); + Response response + = executeWithResponse(resourceGroupName, labName, virtualMachineName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1157,46 +863,26 @@ private Mono executeAsync(String resourceGroupName, String labName, String /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 executeAsync(String resourceGroupName, String labName, String virtualMachineName, String name, - Context context) { - return beginExecuteAsync(resourceGroupName, labName, virtualMachineName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a schedule. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 execute(String resourceGroupName, String labName, String virtualMachineName, String name) { - executeAsync(resourceGroupName, labName, virtualMachineName, name).block(); + beginExecute(resourceGroupName, labName, virtualMachineName, name).getFinalResult(); } /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1205,7 +891,7 @@ public void execute(String resourceGroupName, String labName, String virtualMach @ServiceMethod(returns = ReturnType.SINGLE) public void execute(String resourceGroupName, String labName, String virtualMachineName, String name, Context context) { - executeAsync(resourceGroupName, labName, virtualMachineName, name, context).block(); + beginExecute(resourceGroupName, labName, virtualMachineName, name, context).getFinalResult(); } /** @@ -1220,13 +906,6 @@ public void execute(String resourceGroupName, String labName, String virtualMach */ @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(), @@ -1234,6 +913,23 @@ private Mono> listNextSinglePageAsync(String nextLi .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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -1242,22 +938,13 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesImpl.java index bece0907cd82..c1bd8e182cac 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -28,28 +28,12 @@ public VirtualMachineSchedulesImpl(VirtualMachineSchedulesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName, String virtualMachineName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, virtualMachineName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String labName, String virtualMachineName, String name, String expand, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, labName, virtualMachineName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduleImpl(inner.getValue(), this.manager())); } public Schedule get(String resourceGroupName, String labName, String virtualMachineName, String name) { @@ -65,12 +49,8 @@ public Response createOrUpdateWithResponse(String resourceGroupName, S String virtualMachineName, String name, ScheduleInner schedule, Context context) { Response inner = this.serviceClient() .createOrUpdateWithResponse(resourceGroupName, labName, virtualMachineName, name, schedule, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduleImpl(inner.getValue(), this.manager())); } public Schedule createOrUpdate(String resourceGroupName, String labName, String virtualMachineName, String name, @@ -84,25 +64,12 @@ public Schedule createOrUpdate(String resourceGroupName, String labName, String } } - public Response deleteWithResponse(String resourceGroupName, String labName, String virtualMachineName, - String name, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, labName, virtualMachineName, name, context); - } - - public void delete(String resourceGroupName, String labName, String virtualMachineName, String name) { - this.serviceClient().delete(resourceGroupName, labName, virtualMachineName, name); - } - public Response updateWithResponse(String resourceGroupName, String labName, String virtualMachineName, String name, ScheduleFragment schedule, Context context) { Response inner = this.serviceClient() .updateWithResponse(resourceGroupName, labName, virtualMachineName, name, schedule, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScheduleImpl(inner.getValue(), this.manager())); } public Schedule update(String resourceGroupName, String labName, String virtualMachineName, String name, @@ -116,6 +83,27 @@ public Schedule update(String resourceGroupName, String labName, String virtualM } } + public Response deleteWithResponse(String resourceGroupName, String labName, String virtualMachineName, + String name, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, labName, virtualMachineName, name, context); + } + + public void delete(String resourceGroupName, String labName, String virtualMachineName, String name) { + this.serviceClient().delete(resourceGroupName, labName, virtualMachineName, name); + } + + public PagedIterable list(String resourceGroupName, String labName, String virtualMachineName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName, virtualMachineName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String virtualMachineName, + String expand, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + } + public void execute(String resourceGroupName, String labName, String virtualMachineName, String name) { this.serviceClient().execute(resourceGroupName, labName, virtualMachineName, name); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesClientImpl.java index 2bcf7808da97..635b0b8b9ba7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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.devtestlabs.implementation; @@ -29,6 +29,7 @@ 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.polling.PollerFlux; @@ -37,11 +38,11 @@ import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner; import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineInner; import com.azure.resourcemanager.devtestlabs.fluent.models.RdpConnectionInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.LabVirtualMachineList; import com.azure.resourcemanager.devtestlabs.models.ApplyArtifactsRequest; import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; import com.azure.resourcemanager.devtestlabs.models.DetachDataDiskProperties; import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineFragment; -import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineList; import com.azure.resourcemanager.devtestlabs.models.ResizeLabVirtualMachineProperties; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -59,419 +60,387 @@ public final class VirtualMachinesClientImpl implements VirtualMachinesClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of VirtualMachinesClientImpl. * * @param client the instance of the service client containing this operation class. */ - VirtualMachinesClientImpl(DevTestLabsClientImpl client) { + VirtualMachinesClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(VirtualMachinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientVirtualMachines to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientVirtualMachines to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientVir") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientVirtualMachines") public interface VirtualMachinesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LabVirtualMachineInner labVirtualMachine, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") LabVirtualMachineInner labVirtualMachine, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}") + @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("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") LabVirtualMachineInner labVirtualMachine, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") LabVirtualMachineFragment labVirtualMachine, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") LabVirtualMachineFragment labVirtualMachine, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}") + @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("labName") String labName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LabVirtualMachineFragment labVirtualMachine, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/addDataDisk") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> addDataDisk(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> addDataDisk(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DataDiskProperties dataDiskProperties, @HeaderParam("Accept") String accept, - Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") DataDiskProperties dataDiskProperties, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/addDataDisk") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response addDataDiskSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") DataDiskProperties dataDiskProperties, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/applyArtifacts") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> applyArtifacts(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> applyArtifacts(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ApplyArtifactsRequest applyArtifactsRequest, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ApplyArtifactsRequest applyArtifactsRequest, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/applyArtifacts") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response applyArtifactsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ApplyArtifactsRequest applyArtifactsRequest, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/claim") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> claim(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> claim(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/claim") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response claimSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/detachDataDisk") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> detachDataDisk(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") DetachDataDiskProperties detachDataDiskProperties, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/detachDataDisk") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> detachDataDisk(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response detachDataDiskSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") DetachDataDiskProperties detachDataDiskProperties, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/getRdpFileContents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getRdpFileContents(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DetachDataDiskProperties detachDataDiskProperties, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/getRdpFileContents") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getRdpFileContents(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getRdpFileContentsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/listApplicableSchedules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listApplicableSchedules(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listApplicableSchedules(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/listApplicableSchedules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listApplicableSchedulesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/redeploy") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> redeploy(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> redeploy(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/redeploy") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response redeploySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/resize") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> resize(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> resize(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/resize") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response resizeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/restart") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> restart(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/restart") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response restartSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/start") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> start(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/start") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response startSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/stop") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> stop(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/stop") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response stopSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/transferDisks") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> transferDisks(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> transferDisks(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/transferDisks") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response transferDisksSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/unClaim") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> unClaim(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/unClaim") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> unClaim(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response unClaimSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, 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); - /** - * List virtual machines in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: - * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List virtual machines in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: - * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, expand, - filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List virtual machines in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: - * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List virtual machines in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List virtual machines in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: - * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List virtual machines in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); - } - - /** - * List virtual machines in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: - * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, 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); } /** * Get virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param expand Specify the $expand query. Example: @@ -484,76 +453,17 @@ public PagedIterable list(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get virtual machine. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param expand Specify the $expand query. Example: - * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual machine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get virtual machine. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -571,7 +481,7 @@ private Mono getAsync(String resourceGroupName, String l /** * Get virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param expand Specify the $expand query. Example: @@ -585,13 +495,15 @@ private Mono getAsync(String resourceGroupName, String l @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, name, expand, accept, context); } /** * Get virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -608,7 +520,7 @@ public LabVirtualMachineInner get(String resourceGroupName, String labName, Stri /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A virtual machine. @@ -620,113 +532,67 @@ public LabVirtualMachineInner get(String resourceGroupName, String labName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (labVirtualMachine == null) { - return Mono - .error(new IllegalArgumentException("Parameter labVirtualMachine is required and cannot be null.")); - } else { - labVirtualMachine.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), labVirtualMachine, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, + labVirtualMachine, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A 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 virtual machine along with {@link Response} on successful completion of {@link Mono}. + * @return a virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String name, LabVirtualMachineInner labVirtualMachine, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (labVirtualMachine == null) { - return Mono - .error(new IllegalArgumentException("Parameter labVirtualMachine is required and cannot be null.")); - } else { - labVirtualMachine.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + LabVirtualMachineInner labVirtualMachine) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), labVirtualMachine, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, labVirtualMachine, + Context.NONE); } /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A 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 the {@link PollerFlux} for polling of a virtual machine. + * @return a virtual machine along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LabVirtualMachineInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, labVirtualMachine); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), LabVirtualMachineInner.class, LabVirtualMachineInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + LabVirtualMachineInner labVirtualMachine, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, labVirtualMachine, + context); } /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A 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. @@ -734,19 +600,18 @@ private PollerFlux, LabVirtualMachineInner> b */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LabVirtualMachineInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine, - Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, labVirtualMachine, context); + = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, labVirtualMachine); return this.client.getLroResult(mono, - this.client.getHttpPipeline(), LabVirtualMachineInner.class, LabVirtualMachineInner.class, context); + this.client.getHttpPipeline(), LabVirtualMachineInner.class, LabVirtualMachineInner.class, + this.client.getContext()); } /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A virtual machine. @@ -758,13 +623,15 @@ private PollerFlux, LabVirtualMachineInner> b @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LabVirtualMachineInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, name, labVirtualMachine).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, labName, name, labVirtualMachine); + return this.client.getLroResult(response, + LabVirtualMachineInner.class, LabVirtualMachineInner.class, Context.NONE); } /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A virtual machine. @@ -778,14 +645,16 @@ public SyncPoller, LabVirtualMachineInner> be public SyncPoller, LabVirtualMachineInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, name, labVirtualMachine, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, labName, name, labVirtualMachine, context); + return this.client.getLroResult(response, + LabVirtualMachineInner.class, LabVirtualMachineInner.class, context); } /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A virtual machine. @@ -804,30 +673,29 @@ private Mono createOrUpdateAsync(String resourceGroupNam /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A 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 virtual machine on successful completion of {@link Mono}. + * @return a virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String name, - LabVirtualMachineInner labVirtualMachine, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, name, labVirtualMachine, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public LabVirtualMachineInner createOrUpdate(String resourceGroupName, String labName, String name, + LabVirtualMachineInner labVirtualMachine) { + return beginCreateOrUpdate(resourceGroupName, labName, name, labVirtualMachine).getFinalResult(); } /** * Create or replace an existing virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A 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. @@ -835,14 +703,57 @@ private Mono createOrUpdateAsync(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.SINGLE) public LabVirtualMachineInner createOrUpdate(String resourceGroupName, String labName, String name, - LabVirtualMachineInner labVirtualMachine) { - return createOrUpdateAsync(resourceGroupName, labName, name, labVirtualMachine).block(); + LabVirtualMachineInner labVirtualMachine, Context context) { + return beginCreateOrUpdate(resourceGroupName, labName, name, labVirtualMachine, context).getFinalResult(); } /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Allows modifying tags of virtual machines. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the virtual machine. + * @param labVirtualMachine A virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, + String name, LabVirtualMachineFragment labVirtualMachine) { + 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, labName, name, contentType, accept, + labVirtualMachine, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows modifying tags of virtual machines. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the virtual machine. + * @param labVirtualMachine A virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, String name, + LabVirtualMachineFragment labVirtualMachine) { + return updateWithResponseAsync(resourceGroupName, labName, name, labVirtualMachine) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of virtual machines. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param labVirtualMachine A virtual machine. @@ -850,18 +761,40 @@ public LabVirtualMachineInner createOrUpdate(String resourceGroupName, String la * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String labName, String name, + LabVirtualMachineFragment labVirtualMachine, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, labVirtualMachine, + context); + } + + /** + * Allows modifying tags of virtual machines. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the virtual machine. + * @param labVirtualMachine A virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LabVirtualMachineInner createOrUpdate(String resourceGroupName, String labName, String name, - LabVirtualMachineInner labVirtualMachine, Context context) { - return createOrUpdateAsync(resourceGroupName, labName, name, labVirtualMachine, context).block(); + public LabVirtualMachineInner update(String resourceGroupName, String labName, String name, + LabVirtualMachineFragment labVirtualMachine) { + return updateWithResponse(resourceGroupName, labName, name, labVirtualMachine, Context.NONE).getValue(); } /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -872,113 +805,70 @@ public LabVirtualMachineInner createOrUpdate(String resourceGroupName, String la @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 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 labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String labName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, Context.NONE); } /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 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 labName, String name) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); - 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 labName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -988,13 +878,14 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { - return this.beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -1006,13 +897,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name, Context context) { - return this.beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1028,204 +920,203 @@ private Mono deleteAsync(String resourceGroupName, String labName, String /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, String name, Context context) { - return beginDeleteAsync(resourceGroupName, labName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String labName, String name) { + beginDelete(resourceGroupName, labName, name).getFinalResult(); } /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String name) { - deleteAsync(resourceGroupName, labName, name).block(); + public void delete(String resourceGroupName, String labName, String name, Context context) { + beginDelete(resourceGroupName, labName, name, context).getFinalResult(); } /** - * Delete virtual machine. This operation can take a while to complete. + * List virtual machines in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param context The context to associate with this operation. + * @param expand Specify the $expand query. Example: + * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String name, Context context) { - deleteAsync(resourceGroupName, labName, name, context).block(); + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, 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())); } /** - * Allows modifying tags of virtual machines. All other properties will be ignored. + * List virtual machines in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. + * @param expand Specify the $expand query. Example: + * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String name, LabVirtualMachineFragment labVirtualMachine) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (labVirtualMachine == null) { - return Mono - .error(new IllegalArgumentException("Parameter labVirtualMachine is required and cannot be null.")); - } else { - labVirtualMachine.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), labVirtualMachine, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of virtual machines. All other properties will be ignored. + * List virtual machines in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param labVirtualMachine A 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 virtual machine along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String name, LabVirtualMachineFragment labVirtualMachine, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (labVirtualMachine == null) { - return Mono - .error(new IllegalArgumentException("Parameter labVirtualMachine is required and cannot be null.")); - } else { - labVirtualMachine.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), labVirtualMachine, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of virtual machines. All other properties will be ignored. + * List virtual machines in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. + * @param expand Specify the $expand query. Example: + * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String name, - LabVirtualMachineFragment labVirtualMachine) { - return updateWithResponseAsync(resourceGroupName, labName, name, labVirtualMachine) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, + String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of virtual machines. All other properties will be ignored. + * List virtual machines in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. + * @param expand Specify the $expand query. Example: + * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String name, - LabVirtualMachineFragment labVirtualMachine, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, name, labVirtualMachine, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, + String expand, String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of virtual machines. All other properties will be ignored. + * List virtual machines in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine. + * @return the response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List virtual machines in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: + * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabVirtualMachineInner update(String resourceGroupName, String labName, String name, - LabVirtualMachineFragment labVirtualMachine) { - return updateWithResponse(resourceGroupName, labName, name, labVirtualMachine, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a virtual machine. @@ -1237,112 +1128,64 @@ public LabVirtualMachineInner update(String resourceGroupName, String labName, S @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> addDataDiskWithResponseAsync(String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (dataDiskProperties == null) { - return Mono - .error(new IllegalArgumentException("Parameter dataDiskProperties is required and cannot be null.")); - } else { - dataDiskProperties.validate(); - } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.addDataDisk(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), dataDiskProperties, accept, context)) + .withContext(context -> service.addDataDisk(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, dataDiskProperties, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> addDataDiskWithResponseAsync(String resourceGroupName, String labName, - String name, DataDiskProperties dataDiskProperties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (dataDiskProperties == null) { - return Mono - .error(new IllegalArgumentException("Parameter dataDiskProperties is required and cannot be null.")); - } else { - dataDiskProperties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.addDataDisk(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), dataDiskProperties, accept, context); + private Response addDataDiskWithResponse(String resourceGroupName, String labName, String name, + DataDiskProperties dataDiskProperties) { + final String contentType = "application/json"; + return service.addDataDiskSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, dataDiskProperties, + Context.NONE); } /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a 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 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> beginAddDataDiskAsync(String resourceGroupName, String labName, - String name, DataDiskProperties dataDiskProperties) { - Mono>> mono - = addDataDiskWithResponseAsync(resourceGroupName, labName, name, dataDiskProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response addDataDiskWithResponse(String resourceGroupName, String labName, String name, + DataDiskProperties dataDiskProperties, Context context) { + final String contentType = "application/json"; + return service.addDataDiskSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, dataDiskProperties, + context); } /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a 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. @@ -1350,18 +1193,17 @@ private PollerFlux, Void> beginAddDataDiskAsync(String resource */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginAddDataDiskAsync(String resourceGroupName, String labName, - String name, DataDiskProperties dataDiskProperties, Context context) { - context = this.client.mergeContext(context); + String name, DataDiskProperties dataDiskProperties) { Mono>> mono - = addDataDiskWithResponseAsync(resourceGroupName, labName, name, dataDiskProperties, context); + = addDataDiskWithResponseAsync(resourceGroupName, labName, name, dataDiskProperties); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a virtual machine. @@ -1373,13 +1215,14 @@ private PollerFlux, Void> beginAddDataDiskAsync(String resource @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginAddDataDisk(String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties) { - return this.beginAddDataDiskAsync(resourceGroupName, labName, name, dataDiskProperties).getSyncPoller(); + Response response = addDataDiskWithResponse(resourceGroupName, labName, name, dataDiskProperties); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a virtual machine. @@ -1392,14 +1235,15 @@ public SyncPoller, Void> beginAddDataDisk(String resourceGroupN @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginAddDataDisk(String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties, Context context) { - return this.beginAddDataDiskAsync(resourceGroupName, labName, name, dataDiskProperties, context) - .getSyncPoller(); + Response response + = addDataDiskWithResponse(resourceGroupName, labName, name, dataDiskProperties, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a virtual machine. @@ -1418,27 +1262,7 @@ private Mono addDataDiskAsync(String resourceGroupName, String labName, St /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param dataDiskProperties Request body for adding a new or existing data disk to a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono addDataDiskAsync(String resourceGroupName, String labName, String name, - DataDiskProperties dataDiskProperties, Context context) { - return beginAddDataDiskAsync(resourceGroupName, labName, name, dataDiskProperties, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a virtual machine. @@ -1449,13 +1273,13 @@ private Mono addDataDiskAsync(String resourceGroupName, String labName, St @ServiceMethod(returns = ReturnType.SINGLE) public void addDataDisk(String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties) { - addDataDiskAsync(resourceGroupName, labName, name, dataDiskProperties).block(); + beginAddDataDisk(resourceGroupName, labName, name, dataDiskProperties).getFinalResult(); } /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a virtual machine. @@ -1467,13 +1291,13 @@ public void addDataDisk(String resourceGroupName, String labName, String name, @ServiceMethod(returns = ReturnType.SINGLE) public void addDataDisk(String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties, Context context) { - addDataDiskAsync(resourceGroupName, labName, name, dataDiskProperties, context).block(); + beginAddDataDisk(resourceGroupName, labName, name, dataDiskProperties, context).getFinalResult(); } /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a virtual machine. @@ -1485,112 +1309,64 @@ public void addDataDisk(String resourceGroupName, String labName, String name, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> applyArtifactsWithResponseAsync(String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (applyArtifactsRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter applyArtifactsRequest is required and cannot be null.")); - } else { - applyArtifactsRequest.validate(); - } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.applyArtifacts(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), applyArtifactsRequest, accept, context)) + .withContext(context -> service.applyArtifacts(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, applyArtifactsRequest, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> applyArtifactsWithResponseAsync(String resourceGroupName, String labName, - String name, ApplyArtifactsRequest applyArtifactsRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (applyArtifactsRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter applyArtifactsRequest is required and cannot be null.")); - } else { - applyArtifactsRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.applyArtifacts(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), applyArtifactsRequest, accept, context); + private Response applyArtifactsWithResponse(String resourceGroupName, String labName, String name, + ApplyArtifactsRequest applyArtifactsRequest) { + final String contentType = "application/json"; + return service.applyArtifactsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, applyArtifactsRequest, + Context.NONE); } /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a 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 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> beginApplyArtifactsAsync(String resourceGroupName, String labName, - String name, ApplyArtifactsRequest applyArtifactsRequest) { - Mono>> mono - = applyArtifactsWithResponseAsync(resourceGroupName, labName, name, applyArtifactsRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response applyArtifactsWithResponse(String resourceGroupName, String labName, String name, + ApplyArtifactsRequest applyArtifactsRequest, Context context) { + final String contentType = "application/json"; + return service.applyArtifactsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, applyArtifactsRequest, + context); } /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a 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. @@ -1598,18 +1374,17 @@ private PollerFlux, Void> beginApplyArtifactsAsync(String resou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginApplyArtifactsAsync(String resourceGroupName, String labName, - String name, ApplyArtifactsRequest applyArtifactsRequest, Context context) { - context = this.client.mergeContext(context); + String name, ApplyArtifactsRequest applyArtifactsRequest) { Mono>> mono - = applyArtifactsWithResponseAsync(resourceGroupName, labName, name, applyArtifactsRequest, context); + = applyArtifactsWithResponseAsync(resourceGroupName, labName, name, applyArtifactsRequest); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a virtual machine. @@ -1621,13 +1396,15 @@ private PollerFlux, Void> beginApplyArtifactsAsync(String resou @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginApplyArtifacts(String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest) { - return this.beginApplyArtifactsAsync(resourceGroupName, labName, name, applyArtifactsRequest).getSyncPoller(); + Response response + = applyArtifactsWithResponse(resourceGroupName, labName, name, applyArtifactsRequest); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a virtual machine. @@ -1640,14 +1417,15 @@ public SyncPoller, Void> beginApplyArtifacts(String resourceGro @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginApplyArtifacts(String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest, Context context) { - return this.beginApplyArtifactsAsync(resourceGroupName, labName, name, applyArtifactsRequest, context) - .getSyncPoller(); + Response response + = applyArtifactsWithResponse(resourceGroupName, labName, name, applyArtifactsRequest, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a virtual machine. @@ -1666,27 +1444,7 @@ private Mono applyArtifactsAsync(String resourceGroupName, String labName, /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param applyArtifactsRequest Request body for applying artifacts to a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono applyArtifactsAsync(String resourceGroupName, String labName, String name, - ApplyArtifactsRequest applyArtifactsRequest, Context context) { - return beginApplyArtifactsAsync(resourceGroupName, labName, name, applyArtifactsRequest, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Apply artifacts to virtual machine. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a virtual machine. @@ -1697,13 +1455,13 @@ private Mono applyArtifactsAsync(String resourceGroupName, String labName, @ServiceMethod(returns = ReturnType.SINGLE) public void applyArtifacts(String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest) { - applyArtifactsAsync(resourceGroupName, labName, name, applyArtifactsRequest).block(); + beginApplyArtifacts(resourceGroupName, labName, name, applyArtifactsRequest).getFinalResult(); } /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a virtual machine. @@ -1715,13 +1473,13 @@ public void applyArtifacts(String resourceGroupName, String labName, String name @ServiceMethod(returns = ReturnType.SINGLE) public void applyArtifacts(String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest, Context context) { - applyArtifactsAsync(resourceGroupName, labName, name, applyArtifactsRequest, context).block(); + beginApplyArtifacts(resourceGroupName, labName, name, applyArtifactsRequest, context).getFinalResult(); } /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1732,113 +1490,70 @@ public void applyArtifacts(String resourceGroupName, String labName, String name @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> claimWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.claim(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.claim(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> claimWithResponseAsync(String resourceGroupName, String labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.claim(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + private Response claimWithResponse(String resourceGroupName, String labName, String name) { + return service.claimSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, Context.NONE); } /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 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> beginClaimAsync(String resourceGroupName, String labName, String name) { - Mono>> mono = claimWithResponseAsync(resourceGroupName, labName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response claimWithResponse(String resourceGroupName, String labName, String name, + Context context) { + return service.claimSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginClaimAsync(String resourceGroupName, String labName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = claimWithResponseAsync(resourceGroupName, labName, name, context); + private PollerFlux, Void> beginClaimAsync(String resourceGroupName, String labName, String name) { + Mono>> mono = claimWithResponseAsync(resourceGroupName, labName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1848,13 +1563,14 @@ private PollerFlux, Void> beginClaimAsync(String resourceGroupN */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaim(String resourceGroupName, String labName, String name) { - return this.beginClaimAsync(resourceGroupName, labName, name).getSyncPoller(); + Response response = claimWithResponse(resourceGroupName, labName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -1866,13 +1582,14 @@ public SyncPoller, Void> beginClaim(String resourceGroupName, S @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaim(String resourceGroupName, String labName, String name, Context context) { - return this.beginClaimAsync(resourceGroupName, labName, name, context).getSyncPoller(); + Response response = claimWithResponse(resourceGroupName, labName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1888,25 +1605,7 @@ private Mono claimAsync(String resourceGroupName, String labName, String n /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono claimAsync(String resourceGroupName, String labName, String name, Context context) { - return beginClaimAsync(resourceGroupName, labName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Take ownership of an existing virtual machine This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1915,13 +1614,13 @@ private Mono claimAsync(String resourceGroupName, String labName, String n */ @ServiceMethod(returns = ReturnType.SINGLE) public void claim(String resourceGroupName, String labName, String name) { - claimAsync(resourceGroupName, labName, name).block(); + beginClaim(resourceGroupName, labName, name).getFinalResult(); } /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -1931,13 +1630,13 @@ public void claim(String resourceGroupName, String labName, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void claim(String resourceGroupName, String labName, String name, Context context) { - claimAsync(resourceGroupName, labName, name, context).block(); + beginClaim(resourceGroupName, labName, name, context).getFinalResult(); } /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a virtual machine. @@ -1949,113 +1648,64 @@ public void claim(String resourceGroupName, String labName, String name, Context @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> detachDataDiskWithResponseAsync(String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (detachDataDiskProperties == null) { - return Mono.error( - new IllegalArgumentException("Parameter detachDataDiskProperties is required and cannot be null.")); - } else { - detachDataDiskProperties.validate(); - } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.detachDataDisk(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), detachDataDiskProperties, accept, - context)) + .withContext(context -> service.detachDataDisk(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, + detachDataDiskProperties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> detachDataDiskWithResponseAsync(String resourceGroupName, String labName, - String name, DetachDataDiskProperties detachDataDiskProperties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (detachDataDiskProperties == null) { - return Mono.error( - new IllegalArgumentException("Parameter detachDataDiskProperties is required and cannot be null.")); - } else { - detachDataDiskProperties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.detachDataDisk(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), detachDataDiskProperties, accept, context); + private Response detachDataDiskWithResponse(String resourceGroupName, String labName, String name, + DetachDataDiskProperties detachDataDiskProperties) { + final String contentType = "application/json"; + return service.detachDataDiskSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, detachDataDiskProperties, + Context.NONE); } /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a 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 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> beginDetachDataDiskAsync(String resourceGroupName, String labName, - String name, DetachDataDiskProperties detachDataDiskProperties) { - Mono>> mono - = detachDataDiskWithResponseAsync(resourceGroupName, labName, name, detachDataDiskProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response detachDataDiskWithResponse(String resourceGroupName, String labName, String name, + DetachDataDiskProperties detachDataDiskProperties, Context context) { + final String contentType = "application/json"; + return service.detachDataDiskSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, detachDataDiskProperties, + context); } /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a 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. @@ -2063,18 +1713,17 @@ private PollerFlux, Void> beginDetachDataDiskAsync(String resou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDetachDataDiskAsync(String resourceGroupName, String labName, - String name, DetachDataDiskProperties detachDataDiskProperties, Context context) { - context = this.client.mergeContext(context); + String name, DetachDataDiskProperties detachDataDiskProperties) { Mono>> mono - = detachDataDiskWithResponseAsync(resourceGroupName, labName, name, detachDataDiskProperties, context); + = detachDataDiskWithResponseAsync(resourceGroupName, labName, name, detachDataDiskProperties); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a virtual machine. @@ -2086,14 +1735,15 @@ private PollerFlux, Void> beginDetachDataDiskAsync(String resou @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDetachDataDisk(String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties) { - return this.beginDetachDataDiskAsync(resourceGroupName, labName, name, detachDataDiskProperties) - .getSyncPoller(); + Response response + = detachDataDiskWithResponse(resourceGroupName, labName, name, detachDataDiskProperties); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a virtual machine. @@ -2106,14 +1756,15 @@ public SyncPoller, Void> beginDetachDataDisk(String resourceGro @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDetachDataDisk(String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties, Context context) { - return this.beginDetachDataDiskAsync(resourceGroupName, labName, name, detachDataDiskProperties, context) - .getSyncPoller(); + Response response + = detachDataDiskWithResponse(resourceGroupName, labName, name, detachDataDiskProperties, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a virtual machine. @@ -2132,27 +1783,7 @@ private Mono detachDataDiskAsync(String resourceGroupName, String labName, /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param detachDataDiskProperties Request body for detaching data disk from a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono detachDataDiskAsync(String resourceGroupName, String labName, String name, - DetachDataDiskProperties detachDataDiskProperties, Context context) { - return beginDetachDataDiskAsync(resourceGroupName, labName, name, detachDataDiskProperties, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Detach the specified disk from the virtual machine. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a virtual machine. @@ -2163,13 +1794,13 @@ private Mono detachDataDiskAsync(String resourceGroupName, String labName, @ServiceMethod(returns = ReturnType.SINGLE) public void detachDataDisk(String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties) { - detachDataDiskAsync(resourceGroupName, labName, name, detachDataDiskProperties).block(); + beginDetachDataDisk(resourceGroupName, labName, name, detachDataDiskProperties).getFinalResult(); } /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a virtual machine. @@ -2181,13 +1812,13 @@ public void detachDataDisk(String resourceGroupName, String labName, String name @ServiceMethod(returns = ReturnType.SINGLE) public void detachDataDisk(String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties, Context context) { - detachDataDiskAsync(resourceGroupName, labName, name, detachDataDiskProperties, context).block(); + beginDetachDataDisk(resourceGroupName, labName, name, detachDataDiskProperties, context).getFinalResult(); } /** * Gets a string that represents the contents of the RDP file for the virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2199,76 +1830,17 @@ public void detachDataDisk(String resourceGroupName, String labName, String name @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getRdpFileContentsWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getRdpFileContents(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getRdpFileContents(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a string that represents the contents of the RDP file for the virtual machine. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name 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 string that represents the contents of the RDP file for the virtual machine along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getRdpFileContentsWithResponseAsync(String resourceGroupName, - String labName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getRdpFileContents(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a string that represents the contents of the RDP file for the virtual machine. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2286,7 +1858,7 @@ private Mono getRdpFileContentsAsync(String resourceGroupNam /** * Gets a string that represents the contents of the RDP file for the virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -2299,13 +1871,15 @@ private Mono getRdpFileContentsAsync(String resourceGroupNam @ServiceMethod(returns = ReturnType.SINGLE) public Response getRdpFileContentsWithResponse(String resourceGroupName, String labName, String name, Context context) { - return getRdpFileContentsWithResponseAsync(resourceGroupName, labName, name, context).block(); + final String accept = "application/json"; + return service.getRdpFileContentsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, accept, context); } /** * Gets a string that represents the contents of the RDP file for the virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2321,7 +1895,7 @@ public RdpConnectionInner getRdpFileContents(String resourceGroupName, String la /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2333,76 +1907,18 @@ public RdpConnectionInner getRdpFileContents(String resourceGroupName, String la @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listApplicableSchedulesWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listApplicableSchedules(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + context -> service.listApplicableSchedules(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name 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 schedules applicable to a virtual machine along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listApplicableSchedulesWithResponseAsync(String resourceGroupName, - String labName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listApplicableSchedules(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context); - } - - /** - * Lists the applicable start/stop schedules, if any. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2420,7 +1936,7 @@ private Mono listApplicableSchedulesAsync(String resour /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -2432,13 +1948,15 @@ private Mono listApplicableSchedulesAsync(String resour @ServiceMethod(returns = ReturnType.SINGLE) public Response listApplicableSchedulesWithResponse(String resourceGroupName, String labName, String name, Context context) { - return listApplicableSchedulesWithResponseAsync(resourceGroupName, labName, name, context).block(); + final String accept = "application/json"; + return service.listApplicableSchedulesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, accept, context); } /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2454,7 +1972,7 @@ public ApplicableScheduleInner listApplicableSchedules(String resourceGroupName, /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2465,114 +1983,71 @@ public ApplicableScheduleInner listApplicableSchedules(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> redeployWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.redeploy(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.redeploy(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> redeployWithResponseAsync(String resourceGroupName, String labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.redeploy(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + private Response redeployWithResponse(String resourceGroupName, String labName, String name) { + return service.redeploySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, Context.NONE); } /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 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> beginRedeployAsync(String resourceGroupName, String labName, - String name) { - Mono>> mono = redeployWithResponseAsync(resourceGroupName, labName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response redeployWithResponse(String resourceGroupName, String labName, String name, + Context context) { + return service.redeploySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRedeployAsync(String resourceGroupName, String labName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = redeployWithResponseAsync(resourceGroupName, labName, name, context); + private PollerFlux, Void> beginRedeployAsync(String resourceGroupName, String labName, + String name) { + Mono>> mono = redeployWithResponseAsync(resourceGroupName, labName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2582,66 +2057,50 @@ private PollerFlux, Void> beginRedeployAsync(String resourceGro */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRedeploy(String resourceGroupName, String labName, String name) { - return this.beginRedeployAsync(resourceGroupName, labName, name).getSyncPoller(); - } - - /** - * Redeploy a virtual machine This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name 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 the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRedeploy(String resourceGroupName, String labName, String name, - Context context) { - return this.beginRedeployAsync(resourceGroupName, labName, name, context).getSyncPoller(); + Response response = redeployWithResponse(resourceGroupName, labName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 {@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 redeployAsync(String resourceGroupName, String labName, String name) { - return beginRedeployAsync(resourceGroupName, labName, name).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRedeploy(String resourceGroupName, String labName, String name, + Context context) { + Response response = redeployWithResponse(resourceGroupName, labName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono redeployAsync(String resourceGroupName, String labName, String name, Context context) { - return beginRedeployAsync(resourceGroupName, labName, name, context).last() + private Mono redeployAsync(String resourceGroupName, String labName, String name) { + return beginRedeployAsync(resourceGroupName, labName, name).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2650,13 +2109,13 @@ private Mono redeployAsync(String resourceGroupName, String labName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) public void redeploy(String resourceGroupName, String labName, String name) { - redeployAsync(resourceGroupName, labName, name).block(); + beginRedeploy(resourceGroupName, labName, name).getFinalResult(); } /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -2666,13 +2125,13 @@ public void redeploy(String resourceGroupName, String labName, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void redeploy(String resourceGroupName, String labName, String name, Context context) { - redeployAsync(resourceGroupName, labName, name, context).block(); + beginRedeploy(resourceGroupName, labName, name, context).getFinalResult(); } /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a virtual machine. @@ -2684,113 +2143,64 @@ public void redeploy(String resourceGroupName, String labName, String name, Cont @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> resizeWithResponseAsync(String resourceGroupName, String labName, String name, ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (resizeLabVirtualMachineProperties == null) { - return Mono.error(new IllegalArgumentException( - "Parameter resizeLabVirtualMachineProperties is required and cannot be null.")); - } else { - resizeLabVirtualMachineProperties.validate(); - } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext( - context -> service.resize(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), resizeLabVirtualMachineProperties, accept, context)) + .withContext(context -> service.resize(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, + resizeLabVirtualMachineProperties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resizeWithResponseAsync(String resourceGroupName, String labName, - String name, ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (resizeLabVirtualMachineProperties == null) { - return Mono.error(new IllegalArgumentException( - "Parameter resizeLabVirtualMachineProperties is required and cannot be null.")); - } else { - resizeLabVirtualMachineProperties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.resize(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), resizeLabVirtualMachineProperties, accept, context); + private Response resizeWithResponse(String resourceGroupName, String labName, String name, + ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties) { + final String contentType = "application/json"; + return service.resizeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, + resizeLabVirtualMachineProperties, Context.NONE); } /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a 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 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> beginResizeAsync(String resourceGroupName, String labName, String name, - ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties) { - Mono>> mono - = resizeWithResponseAsync(resourceGroupName, labName, name, resizeLabVirtualMachineProperties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resizeWithResponse(String resourceGroupName, String labName, String name, + ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties, Context context) { + final String contentType = "application/json"; + return service.resizeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, + resizeLabVirtualMachineProperties, context); } /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a 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. @@ -2798,18 +2208,17 @@ private PollerFlux, Void> beginResizeAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginResizeAsync(String resourceGroupName, String labName, String name, - ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties, Context context) { - context = this.client.mergeContext(context); + ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties) { Mono>> mono - = resizeWithResponseAsync(resourceGroupName, labName, name, resizeLabVirtualMachineProperties, context); + = resizeWithResponseAsync(resourceGroupName, labName, name, resizeLabVirtualMachineProperties); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a virtual machine. @@ -2821,14 +2230,15 @@ private PollerFlux, Void> beginResizeAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginResize(String resourceGroupName, String labName, String name, ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties) { - return this.beginResizeAsync(resourceGroupName, labName, name, resizeLabVirtualMachineProperties) - .getSyncPoller(); + Response response + = resizeWithResponse(resourceGroupName, labName, name, resizeLabVirtualMachineProperties); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a virtual machine. @@ -2841,14 +2251,15 @@ public SyncPoller, Void> beginResize(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginResize(String resourceGroupName, String labName, String name, ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties, Context context) { - return this.beginResizeAsync(resourceGroupName, labName, name, resizeLabVirtualMachineProperties, context) - .getSyncPoller(); + Response response + = resizeWithResponse(resourceGroupName, labName, name, resizeLabVirtualMachineProperties, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a virtual machine. @@ -2867,27 +2278,7 @@ private Mono resizeAsync(String resourceGroupName, String labName, String /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the virtual machine. - * @param resizeLabVirtualMachineProperties Request body for resizing a 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resizeAsync(String resourceGroupName, String labName, String name, - ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties, Context context) { - return beginResizeAsync(resourceGroupName, labName, name, resizeLabVirtualMachineProperties, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resize Virtual Machine. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a virtual machine. @@ -2898,13 +2289,13 @@ private Mono resizeAsync(String resourceGroupName, String labName, String @ServiceMethod(returns = ReturnType.SINGLE) public void resize(String resourceGroupName, String labName, String name, ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties) { - resizeAsync(resourceGroupName, labName, name, resizeLabVirtualMachineProperties).block(); + beginResize(resourceGroupName, labName, name, resizeLabVirtualMachineProperties).getFinalResult(); } /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a virtual machine. @@ -2916,13 +2307,13 @@ public void resize(String resourceGroupName, String labName, String name, @ServiceMethod(returns = ReturnType.SINGLE) public void resize(String resourceGroupName, String labName, String name, ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties, Context context) { - resizeAsync(resourceGroupName, labName, name, resizeLabVirtualMachineProperties, context).block(); + beginResize(resourceGroupName, labName, name, resizeLabVirtualMachineProperties, context).getFinalResult(); } /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2933,114 +2324,71 @@ public void resize(String resourceGroupName, String labName, String name, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> restartWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync(String resourceGroupName, String labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.restart(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + private Response restartWithResponse(String resourceGroupName, String labName, String name) { + return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, Context.NONE); } /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 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> beginRestartAsync(String resourceGroupName, String labName, - String name) { - Mono>> mono = restartWithResponseAsync(resourceGroupName, labName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response restartWithResponse(String resourceGroupName, String labName, String name, + Context context) { + return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String labName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = restartWithResponseAsync(resourceGroupName, labName, name, context); + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String labName, + String name) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, labName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3050,13 +2398,14 @@ private PollerFlux, Void> beginRestartAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRestart(String resourceGroupName, String labName, String name) { - return this.beginRestartAsync(resourceGroupName, labName, name).getSyncPoller(); + Response response = restartWithResponse(resourceGroupName, labName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -3068,13 +2417,14 @@ public SyncPoller, Void> beginRestart(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRestart(String resourceGroupName, String labName, String name, Context context) { - return this.beginRestartAsync(resourceGroupName, labName, name, context).getSyncPoller(); + Response response = restartWithResponse(resourceGroupName, labName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3091,25 +2441,7 @@ private Mono restartAsync(String resourceGroupName, String labName, String /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync(String resourceGroupName, String labName, String name, Context context) { - return beginRestartAsync(resourceGroupName, labName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restart a virtual machine. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3118,13 +2450,13 @@ private Mono restartAsync(String resourceGroupName, String labName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public void restart(String resourceGroupName, String labName, String name) { - restartAsync(resourceGroupName, labName, name).block(); + beginRestart(resourceGroupName, labName, name).getFinalResult(); } /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -3134,13 +2466,13 @@ public void restart(String resourceGroupName, String labName, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void restart(String resourceGroupName, String labName, String name, Context context) { - restartAsync(resourceGroupName, labName, name, context).block(); + beginRestart(resourceGroupName, labName, name, context).getFinalResult(); } /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3151,113 +2483,70 @@ public void restart(String resourceGroupName, String labName, String name, Conte @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync(String resourceGroupName, String labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + private Response startWithResponse(String resourceGroupName, String labName, String name) { + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, Context.NONE); } /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 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> beginStartAsync(String resourceGroupName, String labName, String name) { - Mono>> mono = startWithResponseAsync(resourceGroupName, labName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String resourceGroupName, String labName, String name, + Context context) { + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync(String resourceGroupName, String labName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = startWithResponseAsync(resourceGroupName, labName, name, context); + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String labName, String name) { + Mono>> mono = startWithResponseAsync(resourceGroupName, labName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3267,13 +2556,14 @@ private PollerFlux, Void> beginStartAsync(String resourceGroupN */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStart(String resourceGroupName, String labName, String name) { - return this.beginStartAsync(resourceGroupName, labName, name).getSyncPoller(); + Response response = startWithResponse(resourceGroupName, labName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -3285,13 +2575,14 @@ public SyncPoller, Void> beginStart(String resourceGroupName, S @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStart(String resourceGroupName, String labName, String name, Context context) { - return this.beginStartAsync(resourceGroupName, labName, name, context).getSyncPoller(); + Response response = startWithResponse(resourceGroupName, labName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3307,25 +2598,7 @@ private Mono startAsync(String resourceGroupName, String labName, String n /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String labName, String name, Context context) { - return beginStartAsync(resourceGroupName, labName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start a virtual machine. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3334,13 +2607,13 @@ private Mono startAsync(String resourceGroupName, String labName, String n */ @ServiceMethod(returns = ReturnType.SINGLE) public void start(String resourceGroupName, String labName, String name) { - startAsync(resourceGroupName, labName, name).block(); + beginStart(resourceGroupName, labName, name).getFinalResult(); } /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -3350,13 +2623,13 @@ public void start(String resourceGroupName, String labName, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void start(String resourceGroupName, String labName, String name, Context context) { - startAsync(resourceGroupName, labName, name, context).block(); + beginStart(resourceGroupName, labName, name, context).getFinalResult(); } /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3367,113 +2640,70 @@ public void start(String resourceGroupName, String labName, String name, Context @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> stopWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync(String resourceGroupName, String labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + private Response stopWithResponse(String resourceGroupName, String labName, String name) { + return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, name, Context.NONE); } /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 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> beginStopAsync(String resourceGroupName, String labName, String name) { - Mono>> mono = stopWithResponseAsync(resourceGroupName, labName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response stopWithResponse(String resourceGroupName, String labName, String name, + Context context) { + return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, name, context); } /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync(String resourceGroupName, String labName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = stopWithResponseAsync(resourceGroupName, labName, name, context); + private PollerFlux, Void> beginStopAsync(String resourceGroupName, String labName, String name) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, labName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3483,13 +2713,14 @@ private PollerFlux, Void> beginStopAsync(String resourceGroupNa */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStop(String resourceGroupName, String labName, String name) { - return this.beginStopAsync(resourceGroupName, labName, name).getSyncPoller(); + Response response = stopWithResponse(resourceGroupName, labName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -3501,13 +2732,14 @@ public SyncPoller, Void> beginStop(String resourceGroupName, St @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStop(String resourceGroupName, String labName, String name, Context context) { - return this.beginStopAsync(resourceGroupName, labName, name, context).getSyncPoller(); + Response response = stopWithResponse(resourceGroupName, labName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3523,25 +2755,7 @@ private Mono stopAsync(String resourceGroupName, String labName, String na /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String labName, String name, Context context) { - return beginStopAsync(resourceGroupName, labName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stop a virtual machine This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3550,13 +2764,13 @@ private Mono stopAsync(String resourceGroupName, String labName, String na */ @ServiceMethod(returns = ReturnType.SINGLE) public void stop(String resourceGroupName, String labName, String name) { - stopAsync(resourceGroupName, labName, name).block(); + beginStop(resourceGroupName, labName, name).getFinalResult(); } /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -3566,14 +2780,14 @@ public void stop(String resourceGroupName, String labName, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void stop(String resourceGroupName, String labName, String name, Context context) { - stopAsync(resourceGroupName, labName, name, context).block(); + beginStop(resourceGroupName, labName, name, context).getFinalResult(); } /** * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3584,28 +2798,9 @@ public void stop(String resourceGroupName, String labName, String name, Context @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> transferDisksWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.transferDisks(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.transferDisks(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3613,70 +2808,47 @@ private Mono>> transferDisksWithResponseAsync(String r * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> transferDisksWithResponseAsync(String resourceGroupName, String labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.transferDisks(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), accept, context); + private Response transferDisksWithResponse(String resourceGroupName, String labName, String name) { + return service.transferDisksSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, Context.NONE); } /** * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 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> beginTransferDisksAsync(String resourceGroupName, String labName, - String name) { - Mono>> mono = transferDisksWithResponseAsync(resourceGroupName, labName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response transferDisksWithResponse(String resourceGroupName, String labName, String name, + Context context) { + return service.transferDisksSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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. @@ -3684,19 +2856,17 @@ private PollerFlux, Void> beginTransferDisksAsync(String resour */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTransferDisksAsync(String resourceGroupName, String labName, - String name, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = transferDisksWithResponseAsync(resourceGroupName, labName, name, context); + String name) { + Mono>> mono = transferDisksWithResponseAsync(resourceGroupName, labName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3707,14 +2877,15 @@ private PollerFlux, Void> beginTransferDisksAsync(String resour @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTransferDisks(String resourceGroupName, String labName, String name) { - return this.beginTransferDisksAsync(resourceGroupName, labName, name).getSyncPoller(); + Response response = transferDisksWithResponse(resourceGroupName, labName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -3726,14 +2897,15 @@ public SyncPoller, Void> beginTransferDisks(String resourceGrou @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTransferDisks(String resourceGroupName, String labName, String name, Context context) { - return this.beginTransferDisksAsync(resourceGroupName, labName, name, context).getSyncPoller(); + Response response = transferDisksWithResponse(resourceGroupName, labName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3751,26 +2923,7 @@ private Mono transferDisksAsync(String resourceGroupName, String labName, * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono transferDisksAsync(String resourceGroupName, String labName, String name, Context context) { - return beginTransferDisksAsync(resourceGroupName, labName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take - * a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3779,14 +2932,14 @@ private Mono transferDisksAsync(String resourceGroupName, String labName, */ @ServiceMethod(returns = ReturnType.SINGLE) public void transferDisks(String resourceGroupName, String labName, String name) { - transferDisksAsync(resourceGroupName, labName, name).block(); + beginTransferDisks(resourceGroupName, labName, name).getFinalResult(); } /** * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -3796,13 +2949,13 @@ public void transferDisks(String resourceGroupName, String labName, String name) */ @ServiceMethod(returns = ReturnType.SINGLE) public void transferDisks(String resourceGroupName, String labName, String name, Context context) { - transferDisksAsync(resourceGroupName, labName, name, context).block(); + beginTransferDisks(resourceGroupName, labName, name, context).getFinalResult(); } /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3813,114 +2966,71 @@ public void transferDisks(String resourceGroupName, String labName, String name, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> unClaimWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.unClaim(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.unClaim(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> unClaimWithResponseAsync(String resourceGroupName, String labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.unClaim(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + private Response unClaimWithResponse(String resourceGroupName, String labName, String name) { + return service.unClaimSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, Context.NONE); } /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 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> beginUnClaimAsync(String resourceGroupName, String labName, - String name) { - Mono>> mono = unClaimWithResponseAsync(resourceGroupName, labName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response unClaimWithResponse(String resourceGroupName, String labName, String name, + Context context) { + return service.unClaimSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name 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 the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUnClaimAsync(String resourceGroupName, String labName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = unClaimWithResponseAsync(resourceGroupName, labName, name, context); + private PollerFlux, Void> beginUnClaimAsync(String resourceGroupName, String labName, + String name) { + Mono>> mono = unClaimWithResponseAsync(resourceGroupName, labName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3930,13 +3040,14 @@ private PollerFlux, Void> beginUnClaimAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUnClaim(String resourceGroupName, String labName, String name) { - return this.beginUnClaimAsync(resourceGroupName, labName, name).getSyncPoller(); + Response response = unClaimWithResponse(resourceGroupName, labName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -3948,13 +3059,14 @@ public SyncPoller, Void> beginUnClaim(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUnClaim(String resourceGroupName, String labName, String name, Context context) { - return this.beginUnClaimAsync(resourceGroupName, labName, name, context).getSyncPoller(); + Response response = unClaimWithResponse(resourceGroupName, labName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3971,25 +3083,7 @@ private Mono unClaimAsync(String resourceGroupName, String labName, String /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono unClaimAsync(String resourceGroupName, String labName, String name, Context context) { - return beginUnClaimAsync(resourceGroupName, labName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Release ownership of an existing virtual machine This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3998,13 +3092,13 @@ private Mono unClaimAsync(String resourceGroupName, String labName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public void unClaim(String resourceGroupName, String labName, String name) { - unClaimAsync(resourceGroupName, labName, name).block(); + beginUnClaim(resourceGroupName, labName, name).getFinalResult(); } /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -4014,7 +3108,7 @@ public void unClaim(String resourceGroupName, String labName, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void unClaim(String resourceGroupName, String labName, String name, Context context) { - unClaimAsync(resourceGroupName, labName, name, context).block(); + beginUnClaim(resourceGroupName, labName, name, context).getFinalResult(); } /** @@ -4029,13 +3123,6 @@ public void unClaim(String resourceGroupName, String labName, String name, Conte */ @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(), @@ -4043,6 +3130,24 @@ 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -4051,22 +3156,14 @@ 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesImpl.java index d8183052f084..166c230cd053 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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.devtestlabs.implementation; @@ -35,28 +35,12 @@ public VirtualMachinesImpl(VirtualMachinesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new LabVirtualMachineImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new LabVirtualMachineImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new LabVirtualMachineImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LabVirtualMachineImpl(inner.getValue(), this.manager())); } public LabVirtualMachine get(String resourceGroupName, String labName, String name) { @@ -76,6 +60,18 @@ public void delete(String resourceGroupName, String labName, String name, Contex this.serviceClient().delete(resourceGroupName, labName, name, context); } + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LabVirtualMachineImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LabVirtualMachineImpl(inner1, this.manager())); + } + public void addDataDisk(String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties) { this.serviceClient().addDataDisk(resourceGroupName, labName, name, dataDiskProperties); @@ -118,12 +114,8 @@ public Response getRdpFileContentsWithResponse(String resourceGro Context context) { Response inner = this.serviceClient().getRdpFileContentsWithResponse(resourceGroupName, labName, name, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RdpConnectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RdpConnectionImpl(inner.getValue(), this.manager())); } public RdpConnection getRdpFileContents(String resourceGroupName, String labName, String name) { @@ -139,12 +131,8 @@ public Response listApplicableSchedulesWithResponse(String r String name, Context context) { Response inner = this.serviceClient().listApplicableSchedulesWithResponse(resourceGroupName, labName, name, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicableScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApplicableScheduleImpl(inner.getValue(), this.manager())); } public ApplicableSchedule listApplicableSchedules(String resourceGroupName, String labName, String name) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworkImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworkImpl.java index 8691e847745a..cf58b82204f3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworkImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworkImpl.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.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.VirtualNetworkInner; import com.azure.resourcemanager.devtestlabs.models.ExternalSubnet; @@ -34,10 +35,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -47,6 +44,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public List allowedSubnets() { List inner = this.innerModel().allowedSubnets(); if (inner != null) { @@ -237,6 +242,6 @@ public VirtualNetworkImpl withSubnetOverrides(List subnetOverrid } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksClientImpl.java index 0a4f465b876e..207c317bcfcb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -28,14 +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.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.VirtualNetworksClient; import com.azure.resourcemanager.devtestlabs.fluent.models.VirtualNetworkInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.VirtualNetworkList; import com.azure.resourcemanager.devtestlabs.models.VirtualNetworkFragment; -import com.azure.resourcemanager.devtestlabs.models.VirtualNetworkList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -52,280 +53,143 @@ public final class VirtualNetworksClientImpl implements VirtualNetworksClient { /** * The service client containing this operation class. */ - private final DevTestLabsClientImpl client; + private final DevTestLabsManagementClientImpl client; /** * Initializes an instance of VirtualNetworksClientImpl. * * @param client the instance of the service client containing this operation class. */ - VirtualNetworksClientImpl(DevTestLabsClientImpl client) { + VirtualNetworksClientImpl(DevTestLabsManagementClientImpl client) { this.service = RestProxy.create(VirtualNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DevTestLabsClientVirtualNetworks to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for DevTestLabsManagementClientVirtualNetworks to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DevTestLabsClientVir") + @Host("{endpoint}") + @ServiceInterface(name = "DevTestLabsManagementClientVirtualNetworks") public interface VirtualNetworksService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VirtualNetworkInner virtualNetwork, @HeaderParam("Accept") String accept, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") VirtualNetworkInner virtualNetwork, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}") - @ExpectedResponses({ 200, 202, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") VirtualNetworkInner virtualNetwork, + Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VirtualNetworkFragment virtualNetwork, @HeaderParam("Accept") String accept, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") VirtualNetworkFragment virtualNetwork, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List virtual networks in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, expand, filter, top, orderby, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") VirtualNetworkFragment virtualNetwork, + Context context); - /** - * List virtual networks in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String labName, - String expand, String filter, Integer top, String orderby, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, expand, - filter, top, orderby, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}") + @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("labName") String labName, + @PathParam("name") String name, Context context); - /** - * List virtual networks in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}") + @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("labName") String labName, + @PathParam("name") String name, Context context); - /** - * List virtual networks in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List virtual networks in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks") + @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("labName") String labName, + @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, @HeaderParam("Accept") String accept, Context context); - /** - * List virtual networks in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); - } + @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); - /** - * List virtual networks in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labName, String expand, - String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, 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); } /** * Get virtual network. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. @@ -337,75 +201,17 @@ public PagedIterable list(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, expand, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get virtual network. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the virtual network. - * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual network along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, - String name, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); - } - - /** - * Get virtual network. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -423,7 +229,7 @@ private Mono getAsync(String resourceGroupName, String labN /** * Get virtual network. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. @@ -436,13 +242,15 @@ private Mono getAsync(String resourceGroupName, String labN @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, name, expand, accept, context); } /** * Get virtual network. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -459,7 +267,7 @@ public VirtualNetworkInner get(String resourceGroupName, String labName, String /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. @@ -471,110 +279,67 @@ public VirtualNetworkInner get(String resourceGroupName, String labName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (virtualNetwork == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualNetwork is required and cannot be null.")); - } else { - virtualNetwork.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), virtualNetwork, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, virtualNetwork, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network along with {@link Response} on successful completion of {@link Mono}. + * @return a virtual network along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String labName, - String name, VirtualNetworkInner virtualNetwork, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (virtualNetwork == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualNetwork is required and cannot be null.")); - } else { - virtualNetwork.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + VirtualNetworkInner virtualNetwork) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - labName, name, this.client.getApiVersion(), virtualNetwork, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, virtualNetwork, + Context.NONE); } /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a virtual network. + * @return a virtual network along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, virtualNetwork); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - VirtualNetworkInner.class, VirtualNetworkInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + VirtualNetworkInner virtualNetwork, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, virtualNetwork, + context); } /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -582,18 +347,17 @@ private PollerFlux, VirtualNetworkInner> beginCr */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork, Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, virtualNetwork, context); + = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, virtualNetwork); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - VirtualNetworkInner.class, VirtualNetworkInner.class, context); + VirtualNetworkInner.class, VirtualNetworkInner.class, this.client.getContext()); } /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. @@ -605,13 +369,15 @@ private PollerFlux, VirtualNetworkInner> beginCr @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate(String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, name, virtualNetwork).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, labName, name, virtualNetwork); + return this.client.getLroResult(response, VirtualNetworkInner.class, + VirtualNetworkInner.class, Context.NONE); } /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. @@ -624,13 +390,16 @@ private PollerFlux, VirtualNetworkInner> beginCr @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, labName, name, virtualNetwork, context).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, labName, name, virtualNetwork, context); + return this.client.getLroResult(response, VirtualNetworkInner.class, + VirtualNetworkInner.class, context); } /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. @@ -649,30 +418,29 @@ private Mono createOrUpdateAsync(String resourceGroupName, /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network on successful completion of {@link Mono}. + * @return a virtual network. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, String name, - VirtualNetworkInner virtualNetwork, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, name, virtualNetwork, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public VirtualNetworkInner createOrUpdate(String resourceGroupName, String labName, String name, + VirtualNetworkInner virtualNetwork) { + return beginCreateOrUpdate(resourceGroupName, labName, name, virtualNetwork).getFinalResult(); } /** * Create or replace an existing virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -680,14 +448,57 @@ private Mono createOrUpdateAsync(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public VirtualNetworkInner createOrUpdate(String resourceGroupName, String labName, String name, - VirtualNetworkInner virtualNetwork) { - return createOrUpdateAsync(resourceGroupName, labName, name, virtualNetwork).block(); + VirtualNetworkInner virtualNetwork, Context context) { + return beginCreateOrUpdate(resourceGroupName, labName, name, virtualNetwork, context).getFinalResult(); } /** - * Create or replace an existing virtual network. This operation can take a while to complete. + * Allows modifying tags of virtual networks. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the virtual network. + * @param virtualNetwork A virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String labName, + String name, VirtualNetworkFragment virtualNetwork) { + 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, labName, name, contentType, accept, virtualNetwork, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows modifying tags of virtual networks. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the virtual network. + * @param virtualNetwork A virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, String name, + VirtualNetworkFragment virtualNetwork) { + return updateWithResponseAsync(resourceGroupName, labName, name, virtualNetwork) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Allows modifying tags of virtual networks. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param virtualNetwork A virtual network. @@ -695,18 +506,40 @@ public VirtualNetworkInner createOrUpdate(String resourceGroupName, String labNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String labName, String name, + VirtualNetworkFragment virtualNetwork, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, contentType, accept, virtualNetwork, + context); + } + + /** + * Allows modifying tags of virtual networks. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param name The name of the virtual network. + * @param virtualNetwork A virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual network. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner createOrUpdate(String resourceGroupName, String labName, String name, - VirtualNetworkInner virtualNetwork, Context context) { - return createOrUpdateAsync(resourceGroupName, labName, name, virtualNetwork, context).block(); + public VirtualNetworkInner update(String resourceGroupName, String labName, String name, + VirtualNetworkFragment virtualNetwork) { + return updateWithResponse(resourceGroupName, labName, name, virtualNetwork, Context.NONE).getValue(); } /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -717,113 +550,70 @@ public VirtualNetworkInner createOrUpdate(String resourceGroupName, String labNa @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String labName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String labName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, Context.NONE); } /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); - 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 labName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, name, context); } /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -833,13 +623,14 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { - return this.beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @param context The context to associate with this operation. @@ -851,13 +642,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name, Context context) { - return this.beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, labName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -873,196 +665,192 @@ private Mono deleteAsync(String resourceGroupName, String labName, String /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, String name, Context context) { - return beginDeleteAsync(resourceGroupName, labName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String labName, String name) { + beginDelete(resourceGroupName, labName, name).getFinalResult(); } /** * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String name) { - deleteAsync(resourceGroupName, labName, name).block(); + public void delete(String resourceGroupName, String labName, String name, Context context) { + beginDelete(resourceGroupName, labName, name, context).getFinalResult(); } /** - * Delete virtual network. This operation can take a while to complete. + * List virtual networks in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual network. - * @param context The context to associate with this operation. + * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String name, Context context) { - deleteAsync(resourceGroupName, labName, name, context).block(); + private Mono> listSinglePageAsync(String resourceGroupName, String labName, + String expand, String filter, Integer top, String orderby) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, 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())); } /** - * Allows modifying tags of virtual networks. All other properties will be ignored. + * List virtual networks in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. + * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String name, VirtualNetworkFragment virtualNetwork) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (virtualNetwork == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualNetwork is required and cannot be null.")); - } else { - virtualNetwork.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, labName, name, this.client.getApiVersion(), virtualNetwork, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of virtual networks. All other properties will be ignored. + * List virtual networks in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String labName, - String name, VirtualNetworkFragment virtualNetwork, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (virtualNetwork == null) { - return Mono.error(new IllegalArgumentException("Parameter virtualNetwork is required and cannot be null.")); - } else { - virtualNetwork.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, labName, - name, this.client.getApiVersion(), virtualNetwork, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Allows modifying tags of virtual networks. All other properties will be ignored. + * List virtual networks in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. + * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network on successful completion of {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String name, - VirtualNetworkFragment virtualNetwork) { - return updateWithResponseAsync(resourceGroupName, labName, name, virtualNetwork) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, labName, expand, filter, top, orderby, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of virtual networks. All other properties will be ignored. + * List virtual networks in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. + * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network along with {@link Response}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String labName, String name, - VirtualNetworkFragment virtualNetwork, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, name, virtualNetwork, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, labName, expand, filter, top, orderby, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Allows modifying tags of virtual networks. All other properties will be ignored. + * List virtual networks in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner update(String resourceGroupName, String labName, String name, - VirtualNetworkFragment virtualNetwork) { - return updateWithResponse(resourceGroupName, labName, name, virtualNetwork, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List virtual networks in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String expand, + String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, labName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -1077,13 +865,6 @@ public VirtualNetworkInner update(String resourceGroupName, String labName, Stri */ @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(), @@ -1091,6 +872,24 @@ 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 list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. * @@ -1099,22 +898,13 @@ 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 list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksImpl.java index 17ea742e54c2..44e33663be43 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.implementation; @@ -27,28 +27,12 @@ public VirtualNetworksImpl(VirtualNetworksClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String labName, String name, String expand, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new VirtualNetworkImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VirtualNetworkImpl(inner.getValue(), this.manager())); } public VirtualNetwork get(String resourceGroupName, String labName, String name) { @@ -68,6 +52,18 @@ public void delete(String resourceGroupName, String labName, String name, Contex this.serviceClient().delete(resourceGroupName, labName, name, context); } + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + public VirtualNetwork getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ArmTemplateList.java similarity index 67% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ArmTemplateList.java index 545962bdc3dc..053602dc4cda 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ArmTemplateList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class ArmTemplateList implements JsonSerializable { /* - * Results of the list operation. + * The ArmTemplate items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ArmTemplateList class. */ - public ArmTemplateList() { + private ArmTemplateList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The ArmTemplate items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ArmTemplateList object itself. - */ - public ArmTemplateList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ArmTemplateList object itself. - */ - public ArmTemplateList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ArmTemplateList 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 ArmTemplateList. */ public static ArmTemplateList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ArtifactList.java similarity index 67% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ArtifactList.java index 1f2857659e2f..9f1e14a6c448 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ArtifactList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class ArtifactList implements JsonSerializable { /* - * Results of the list operation. + * The Artifact items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ArtifactList class. */ - public ArtifactList() { + private ArtifactList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The Artifact items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ArtifactList object itself. - */ - public ArtifactList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ArtifactList object itself. - */ - public ArtifactList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ArtifactList 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 ArtifactList. */ public static ArtifactList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ArtifactSourceList.java similarity index 67% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ArtifactSourceList.java index 9e4646f45da2..840f3bd92b7d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ArtifactSourceList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class ArtifactSourceList implements JsonSerializable { /* - * Results of the list operation. + * The ArtifactSource items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ArtifactSourceList class. */ - public ArtifactSourceList() { + private ArtifactSourceList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The ArtifactSource items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ArtifactSourceList object itself. - */ - public ArtifactSourceList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ArtifactSourceList object itself. - */ - public ArtifactSourceList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ArtifactSourceList 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 ArtifactSourceList. */ public static ArtifactSourceList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/CustomImageList.java similarity index 67% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/CustomImageList.java index 54288ac97ebb..97606d986985 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/CustomImageList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class CustomImageList implements JsonSerializable { /* - * Results of the list operation. + * The CustomImage items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of CustomImageList class. */ - public CustomImageList() { + private CustomImageList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The CustomImage items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the CustomImageList object itself. - */ - public CustomImageList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the CustomImageList object itself. - */ - public CustomImageList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of CustomImageList 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 CustomImageList. */ public static CustomImageList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/DiskList.java similarity index 66% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/DiskList.java index 6763ee8e315a..389bce75c267 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/DiskList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class DiskList implements JsonSerializable { /* - * Results of the list operation. + * The Disk items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of DiskList class. */ - public DiskList() { + private DiskList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The Disk items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the DiskList object itself. - */ - public DiskList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the DiskList object itself. - */ - public DiskList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of DiskList 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 DiskList. */ public static DiskList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/DtlEnvironmentList.java similarity index 67% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/DtlEnvironmentList.java index 418124b06ce9..ed6939308af0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/DtlEnvironmentList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class DtlEnvironmentList implements JsonSerializable { /* - * Results of the list operation. + * The DtlEnvironment items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of DtlEnvironmentList class. */ - public DtlEnvironmentList() { + private DtlEnvironmentList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The DtlEnvironment items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the DtlEnvironmentList object itself. - */ - public DtlEnvironmentList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the DtlEnvironmentList object itself. - */ - public DtlEnvironmentList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of DtlEnvironmentList 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 DtlEnvironmentList. */ public static DtlEnvironmentList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/FormulaList.java similarity index 67% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/FormulaList.java index 98a90ffdad94..0719e10b669b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/FormulaList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class FormulaList implements JsonSerializable { /* - * Results of the list operation. + * The Formula items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of FormulaList class. */ - public FormulaList() { + private FormulaList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The Formula items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the FormulaList object itself. - */ - public FormulaList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the FormulaList object itself. - */ - public FormulaList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of FormulaList 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 FormulaList. */ public static FormulaList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/GalleryImageList.java similarity index 67% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/GalleryImageList.java index 56c472aa9d24..881e51028b87 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/GalleryImageList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class GalleryImageList implements JsonSerializable { /* - * Results of the list operation. + * The GalleryImage items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of GalleryImageList class. */ - public GalleryImageList() { + private GalleryImageList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The GalleryImage items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the GalleryImageList object itself. - */ - public GalleryImageList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the GalleryImageList object itself. - */ - public GalleryImageList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of GalleryImageList 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 GalleryImageList. */ public static GalleryImageList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/LabList.java similarity index 66% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/LabList.java index 33ebdd501a88..25364776bfc3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/LabList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class LabList implements JsonSerializable { /* - * Results of the list operation. + * The Lab items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of LabList class. */ - public LabList() { + private LabList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The Lab items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the LabList object itself. - */ - public LabList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the LabList object itself. - */ - public LabList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of LabList 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 LabList. */ public static LabList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVhdList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/LabVhdList.java similarity index 66% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVhdList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/LabVhdList.java index d534ba8ab875..e391dcfe7061 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVhdList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/LabVhdList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class LabVhdList implements JsonSerializable { /* - * Results of the list operation. + * The LabVhd items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of LabVhdList class. */ - public LabVhdList() { + private LabVhdList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The LabVhd items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the LabVhdList object itself. - */ - public LabVhdList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the LabVhdList object itself. - */ - public LabVhdList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of LabVhdList 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 LabVhdList. */ public static LabVhdList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/LabVirtualMachineList.java similarity index 67% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/LabVirtualMachineList.java index 7c0101bc036c..f06acd9994f0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/LabVirtualMachineList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class LabVirtualMachineList implements JsonSerializable { /* - * Results of the list operation. + * The LabVirtualMachine items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of LabVirtualMachineList class. */ - public LabVirtualMachineList() { + private LabVirtualMachineList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The LabVirtualMachine items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the LabVirtualMachineList object itself. - */ - public LabVirtualMachineList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the LabVirtualMachineList object itself. - */ - public LabVirtualMachineList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of LabVirtualMachineList 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 LabVirtualMachineList. */ public static LabVirtualMachineList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/NotificationChannelList.java similarity index 67% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/NotificationChannelList.java index ec699f2c80b7..5d429c694e8d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/NotificationChannelList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class NotificationChannelList implements JsonSerializable { /* - * Results of the list operation. + * The NotificationChannel items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of NotificationChannelList class. */ - public NotificationChannelList() { + private NotificationChannelList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The NotificationChannel items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the NotificationChannelList object itself. - */ - public NotificationChannelList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the NotificationChannelList object itself. - */ - public NotificationChannelList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of NotificationChannelList 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 NotificationChannelList. */ public static NotificationChannelList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/OperationListResult.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..5bf90cbfabc2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/OperationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation.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.devtestlabs.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation 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; + } + + /** + * {@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 OperationListResult from the JsonReader. + * + * @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 { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/PolicyList.java similarity index 66% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/PolicyList.java index b620a5c133da..acf3b709c031 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/PolicyList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class PolicyList implements JsonSerializable { /* - * Results of the list operation. + * The Policy items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of PolicyList class. */ - public PolicyList() { + private PolicyList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The Policy items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the PolicyList object itself. - */ - public PolicyList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the PolicyList object itself. - */ - public PolicyList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PolicyList 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 PolicyList. */ public static PolicyList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ScheduleList.java similarity index 67% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ScheduleList.java index 529a8a9d0c1f..84a30fc95bf6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ScheduleList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class ScheduleList implements JsonSerializable { /* - * Results of the list operation. + * The Schedule items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ScheduleList class. */ - public ScheduleList() { + private ScheduleList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The Schedule items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ScheduleList object itself. - */ - public ScheduleList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ScheduleList object itself. - */ - public ScheduleList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ScheduleList 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 ScheduleList. */ public static ScheduleList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/SecretList.java similarity index 66% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/SecretList.java index 60b664e4f7d5..9dc1b4562a11 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/SecretList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class SecretList implements JsonSerializable { /* - * Results of the list operation. + * The Secret items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of SecretList class. */ - public SecretList() { + private SecretList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The Secret items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the SecretList object itself. - */ - public SecretList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the SecretList object itself. - */ - public SecretList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of SecretList 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 SecretList. */ public static SecretList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ServiceFabricList.java similarity index 67% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ServiceFabricList.java index 2f98e43ea910..238b14afd9d1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ServiceFabricList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class ServiceFabricList implements JsonSerializable { /* - * Results of the list operation. + * The ServiceFabric items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ServiceFabricList class. */ - public ServiceFabricList() { + private ServiceFabricList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The ServiceFabric items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ServiceFabricList object itself. - */ - public ServiceFabricList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ServiceFabricList object itself. - */ - public ServiceFabricList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ServiceFabricList 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 ServiceFabricList. */ public static ServiceFabricList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/UserList.java similarity index 66% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/UserList.java index 94ffcd1d27ba..766546aafa21 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/UserList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class UserList implements JsonSerializable { /* - * Results of the list operation. + * The User items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of UserList class. */ - public UserList() { + private UserList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The User items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the UserList object itself. - */ - public UserList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the UserList object itself. - */ - public UserList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of UserList 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 UserList. */ public static UserList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/VirtualNetworkList.java similarity index 67% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkList.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/VirtualNetworkList.java index b47a08f45d61..3ff83059eb44 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/VirtualNetworkList.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.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.implementation.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,26 +16,26 @@ /** * The response of a list operation. */ -@Fluent +@Immutable public final class VirtualNetworkList implements JsonSerializable { /* - * Results of the list operation. + * The VirtualNetwork items on this page */ private List value; /* - * Link for next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of VirtualNetworkList class. */ - public VirtualNetworkList() { + private VirtualNetworkList() { } /** - * Get the value property: Results of the list operation. + * Get the value property: The VirtualNetwork items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the VirtualNetworkList object itself. - */ - public VirtualNetworkList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the VirtualNetworkList object itself. - */ - public VirtualNetworkList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of VirtualNetworkList 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 VirtualNetworkList. */ public static VirtualNetworkList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/package-info.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/package-info.java index e3d0f5b22377..35959d22401c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/package-info.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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 DevTestLabsClient. + * Package containing the implementations for DevTestLabs. * The DevTest Labs Client. */ package com.azure.resourcemanager.devtestlabs.implementation; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ActionType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ActionType.java new file mode 100644 index 000000000000..f40007c65324 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableSchedule.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableSchedule.java index e55997916939..74accd27bbd2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableSchedule.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableSchedule.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.devtestlabs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner; import java.util.Map; @@ -33,19 +34,26 @@ public interface ApplicableSchedule { String type(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the location property: The location of the resource. * * @return the location value. */ String location(); /** - * Gets the tags property: Resource tags. + * Gets the tags property: The tags of the resource. * * @return the tags value. */ Map tags(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the labVmsShutdown property: The auto-shutdown schedule, if one has been set at the lab or lab resource * level. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleFragment.java deleted file mode 100644 index 2bbcd69a6337..000000000000 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleFragment.java +++ /dev/null @@ -1,79 +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.devtestlabs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * Schedules applicable to a virtual machine. The schedules may have been defined on a VM or on lab level. - */ -@Fluent -public final class ApplicableScheduleFragment extends UpdateResource { - /** - * Creates an instance of ApplicableScheduleFragment class. - */ - public ApplicableScheduleFragment() { - } - - /** - * {@inheritDoc} - */ - @Override - public ApplicableScheduleFragment withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * 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.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ApplicableScheduleFragment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApplicableScheduleFragment 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 ApplicableScheduleFragment. - */ - public static ApplicableScheduleFragment fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApplicableScheduleFragment deserializedApplicableScheduleFragment = new ApplicableScheduleFragment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedApplicableScheduleFragment.withTags(tags); - } else { - reader.skipChildren(); - } - } - - return deserializedApplicableScheduleFragment; - }); - } -} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleProperties.java index 6fb437f92fd3..7dbebb040e99 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplyArtifactsRequest.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplyArtifactsRequest.java index 87e448ae8eeb..cd0fcff1be79 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplyArtifactsRequest.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplyArtifactsRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -48,17 +48,6 @@ public ApplyArtifactsRequest withArtifacts(List artif return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (artifacts() != null) { - artifacts().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplate.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplate.java index d5364faac38c..516e26b0a430 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplate.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplate.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.devtestlabs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInner; import java.time.OffsetDateTime; import java.util.List; @@ -34,6 +35,13 @@ public interface ArmTemplate { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -42,11 +50,11 @@ public interface ArmTemplate { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the displayName property: The display name of the ARM template. @@ -81,7 +89,7 @@ public interface ArmTemplate { * * @return the contents value. */ - Object contents(); + Map contents(); /** * Gets the createdDate property: The creation date of the armTemplate. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateInfo.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateInfo.java index 9d9358d11805..5bb0b7406a2e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateInfo.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateInfo.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.devtestlabs.models; import com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInfoInner; +import java.util.Map; /** * An immutable client-side representation of ArmTemplateInfo. @@ -15,14 +16,14 @@ public interface ArmTemplateInfo { * * @return the template value. */ - Object template(); + Map template(); /** * Gets the parameters property: The parameters of the ARM template. * * @return the parameters value. */ - Object parameters(); + Map parameters(); /** * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInfoInner object. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateParameterProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateParameterProperties.java index 8385f1963558..487807836eb9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateParameterProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateParameterProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -72,14 +72,6 @@ public ArmTemplateParameterProperties withValue(String value) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplates.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplates.java index 54844d16a680..f426e8a67f20 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplates.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplates.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -13,65 +13,65 @@ */ public interface ArmTemplates { /** - * List azure resource manager templates in a given artifact source. + * Get azure resource manager template. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. + * @param name The name of the azure resource manager template. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return azure resource manager template along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String labName, String artifactSourceName); + Response getWithResponse(String resourceGroupName, String labName, String artifactSourceName, + String name, String expand, Context context); /** - * List azure resource manager templates in a given artifact source. + * Get azure resource manager template. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param name The name of the azure resource manager template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return azure resource manager template. */ - PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, String expand, - String filter, Integer top, String orderby, Context context); + ArmTemplate get(String resourceGroupName, String labName, String artifactSourceName, String name); /** - * Get azure resource manager template. + * List azure resource manager templates in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the azure resource manager template. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String labName, String artifactSourceName, - String name, String expand, Context context); + PagedIterable list(String resourceGroupName, String labName, String artifactSourceName); /** - * Get azure resource manager template. + * List azure resource manager templates in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the azure resource manager template. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - ArmTemplate get(String resourceGroupName, String labName, String artifactSourceName, String name); + PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, String expand, + String filter, Integer top, String orderby, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifact.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifact.java index 1d6fa5904628..8d41b8165a94 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifact.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifact.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.devtestlabs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactInner; import java.time.OffsetDateTime; import java.util.Map; @@ -33,6 +34,13 @@ public interface Artifact { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -41,11 +49,11 @@ public interface Artifact { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the title property: The artifact's title. @@ -94,7 +102,7 @@ public interface Artifact { * * @return the parameters value. */ - Object parameters(); + Map parameters(); /** * Gets the createdDate property: The artifact's creation date. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactDeploymentStatusProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactDeploymentStatusProperties.java index d10f12d7a6b6..960224266663 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactDeploymentStatusProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactDeploymentStatusProperties.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.devtestlabs.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 @@ /** * Properties of an artifact deployment. */ -@Fluent +@Immutable public final class ArtifactDeploymentStatusProperties implements JsonSerializable { /* * The deployment status of the artifact. @@ -34,7 +34,7 @@ public final class ArtifactDeploymentStatusProperties implements JsonSerializabl /** * Creates an instance of ArtifactDeploymentStatusProperties class. */ - public ArtifactDeploymentStatusProperties() { + private ArtifactDeploymentStatusProperties() { } /** @@ -46,17 +46,6 @@ public String deploymentStatus() { return this.deploymentStatus; } - /** - * Set the deploymentStatus property: The deployment status of the artifact. - * - * @param deploymentStatus the deploymentStatus value to set. - * @return the ArtifactDeploymentStatusProperties object itself. - */ - public ArtifactDeploymentStatusProperties withDeploymentStatus(String deploymentStatus) { - this.deploymentStatus = deploymentStatus; - return this; - } - /** * Get the artifactsApplied property: The total count of the artifacts that were successfully applied. * @@ -66,17 +55,6 @@ public Integer artifactsApplied() { return this.artifactsApplied; } - /** - * Set the artifactsApplied property: The total count of the artifacts that were successfully applied. - * - * @param artifactsApplied the artifactsApplied value to set. - * @return the ArtifactDeploymentStatusProperties object itself. - */ - public ArtifactDeploymentStatusProperties withArtifactsApplied(Integer artifactsApplied) { - this.artifactsApplied = artifactsApplied; - return this; - } - /** * Get the totalArtifacts property: The total count of the artifacts that were tentatively applied. * @@ -86,25 +64,6 @@ public Integer totalArtifacts() { return this.totalArtifacts; } - /** - * Set the totalArtifacts property: The total count of the artifacts that were tentatively applied. - * - * @param totalArtifacts the totalArtifacts value to set. - * @return the ArtifactDeploymentStatusProperties object itself. - */ - public ArtifactDeploymentStatusProperties withTotalArtifacts(Integer totalArtifacts) { - this.totalArtifacts = totalArtifacts; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactInstallProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactInstallProperties.java index fc3b03905c2c..08b1e36d1769 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactInstallProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactInstallProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -201,17 +201,6 @@ public ArtifactInstallProperties withInstallTime(OffsetDateTime installTime) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (parameters() != null) { - parameters().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactParameterProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactParameterProperties.java index af7960078788..08e3bc6bd046 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactParameterProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactParameterProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -72,14 +72,6 @@ public ArtifactParameterProperties withValue(String value) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSource.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSource.java index 5241069473a2..5dd753e4b279 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSource.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSource.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.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactSourceInner; import java.time.OffsetDateTime; @@ -35,6 +36,13 @@ public interface ArtifactSource { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -43,11 +51,11 @@ public interface ArtifactSource { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the displayName property: The artifact source's display name. @@ -157,8 +165,8 @@ public interface ArtifactSource { /** * The entirety of the ArtifactSource definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -168,28 +176,7 @@ interface DefinitionStages { /** * The first stage of the ArtifactSource definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the ArtifactSource definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -199,7 +186,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, labName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @return the next definition stage. */ @@ -210,9 +197,9 @@ interface WithParentResource { * The stage of the ArtifactSource 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.WithDisplayName, - DefinitionStages.WithUri, DefinitionStages.WithSourceType, DefinitionStages.WithFolderPath, - DefinitionStages.WithArmTemplateFolderPath, DefinitionStages.WithBranchRef, + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithDisplayName, DefinitionStages.WithUri, DefinitionStages.WithSourceType, + DefinitionStages.WithFolderPath, DefinitionStages.WithArmTemplateFolderPath, DefinitionStages.WithBranchRef, DefinitionStages.WithSecurityToken, DefinitionStages.WithStatus { /** * Executes the create request. @@ -230,6 +217,27 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithDis ArtifactSource create(Context context); } + /** + * The stage of the ArtifactSource definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the ArtifactSource definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceFragment.java index 18aa35d38ee3..e4b436fceea6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public ArtifactSourceFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSources.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSources.java index 8afc685ff382..4f425f4e7fb5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSources.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSources.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -12,40 +12,10 @@ * Resource collection API of ArtifactSources. */ public interface ArtifactSources { - /** - * List artifact sources in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String labName); - - /** - * List artifact sources in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context); - /** * Get artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. @@ -61,7 +31,7 @@ Response getWithResponse(String resourceGroupName, String labNam /** * Get artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -74,7 +44,7 @@ Response getWithResponse(String resourceGroupName, String labNam /** * Delete artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @param context The context to associate with this operation. @@ -88,7 +58,7 @@ Response getWithResponse(String resourceGroupName, String labNam /** * Delete artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the artifact source. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -97,6 +67,36 @@ Response getWithResponse(String resourceGroupName, String labNam */ void delete(String resourceGroupName, String labName, String name); + /** + * List artifact sources in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName); + + /** + * List artifact sources in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context); + /** * Get artifact source. * diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifacts.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifacts.java index a5a03e49b26d..9869b5f1b6ea 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifacts.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifacts.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -13,73 +13,73 @@ */ public interface Artifacts { /** - * List artifacts in a given artifact source. + * Get artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. + * @param name The name of the artifact. + * @param expand Specify the $expand query. Example: 'properties($select=title)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return artifact along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String labName, String artifactSourceName); + Response getWithResponse(String resourceGroupName, String labName, String artifactSourceName, String name, + String expand, Context context); /** - * List artifacts in a given artifact source. + * Get artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param name The name of the artifact. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return artifact. */ - PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, String expand, - String filter, Integer top, String orderby, Context context); + Artifact get(String resourceGroupName, String labName, String artifactSourceName, String name); /** - * Get artifact. + * List artifacts in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the artifact. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String labName, String artifactSourceName, String name, - String expand, Context context); + PagedIterable list(String resourceGroupName, String labName, String artifactSourceName); /** - * Get artifact. + * List artifacts in a given artifact source. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param name The name of the artifact. + * @param expand Specify the $expand query. Example: 'properties($select=title)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Artifact get(String resourceGroupName, String labName, String artifactSourceName, String name); + PagedIterable list(String resourceGroupName, String labName, String artifactSourceName, String expand, + String filter, Integer top, String orderby, Context context); /** * Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates * the generated artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. @@ -97,7 +97,7 @@ Response generateArmTemplateWithResponse(String resourceGroupNa * Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates * the generated artifact. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachDiskProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachDiskProperties.java index c7bb3c8f28dc..ecb1b36ae6a6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachDiskProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachDiskProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -47,14 +47,6 @@ public AttachDiskProperties withLeasedByLabVmId(String leasedByLabVmId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachNewDataDiskOptions.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachNewDataDiskOptions.java index cc39018b4308..62d609e12f55 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachNewDataDiskOptions.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachNewDataDiskOptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -97,14 +97,6 @@ public AttachNewDataDiskOptions withDiskType(StorageType diskType) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BulkCreationParameters.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BulkCreationParameters.java index d7bda432a052..ff74bd00447f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BulkCreationParameters.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BulkCreationParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -47,14 +47,6 @@ public BulkCreationParameters withInstanceCount(Integer instanceCount) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeDataDisk.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeDataDisk.java index 46111b955826..37ced2c69429 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeDataDisk.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeDataDisk.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.devtestlabs.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 @@ /** * A data disks attached to a virtual machine. */ -@Fluent +@Immutable public final class ComputeDataDisk implements JsonSerializable { /* * Gets data disk name. @@ -39,7 +39,7 @@ public final class ComputeDataDisk implements JsonSerializable /** * Creates an instance of ComputeDataDisk class. */ - public ComputeDataDisk() { + private ComputeDataDisk() { } /** @@ -51,17 +51,6 @@ public String name() { return this.name; } - /** - * Set the name property: Gets data disk name. - * - * @param name the name value to set. - * @return the ComputeDataDisk object itself. - */ - public ComputeDataDisk withName(String name) { - this.name = name; - return this; - } - /** * Get the diskUri property: When backed by a blob, the URI of underlying blob. * @@ -71,17 +60,6 @@ public String diskUri() { return this.diskUri; } - /** - * Set the diskUri property: When backed by a blob, the URI of underlying blob. - * - * @param diskUri the diskUri value to set. - * @return the ComputeDataDisk object itself. - */ - public ComputeDataDisk withDiskUri(String diskUri) { - this.diskUri = diskUri; - return this; - } - /** * Get the managedDiskId property: When backed by managed disk, this is the ID of the compute disk resource. * @@ -91,17 +69,6 @@ public String managedDiskId() { return this.managedDiskId; } - /** - * Set the managedDiskId property: When backed by managed disk, this is the ID of the compute disk resource. - * - * @param managedDiskId the managedDiskId value to set. - * @return the ComputeDataDisk object itself. - */ - public ComputeDataDisk withManagedDiskId(String managedDiskId) { - this.managedDiskId = managedDiskId; - return this; - } - /** * Get the diskSizeGiB property: Gets data disk size in GiB. * @@ -111,25 +78,6 @@ public Integer diskSizeGiB() { return this.diskSizeGiB; } - /** - * Set the diskSizeGiB property: Gets data disk size in GiB. - * - * @param diskSizeGiB the diskSizeGiB value to set. - * @return the ComputeDataDisk object itself. - */ - public ComputeDataDisk withDiskSizeGiB(Integer diskSizeGiB) { - this.diskSizeGiB = diskSizeGiB; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeVmInstanceViewStatus.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeVmInstanceViewStatus.java index 5a97e588f4c2..9f26e0531e0c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeVmInstanceViewStatus.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeVmInstanceViewStatus.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.devtestlabs.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 @@ /** * Status information about a virtual machine. */ -@Fluent +@Immutable public final class ComputeVmInstanceViewStatus implements JsonSerializable { /* * Gets the status Code. @@ -34,7 +34,7 @@ public final class ComputeVmInstanceViewStatus implements JsonSerializable { /* * Gets the statuses of the virtual machine. @@ -55,7 +55,7 @@ public final class ComputeVmProperties implements JsonSerializable statuses() { return this.statuses; } - /** - * Set the statuses property: Gets the statuses of the virtual machine. - * - * @param statuses the statuses value to set. - * @return the ComputeVmProperties object itself. - */ - public ComputeVmProperties withStatuses(List statuses) { - this.statuses = statuses; - return this; - } - /** * Get the osType property: Gets the OS type of the virtual machine. * @@ -87,17 +76,6 @@ public String osType() { return this.osType; } - /** - * Set the osType property: Gets the OS type of the virtual machine. - * - * @param osType the osType value to set. - * @return the ComputeVmProperties object itself. - */ - public ComputeVmProperties withOsType(String osType) { - this.osType = osType; - return this; - } - /** * Get the vmSize property: Gets the size of the virtual machine. * @@ -107,17 +85,6 @@ public String vmSize() { return this.vmSize; } - /** - * Set the vmSize property: Gets the size of the virtual machine. - * - * @param vmSize the vmSize value to set. - * @return the ComputeVmProperties object itself. - */ - public ComputeVmProperties withVmSize(String vmSize) { - this.vmSize = vmSize; - return this; - } - /** * Get the networkInterfaceId property: Gets the network interface ID of the virtual machine. * @@ -127,17 +94,6 @@ public String networkInterfaceId() { return this.networkInterfaceId; } - /** - * Set the networkInterfaceId property: Gets the network interface ID of the virtual machine. - * - * @param networkInterfaceId the networkInterfaceId value to set. - * @return the ComputeVmProperties object itself. - */ - public ComputeVmProperties withNetworkInterfaceId(String networkInterfaceId) { - this.networkInterfaceId = networkInterfaceId; - return this; - } - /** * Get the osDiskId property: Gets OS disk blob uri for the virtual machine. * @@ -147,17 +103,6 @@ public String osDiskId() { return this.osDiskId; } - /** - * Set the osDiskId property: Gets OS disk blob uri for the virtual machine. - * - * @param osDiskId the osDiskId value to set. - * @return the ComputeVmProperties object itself. - */ - public ComputeVmProperties withOsDiskId(String osDiskId) { - this.osDiskId = osDiskId; - return this; - } - /** * Get the dataDiskIds property: Gets data disks blob uri for the virtual machine. * @@ -167,17 +112,6 @@ public List dataDiskIds() { return this.dataDiskIds; } - /** - * Set the dataDiskIds property: Gets data disks blob uri for the virtual machine. - * - * @param dataDiskIds the dataDiskIds value to set. - * @return the ComputeVmProperties object itself. - */ - public ComputeVmProperties withDataDiskIds(List dataDiskIds) { - this.dataDiskIds = dataDiskIds; - return this; - } - /** * Get the dataDisks property: Gets all data disks attached to the virtual machine. * @@ -187,31 +121,6 @@ public List dataDisks() { return this.dataDisks; } - /** - * Set the dataDisks property: Gets all data disks attached to the virtual machine. - * - * @param dataDisks the dataDisks value to set. - * @return the ComputeVmProperties object itself. - */ - public ComputeVmProperties withDataDisks(List dataDisks) { - this.dataDisks = dataDisks; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (statuses() != null) { - statuses().forEach(e -> e.validate()); - } - if (dataDisks() != null) { - dataDisks().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdProperties.java index f0d48ffc69ad..9a42dfe9b651 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -149,17 +149,6 @@ public CostThresholdProperties withNotificationSent(String notificationSent) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (percentageThreshold() != null) { - percentageThreshold().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdStatus.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdStatus.java index f90b448b29cd..f8794b8eec79 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdStatus.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostType.java index 1717bc176ca4..a9d249ce6aa2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostType.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Costs.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Costs.java index e7d0fac817cb..f6daec1beb20 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Costs.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Costs.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -14,7 +14,7 @@ public interface Costs { /** * Get cost. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @param expand Specify the $expand query. Example: 'properties($expand=labCostDetails)'. @@ -30,7 +30,7 @@ Response getWithResponse(String resourceGroupName, String labName, Stri /** * Get cost. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the cost. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImage.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImage.java index e020206f8512..2b21a67c674c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImage.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImage.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.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.CustomImageInner; import java.time.OffsetDateTime; @@ -36,6 +37,13 @@ public interface CustomImage { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -44,11 +52,11 @@ public interface CustomImage { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the vm property: The virtual machine from which the image is to be created. @@ -166,8 +174,8 @@ public interface CustomImage { /** * The entirety of the CustomImage definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -177,28 +185,7 @@ interface DefinitionStages { /** * The first stage of the CustomImage definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the CustomImage definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -208,7 +195,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, labName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @return the next definition stage. */ @@ -219,10 +206,11 @@ interface WithParentResource { * The stage of the CustomImage 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.WithVm, DefinitionStages.WithVhd, - DefinitionStages.WithDescription, DefinitionStages.WithAuthor, DefinitionStages.WithManagedImageId, - DefinitionStages.WithManagedSnapshotId, DefinitionStages.WithDataDiskStorageInfo, - DefinitionStages.WithCustomImagePlan, DefinitionStages.WithIsPlanAuthorized { + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithVm, + DefinitionStages.WithVhd, DefinitionStages.WithDescription, DefinitionStages.WithAuthor, + DefinitionStages.WithManagedImageId, DefinitionStages.WithManagedSnapshotId, + DefinitionStages.WithDataDiskStorageInfo, DefinitionStages.WithCustomImagePlan, + DefinitionStages.WithIsPlanAuthorized { /** * Executes the create request. * @@ -239,6 +227,27 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithVm, CustomImage create(Context context); } + /** + * The stage of the CustomImage definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the CustomImage definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageFragment.java index 2280ea5bbfb3..3f256aa10d19 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public CustomImageFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageOsType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageOsType.java index 9be84520c438..e2e7922ea91a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageOsType.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageOsType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesCustom.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesCustom.java index 37e6857f5029..b1445fdb3d3f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesCustom.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesCustom.java @@ -1,11 +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.devtestlabs.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; @@ -98,21 +97,6 @@ public CustomImagePropertiesCustom withOsType(CustomImageOsType osType) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (osType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property osType in model CustomImagePropertiesCustom")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CustomImagePropertiesCustom.class); - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromPlan.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromPlan.java index 73dd782f6e10..d376c028b9f0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromPlan.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromPlan.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -99,14 +99,6 @@ public CustomImagePropertiesFromPlan withOffer(String offer) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromVm.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromVm.java index 18bcc5052b43..1c5f4191c354 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromVm.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromVm.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -97,20 +97,6 @@ public CustomImagePropertiesFromVm withLinuxOsInfo(LinuxOsInfo linuxOsInfo) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (windowsOsInfo() != null) { - windowsOsInfo().validate(); - } - if (linuxOsInfo() != null) { - linuxOsInfo().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImages.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImages.java index fdd4191beac3..4f2ac302262e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImages.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImages.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -13,88 +13,88 @@ */ public interface CustomImages { /** - * List custom images in a given lab. + * Get custom image. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. + * @param name The name of the CustomImage. + * @param expand Specify the $expand query. Example: 'properties($select=vm)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return custom image along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String labName); + Response getWithResponse(String resourceGroupName, String labName, String name, String expand, + Context context); /** - * List custom images in a given lab. + * Get custom image. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return custom image. */ - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, - String orderby, Context context); + CustomImage get(String resourceGroupName, String labName, String name); /** - * Get custom image. + * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param context The context to associate with this operation. + * @param name The name of the CustomImage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom image along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String labName, String name, String expand, - Context context); + void delete(String resourceGroupName, String labName, String name); /** - * Get custom image. + * Delete custom image. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param name The name of the CustomImage. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom image. */ - CustomImage get(String resourceGroupName, String labName, String name); + void delete(String resourceGroupName, String labName, String name, Context context); /** - * Delete custom image. This operation can take a while to complete. + * List custom images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String name); + PagedIterable list(String resourceGroupName, String labName); /** - * Delete custom image. This operation can take a while to complete. + * List custom images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the custom image. + * @param expand Specify the $expand query. Example: 'properties($select=vm)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String name, Context context); + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, + String orderby, Context context); /** * Get custom image. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskProperties.java index ad2409cf9cc9..66283a787c48 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -97,17 +97,6 @@ public DataDiskProperties withHostCaching(HostCachingOptions hostCaching) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (attachNewDataDiskOptions() != null) { - attachNewDataDiskOptions().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskStorageTypeInfo.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskStorageTypeInfo.java index 57fa137db5ec..1d21d99448e7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskStorageTypeInfo.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskStorageTypeInfo.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -72,14 +72,6 @@ public DataDiskStorageTypeInfo withStorageType(StorageType storageType) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DayDetails.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DayDetails.java index 024b3d97d675..7e313c4dc00f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DayDetails.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DayDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -47,14 +47,6 @@ public DayDetails withTime(String time) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DetachDataDiskProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DetachDataDiskProperties.java index 761db9c13449..e9159af3058f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DetachDataDiskProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DetachDataDiskProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -47,14 +47,6 @@ public DetachDataDiskProperties withExistingLabDiskId(String existingLabDiskId) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DetachDiskProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DetachDiskProperties.java index ffdcd302bc92..7c0ae445e47d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DetachDiskProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DetachDiskProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -47,14 +47,6 @@ public DetachDiskProperties withLeasedByLabVmId(String leasedByLabVmId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disk.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disk.java index 6eb7bc08dfeb..5ad687ddb055 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disk.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disk.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.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.DiskInner; import java.time.OffsetDateTime; @@ -35,6 +36,13 @@ public interface Disk { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -43,11 +51,11 @@ public interface Disk { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the diskType property: The storage type for the disk (i.e. Standard, Premium). @@ -157,8 +165,8 @@ public interface Disk { /** * The entirety of the Disk definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -168,28 +176,7 @@ interface DefinitionStages { /** * The first stage of the Disk definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the Disk definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -197,24 +184,24 @@ interface WithLocation { */ interface WithParentResource { /** - * Specifies resourceGroupName, labName, username. + * Specifies resourceGroupName, labName, userName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @return the next definition stage. */ - WithCreate withExistingUser(String resourceGroupName, String labName, String username); + WithCreate withExistingUser(String resourceGroupName, String labName, String userName); } /** * The stage of the Disk 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.WithDiskType, - DefinitionStages.WithDiskSizeGiB, DefinitionStages.WithLeasedByLabVmId, DefinitionStages.WithDiskBlobName, - DefinitionStages.WithDiskUri, DefinitionStages.WithStorageAccountId, DefinitionStages.WithHostCaching, - DefinitionStages.WithManagedDiskId { + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithDiskType, DefinitionStages.WithDiskSizeGiB, DefinitionStages.WithLeasedByLabVmId, + DefinitionStages.WithDiskBlobName, DefinitionStages.WithDiskUri, DefinitionStages.WithStorageAccountId, + DefinitionStages.WithHostCaching, DefinitionStages.WithManagedDiskId { /** * Executes the create request. * @@ -231,6 +218,27 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithDis Disk create(Context context); } + /** + * The stage of the Disk definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the Disk definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskFragment.java index e05791656b1c..e54c4ae94dd0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public DiskFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disks.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disks.java index 75c8568d3404..aff7595fe976 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disks.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disks.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -13,116 +13,116 @@ */ public interface Disks { /** - * List disks in a given user profile. + * Get disk. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. + * @param name The name of the disk. + * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return disk along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String labName, String username); + Response getWithResponse(String resourceGroupName, String labName, String userName, String name, + String expand, Context context); /** - * List disks in a given user profile. + * Get disk. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. + * @param name The name of the disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return disk. */ - PagedIterable list(String resourceGroupName, String labName, String username, String expand, String filter, - Integer top, String orderby, Context context); + Disk get(String resourceGroupName, String labName, String userName, String name); /** - * Get disk. + * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String labName, String username, String name, - String expand, Context context); + void delete(String resourceGroupName, String labName, String userName, String name); /** - * Get disk. + * Delete disk. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk. */ - Disk get(String resourceGroupName, String labName, String username, String name); + void delete(String resourceGroupName, String labName, String userName, String name, Context context); /** - * Delete disk. This operation can take a while to complete. + * List disks in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String username, String name); + PagedIterable list(String resourceGroupName, String labName, String userName); /** - * Delete disk. This operation can take a while to complete. + * List disks in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the disk. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String username, String name, Context context); + PagedIterable list(String resourceGroupName, String labName, String userName, String expand, String filter, + Integer top, String orderby, Context context); /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void attach(String resourceGroupName, String labName, String username, String name, + void attach(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties); /** * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param attachDiskProperties Properties of the disk to attach. * @param context The context to associate with this operation. @@ -130,32 +130,32 @@ void attach(String resourceGroupName, String labName, String username, String na * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void attach(String resourceGroupName, String labName, String username, String name, + void attach(String resourceGroupName, String labName, String userName, String name, AttachDiskProperties attachDiskProperties, Context context); /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void detach(String resourceGroupName, String labName, String username, String name, + void detach(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties); /** * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to * complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the disk. * @param detachDiskProperties Properties of the disk to detach. * @param context The context to associate with this operation. @@ -163,7 +163,7 @@ void detach(String resourceGroupName, String labName, String username, String na * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void detach(String resourceGroupName, String labName, String username, String name, + void detach(String resourceGroupName, String labName, String userName, String name, DetachDiskProperties detachDiskProperties, Context context); /** diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironment.java index 36ae1f29229e..2505d9135b81 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironment.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.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.DtlEnvironmentInner; import java.util.Map; @@ -34,6 +35,13 @@ public interface DtlEnvironment { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -42,11 +50,11 @@ public interface DtlEnvironment { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the deploymentProperties property: The deployment properties of the environment. @@ -122,8 +130,8 @@ public interface DtlEnvironment { /** * The entirety of the DtlEnvironment definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -133,28 +141,7 @@ interface DefinitionStages { /** * The first stage of the DtlEnvironment definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the DtlEnvironment definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -162,22 +149,22 @@ interface WithLocation { */ interface WithParentResource { /** - * Specifies resourceGroupName, labName, username. + * Specifies resourceGroupName, labName, userName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @return the next definition stage. */ - WithCreate withExistingUser(String resourceGroupName, String labName, String username); + WithCreate withExistingUser(String resourceGroupName, String labName, String userName); } /** * The stage of the DtlEnvironment 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.WithDeploymentProperties, - DefinitionStages.WithArmTemplateDisplayName { + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithDeploymentProperties, DefinitionStages.WithArmTemplateDisplayName { /** * Executes the create request. * @@ -194,6 +181,27 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithDep DtlEnvironment create(Context context); } + /** + * The stage of the DtlEnvironment definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the DtlEnvironment definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentFragment.java index 30e8a538dc7c..4b4a4823e12a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public DtlEnvironmentFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnableStatus.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnableStatus.java index 9e6f07c7e193..a5600e7c0f98 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnableStatus.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnableStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentDeploymentProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentDeploymentProperties.java index a2541428befe..9157afb199bd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentDeploymentProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentDeploymentProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -73,17 +73,6 @@ public EnvironmentDeploymentProperties withParameters(List e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentPermission.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentPermission.java index 1503674a9f07..195436afa22b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentPermission.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentPermission.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Environments.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Environments.java index 33e46da7caa7..295a87f096ae 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Environments.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Environments.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -13,94 +13,94 @@ */ public interface Environments { /** - * List environments in a given user profile. + * Get environment. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. + * @param name The name of the environment. + * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return environment along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String labName, String username); + Response getWithResponse(String resourceGroupName, String labName, String userName, String name, + String expand, Context context); /** - * List environments in a given user profile. + * Get environment. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. + * @param name The name of the environment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return environment. */ - PagedIterable list(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context); + DtlEnvironment get(String resourceGroupName, String labName, String userName, String name); /** - * Get environment. + * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String labName, String username, String name, - String expand, Context context); + void delete(String resourceGroupName, String labName, String userName, String name); /** - * Get environment. + * Delete environment. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the environment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment. */ - DtlEnvironment get(String resourceGroupName, String labName, String username, String name); + void delete(String resourceGroupName, String labName, String userName, String name, Context context); /** - * Delete environment. This operation can take a while to complete. + * List environments in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the environment. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String username, String name); + PagedIterable list(String resourceGroupName, String labName, String userName); /** - * Delete environment. This operation can take a while to complete. + * List environments in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the environment. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String username, String name, Context context); + PagedIterable list(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby, Context context); /** * Get environment. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesProperties.java index e0b459188830..b3584ef7ed77 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -122,14 +122,6 @@ public EvaluatePoliciesProperties withUserObjectId(String userObjectId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesRequest.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesRequest.java index 88598f3ce9ea..dc32e8014094 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesRequest.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -48,17 +48,6 @@ public EvaluatePoliciesRequest withPolicies(List pol return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (policies() != null) { - policies().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesResponse.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesResponse.java index 0cc37ae130e6..1c810631476d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesResponse.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesResponse.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Event.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Event.java index b0628141493a..09eb421abc26 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Event.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Event.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -47,14 +47,6 @@ public Event withEventName(NotificationChannelEventType eventName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ExportResourceUsageParameters.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ExportResourceUsageParameters.java index 979f657ab595..e01bfc0acb23 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ExportResourceUsageParameters.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ExportResourceUsageParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -80,14 +80,6 @@ public ExportResourceUsageParameters withUsageStartDate(OffsetDateTime usageStar return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ExternalSubnet.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ExternalSubnet.java index 7076788dab44..c0ac25aef13f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ExternalSubnet.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ExternalSubnet.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.devtestlabs.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 @@ /** * Subnet information as returned by the Microsoft.Network API. */ -@Fluent +@Immutable public final class ExternalSubnet implements JsonSerializable { /* * Gets or sets the identifier. @@ -29,7 +29,7 @@ public final class ExternalSubnet implements JsonSerializable { /** * Creates an instance of ExternalSubnet class. */ - public ExternalSubnet() { + private ExternalSubnet() { } /** @@ -41,17 +41,6 @@ public String id() { return this.id; } - /** - * Set the id property: Gets or sets the identifier. - * - * @param id the id value to set. - * @return the ExternalSubnet object itself. - */ - public ExternalSubnet withId(String id) { - this.id = id; - return this; - } - /** * Get the name property: Gets or sets the name. * @@ -61,25 +50,6 @@ public String name() { return this.name; } - /** - * Set the name property: Gets or sets the name. - * - * @param name the name value to set. - * @return the ExternalSubnet object itself. - */ - public ExternalSubnet withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FileUploadOptions.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FileUploadOptions.java index 220116d5bf09..d1a807865b78 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FileUploadOptions.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FileUploadOptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formula.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formula.java index f04d29549131..e51f5a156ca2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formula.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formula.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.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.FormulaInner; import java.time.OffsetDateTime; @@ -35,6 +36,13 @@ public interface Formula { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -43,11 +51,11 @@ public interface Formula { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the description property: The description of the formula. @@ -136,8 +144,8 @@ public interface Formula { /** * The entirety of the Formula definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -147,28 +155,7 @@ interface DefinitionStages { /** * The first stage of the Formula definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the Formula definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -178,7 +165,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, labName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @return the next definition stage. */ @@ -189,7 +176,8 @@ interface WithParentResource { * The stage of the Formula definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithDescription, + interface WithCreate + extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithDescription, DefinitionStages.WithOsType, DefinitionStages.WithFormulaContent, DefinitionStages.WithVm { /** * Executes the create request. @@ -207,6 +195,27 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithDes Formula create(Context context); } + /** + * The stage of the Formula definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the Formula definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaFragment.java index ba58a28c701e..9c469161a8eb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public FormulaFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaPropertiesFromVm.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaPropertiesFromVm.java index 0f34699c56c7..cec6d55d4a2a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaPropertiesFromVm.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaPropertiesFromVm.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -47,14 +47,6 @@ public FormulaPropertiesFromVm withLabVmId(String labVmId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formulas.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formulas.java index 4abb7b6e8e90..30372a05e342 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formulas.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formulas.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -12,40 +12,10 @@ * Resource collection API of Formulas. */ public interface Formulas { - /** - * List formulas in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String labName); - - /** - * List formulas in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, - String orderby, Context context); - /** * Get formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param expand Specify the $expand query. Example: 'properties($select=description)'. @@ -61,7 +31,7 @@ Response getWithResponse(String resourceGroupName, String labName, Stri /** * Get formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -74,7 +44,7 @@ Response getWithResponse(String resourceGroupName, String labName, Stri /** * Delete formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @param context The context to associate with this operation. @@ -88,7 +58,7 @@ Response getWithResponse(String resourceGroupName, String labName, Stri /** * Delete formula. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the formula. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -97,6 +67,36 @@ Response getWithResponse(String resourceGroupName, String labName, Stri */ void delete(String resourceGroupName, String labName, String name); + /** + * List formulas in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName); + + /** + * List formulas in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, + String orderby, Context context); + /** * Get formula. * diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImage.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImage.java index c3c213d57ff6..441d7a223707 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImage.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImage.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.devtestlabs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.GalleryImageInner; import java.time.OffsetDateTime; import java.util.Map; @@ -33,6 +34,13 @@ public interface GalleryImage { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -41,11 +49,11 @@ public interface GalleryImage { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the author property: The author of the gallery image. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageReference.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageReference.java index d4452cbcfaa7..66b6a4b865d1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageReference.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageReference.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -147,14 +147,6 @@ public GalleryImageReference withVersion(String version) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImages.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImages.java index 5adbbfca6881..60bb37db1f66 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImages.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImages.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -14,7 +14,7 @@ public interface GalleryImages { /** * List gallery images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -26,9 +26,9 @@ public interface GalleryImages { /** * List gallery images in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateArmTemplateRequest.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateArmTemplateRequest.java index a905671780f0..3285ab991408 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateArmTemplateRequest.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateArmTemplateRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -125,17 +125,6 @@ public GenerateArmTemplateRequest withFileUploadOptions(FileUploadOptions fileUp return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (parameters() != null) { - parameters().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateUploadUriParameter.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateUploadUriParameter.java index 1e8b440e1a5d..6eb696331bfd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateUploadUriParameter.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateUploadUriParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -47,14 +47,6 @@ public GenerateUploadUriParameter withBlobName(String blobName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateUploadUriResponse.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateUploadUriResponse.java index c9dc9cda3210..4565a4f7c7aa 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateUploadUriResponse.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateUploadUriResponse.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GlobalSchedules.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GlobalSchedules.java index 27fac889e3b3..a9cedea8e73e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GlobalSchedules.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GlobalSchedules.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -13,113 +13,113 @@ */ public interface GlobalSchedules { /** - * List schedules in a subscription. + * Get schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule along with {@link Response}. */ - PagedIterable list(); + Response getByResourceGroupWithResponse(String resourceGroupName, String name, String expand, + Context context); /** - * List schedules in a subscription. + * Get schedule. * - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule. */ - PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); + Schedule getByResourceGroup(String resourceGroupName, String name); /** - * List schedules in a resource group. + * Delete schedule. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + Response deleteByResourceGroupWithResponse(String resourceGroupName, String name, Context context); /** - * List schedules in a resource group. + * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, Integer top, - String orderby, Context context); + void deleteByResourceGroup(String resourceGroupName, String name); /** - * Get schedule. + * List schedules in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String name, String expand, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get schedule. + * List schedules in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Schedule getByResourceGroup(String resourceGroupName, String name); + PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, Integer top, + String orderby, Context context); /** - * Delete schedule. + * List schedules in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + PagedIterable list(); /** - * Delete schedule. + * List schedules in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String name); + PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -129,8 +129,8 @@ Response getByResourceGroupWithResponse(String resourceGroupName, Stri /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -141,8 +141,8 @@ Response getByResourceGroupWithResponse(String resourceGroupName, Stri /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -153,8 +153,8 @@ Response getByResourceGroupWithResponse(String resourceGroupName, Stri /** * Updates a schedule's target resource Id. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Schedule. * @param retargetScheduleProperties Properties for retargeting a virtual machine schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HostCachingOptions.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HostCachingOptions.java index f4a6f7eb0cab..6cf7e5716d6e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HostCachingOptions.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HostCachingOptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HourDetails.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HourDetails.java index a6ddfc01b57c..961aedd814dc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HourDetails.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HourDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -47,14 +47,6 @@ public HourDetails withMinute(Integer minute) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HttpStatusCode.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HttpStatusCode.java index f9769ecfcb25..7716282d27d0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HttpStatusCode.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HttpStatusCode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/IdentityProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/IdentityProperties.java index 818d362df465..3e46f64de610 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/IdentityProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/IdentityProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -122,14 +122,6 @@ public IdentityProperties withClientSecretUrl(String clientSecretUrl) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ImportLabVirtualMachineRequest.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ImportLabVirtualMachineRequest.java index 6836719b4b72..626ef75ef6dc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ImportLabVirtualMachineRequest.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ImportLabVirtualMachineRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -72,14 +72,6 @@ public ImportLabVirtualMachineRequest withDestinationVirtualMachineName(String d return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/InboundNatRule.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/InboundNatRule.java index c2a57a19e6b9..52a74740320d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/InboundNatRule.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/InboundNatRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -100,14 +100,6 @@ public InboundNatRule withBackendPort(Integer backendPort) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Lab.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Lab.java index a494fb8e70c2..e489de6c06f3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Lab.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Lab.java @@ -1,12 +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.devtestlabs.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.LabInner; import java.time.OffsetDateTime; @@ -38,6 +39,13 @@ public interface Lab { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -46,11 +54,11 @@ public interface Lab { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the defaultStorageAccount property: The lab's default storage account. @@ -231,8 +239,8 @@ public interface Lab { /** * The entirety of the Lab definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } /** @@ -242,28 +250,7 @@ interface DefinitionStages { /** * The first stage of the Lab definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the Lab definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); + interface Blank extends WithResourceGroup { } /** @@ -273,7 +260,7 @@ interface WithResourceGroup { /** * Specifies resourceGroupName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); @@ -283,8 +270,8 @@ interface WithResourceGroup { * The stage of the Lab 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.WithLabStorageType, - DefinitionStages.WithMandatoryArtifactsResourceIdsLinux, + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithLabStorageType, DefinitionStages.WithMandatoryArtifactsResourceIdsLinux, DefinitionStages.WithMandatoryArtifactsResourceIdsWindows, DefinitionStages.WithPremiumDataDisks, DefinitionStages.WithEnvironmentPermission, DefinitionStages.WithAnnouncement, DefinitionStages.WithSupport, DefinitionStages.WithExtendedProperties { @@ -304,6 +291,27 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithLab Lab create(Context context); } + /** + * The stage of the Lab definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the Lab definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabAnnouncementProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabAnnouncementProperties.java index 7007fc95dcda..021deb6ec00f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabAnnouncementProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabAnnouncementProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -180,14 +180,6 @@ public String uniqueIdentifier() { return this.uniqueIdentifier; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCost.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCost.java index d11c49e5e947..c5933581e169 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCost.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCost.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.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.LabCostInner; import java.time.OffsetDateTime; @@ -36,6 +37,13 @@ public interface LabCost { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -44,11 +52,11 @@ public interface LabCost { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the targetCost property: The target cost properties. @@ -151,8 +159,8 @@ public interface LabCost { /** * The entirety of the LabCost definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -162,28 +170,7 @@ interface DefinitionStages { /** * The first stage of the LabCost definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the LabCost definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -193,7 +180,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, labName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @return the next definition stage. */ @@ -204,9 +191,9 @@ interface WithParentResource { * The stage of the LabCost 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.WithTargetCost, DefinitionStages.WithCurrencyCode, - DefinitionStages.WithStartDateTime, DefinitionStages.WithEndDateTime, DefinitionStages.WithCreatedDate { + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithTargetCost, DefinitionStages.WithCurrencyCode, DefinitionStages.WithStartDateTime, + DefinitionStages.WithEndDateTime, DefinitionStages.WithCreatedDate { /** * Executes the create request. * @@ -223,6 +210,27 @@ interface WithCreate LabCost create(Context context); } + /** + * The stage of the LabCost definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the LabCost definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCostDetailsProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCostDetailsProperties.java index 96416d1f4e11..b73ba3cc78bc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCostDetailsProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCostDetailsProperties.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.devtestlabs.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The properties of a lab cost item. */ -@Fluent +@Immutable public final class LabCostDetailsProperties implements JsonSerializable { /* * The date of the cost item. @@ -37,7 +37,7 @@ public final class LabCostDetailsProperties implements JsonSerializable { /* * The cost component of the cost item. @@ -24,7 +24,7 @@ public final class LabCostSummaryProperties implements JsonSerializable tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabResourceCostProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabResourceCostProperties.java index 29501ca460da..c791bf7aa6d2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabResourceCostProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabResourceCostProperties.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.devtestlabs.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 @@ /** * The properties of a resource cost item. */ -@Fluent +@Immutable public final class LabResourceCostProperties implements JsonSerializable { /* * The name of the resource. @@ -64,7 +64,7 @@ public final class LabResourceCostProperties implements JsonSerializable tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -45,11 +53,11 @@ public interface LabVirtualMachine { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the notes property: The notes of the virtual machine. @@ -330,8 +338,8 @@ public interface LabVirtualMachine { /** * The entirety of the LabVirtualMachine definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -341,28 +349,7 @@ interface DefinitionStages { /** * The first stage of the LabVirtualMachine definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the LabVirtualMachine definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -372,7 +359,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, labName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @return the next definition stage. */ @@ -383,8 +370,8 @@ interface WithParentResource { * The stage of the LabVirtualMachine 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.WithNotes, - DefinitionStages.WithOwnerObjectId, DefinitionStages.WithOwnerUserPrincipalName, + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithNotes, DefinitionStages.WithOwnerObjectId, DefinitionStages.WithOwnerUserPrincipalName, DefinitionStages.WithCreatedDate, DefinitionStages.WithCustomImageId, DefinitionStages.WithSize, DefinitionStages.WithUsername, DefinitionStages.WithPassword, DefinitionStages.WithSshKey, DefinitionStages.WithIsAuthenticationWithSshKey, DefinitionStages.WithLabSubnetName, @@ -409,6 +396,27 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithNot LabVirtualMachine create(Context context); } + /** + * The stage of the LabVirtualMachine definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the LabVirtualMachine definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineCreationParameter.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineCreationParameter.java index 1c9e5a94f7a8..cee390f2b06f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineCreationParameter.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineCreationParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -673,17 +673,6 @@ public List scheduleParameters() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineFragment.java index 54fbf15c727f..150a5c2bcc54 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public LabVirtualMachineFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineProperties.java index 6ca66f8de809..7edb7cb4e19c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Labs.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Labs.java index e3db9e305304..0be53ab58e29 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Labs.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Labs.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -13,110 +13,110 @@ */ public interface Labs { /** - * List labs in a subscription. + * Get lab. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return lab along with {@link Response}. */ - PagedIterable list(); + Response getByResourceGroupWithResponse(String resourceGroupName, String name, String expand, Context context); /** - * List labs in a subscription. + * Get lab. * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return lab. */ - PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); + Lab getByResourceGroup(String resourceGroupName, String name); /** - * List labs in a resource group. + * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + void deleteByResourceGroup(String resourceGroupName, String name); /** - * List labs in a resource group. + * Delete lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, Integer top, - String orderby, Context context); + void delete(String resourceGroupName, String name, Context context); /** - * Get lab. + * List labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String name, String expand, Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get lab. + * List labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Lab getByResourceGroup(String resourceGroupName, String name); + PagedIterable listByResourceGroup(String resourceGroupName, String expand, String filter, Integer top, + String orderby, Context context); /** - * Delete lab. This operation can take a while to complete. + * List labs in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String name); + PagedIterable list(); /** - * Delete lab. This operation can take a while to complete. + * List labs in a subscription. * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String name, Context context); + PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -127,7 +127,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, String expand, /** * Claim a random claimable virtual machine in the lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -139,7 +139,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, String expand, /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -152,7 +152,7 @@ void createEnvironment(String resourceGroupName, String name, /** * Create virtual machines in a lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param labVirtualMachineCreationParameter Properties for creating a virtual machine. * @param context The context to associate with this operation. @@ -166,7 +166,7 @@ void createEnvironment(String resourceGroupName, String name, /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -179,7 +179,7 @@ void exportResourceUsage(String resourceGroupName, String name, /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param exportResourceUsageParameters The parameters of the export operation. * @param context The context to associate with this operation. @@ -193,7 +193,7 @@ void exportResourceUsage(String resourceGroupName, String name, /** * Generate a URI for uploading custom disk images to a Lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param generateUploadUriParameter Properties for generating an upload URI. * @param context The context to associate with this operation. @@ -208,7 +208,7 @@ Response generateUploadUriWithResponse(String resourc /** * Generate a URI for uploading custom disk images to a Lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param generateUploadUriParameter Properties for generating an upload URI. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -222,7 +222,7 @@ GenerateUploadUriResponse generateUploadUri(String resourceGroupName, String nam /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. @@ -236,7 +236,7 @@ void importVirtualMachine(String resourceGroupName, String name, /** * Import a virtual machine into a different lab. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param importLabVirtualMachineRequest This represents the payload required to import a virtual machine from a * different lab into the current one. @@ -251,7 +251,7 @@ void importVirtualMachine(String resourceGroupName, String name, /** * List disk images available for custom image creation. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -263,7 +263,7 @@ void importVirtualMachine(String resourceGroupName, String name, /** * List disk images available for custom image creation. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the lab. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsInfo.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsInfo.java index ea056584c436..aa410c0a08a6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsInfo.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsInfo.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -49,14 +49,6 @@ public LinuxOsInfo withLinuxOsState(LinuxOsState linuxOsState) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsState.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsState.java index fafbbb2581b7..dffd73d1ddec 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsState.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ManagedIdentityType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ManagedIdentityType.java index e0ccc3ec717d..0416b0ae6955 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ManagedIdentityType.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ManagedIdentityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NetworkInterfaceProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NetworkInterfaceProperties.java index b11648cfdcce..f14458b63358 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NetworkInterfaceProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NetworkInterfaceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -255,17 +255,6 @@ public SharedPublicIpAddressConfiguration sharedPublicIpAddressConfiguration() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sharedPublicIpAddressConfiguration() != null) { - sharedPublicIpAddressConfiguration().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannel.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannel.java index 21ffe0e558c2..0ddabbd7a8a1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannel.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannel.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.devtestlabs.models; import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.NotificationChannelInner; import java.time.OffsetDateTime; @@ -37,6 +38,13 @@ public interface NotificationChannel { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -45,11 +53,11 @@ public interface NotificationChannel { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the webhookUrl property: The webhook URL to send notifications to. @@ -140,8 +148,8 @@ public interface NotificationChannel { /** * The entirety of the NotificationChannel definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -151,28 +159,7 @@ interface DefinitionStages { /** * The first stage of the NotificationChannel definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the NotificationChannel definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -182,7 +169,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, labName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @return the next definition stage. */ @@ -193,8 +180,8 @@ interface WithParentResource { * The stage of the NotificationChannel 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.WithWebhookUrl, DefinitionStages.WithEmailRecipient, + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithWebhookUrl, DefinitionStages.WithEmailRecipient, DefinitionStages.WithNotificationLocale, DefinitionStages.WithDescription, DefinitionStages.WithEvents { /** * Executes the create request. @@ -212,6 +199,27 @@ interface WithCreate NotificationChannel create(Context context); } + /** + * The stage of the NotificationChannel definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the NotificationChannel definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelEventType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelEventType.java index c5df2034cc66..9a087d3a2c0c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelEventType.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelEventType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelFragment.java index 0beeb2f4711a..ec5733477c98 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public NotificationChannelFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannels.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannels.java index 3315370eb1e6..615994c2ffaa 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannels.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannels.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -12,40 +12,10 @@ * Resource collection API of NotificationChannels. */ public interface NotificationChannels { - /** - * List notification channels in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String labName); - - /** - * List notification channels in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context); - /** * Get notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. @@ -61,7 +31,7 @@ Response getWithResponse(String resourceGroupName, String l /** * Get notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -74,7 +44,7 @@ Response getWithResponse(String resourceGroupName, String l /** * Delete notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param context The context to associate with this operation. @@ -88,7 +58,7 @@ Response getWithResponse(String resourceGroupName, String l /** * Delete notification channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -97,10 +67,40 @@ Response getWithResponse(String resourceGroupName, String l */ void delete(String resourceGroupName, String labName, String name); + /** + * List notification channels in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName); + + /** + * List notification channels in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context); + /** * Send notification to provided channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notifyParameters Properties for generating a Notification. @@ -116,7 +116,7 @@ Response notifyWithResponse(String resourceGroupName, String labName, Stri /** * Send notification to provided channel. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the notification channel. * @param notifyParameters Properties for generating a Notification. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationSettings.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationSettings.java index cd0439363a76..f30eaded4542 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationSettings.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -151,14 +151,6 @@ public NotificationSettings withNotificationLocale(String notificationLocale) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotifyParameters.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotifyParameters.java index 11279a3538ea..b2c8faa48c4e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotifyParameters.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotifyParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -72,14 +72,6 @@ public NotifyParameters withJsonPayload(String jsonPayload) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Operation.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Operation.java new file mode 100644 index 000000000000..7d3b18a2736e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.resourcemanager.devtestlabs.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationDisplay.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationDisplay.java new file mode 100644 index 000000000000..62b28cd32421 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.devtestlabs.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; + +/** + * Localized display information for an operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + private OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay 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 OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationError.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationError.java index 358381532b4c..671506bda28a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationError.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationError.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.devtestlabs.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 @@ /** * Error details for the operation in case of a failure. */ -@Fluent +@Immutable public final class OperationError implements JsonSerializable { /* * The error code of the operation error. @@ -29,7 +29,7 @@ public final class OperationError implements JsonSerializable { /** * Creates an instance of OperationError class. */ - public OperationError() { + private OperationError() { } /** @@ -41,17 +41,6 @@ public String code() { return this.code; } - /** - * Set the code property: The error code of the operation error. - * - * @param code the code value to set. - * @return the OperationError object itself. - */ - public OperationError withCode(String code) { - this.code = code; - return this; - } - /** * Get the message property: The error message of the operation error. * @@ -61,25 +50,6 @@ public String message() { return this.message; } - /** - * Set the message property: The error message of the operation error. - * - * @param message the message value to set. - * @return the OperationError object itself. - */ - public OperationError withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationMetadata.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationMetadata.java deleted file mode 100644 index 4bda626eb249..000000000000 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationMetadata.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.devtestlabs.models; - -import com.azure.resourcemanager.devtestlabs.fluent.models.OperationMetadataInner; - -/** - * An immutable client-side representation of OperationMetadata. - */ -public interface OperationMetadata { - /** - * Gets the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: The object that describes the operations. - * - * @return the display value. - */ - OperationMetadataDisplay display(); - - /** - * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.OperationMetadataInner object. - * - * @return the inner object. - */ - OperationMetadataInner innerModel(); -} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationMetadataDisplay.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationMetadataDisplay.java deleted file mode 100644 index ffce3626fdfd..000000000000 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationMetadataDisplay.java +++ /dev/null @@ -1,177 +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.devtestlabs.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 java.io.IOException; - -/** - * The object that describes the operations. - */ -@Fluent -public final class OperationMetadataDisplay implements JsonSerializable { - /* - * Friendly name of the resource provider - */ - private String provider; - - /* - * Resource type on which the operation is performed. - */ - private String resource; - - /* - * Operation type: read, write, delete, listKeys/action, etc. - */ - private String operation; - - /* - * Friendly name of the operation - */ - private String description; - - /** - * Creates an instance of OperationMetadataDisplay class. - */ - public OperationMetadataDisplay() { - } - - /** - * Get the provider property: Friendly name of the resource provider. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Friendly name of the resource provider. - * - * @param provider the provider value to set. - * @return the OperationMetadataDisplay object itself. - */ - public OperationMetadataDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource type on which the operation is performed. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Resource type on which the operation is performed. - * - * @param resource the resource value to set. - * @return the OperationMetadataDisplay object itself. - */ - public OperationMetadataDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Operation type: read, write, delete, listKeys/action, etc. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Operation type: read, write, delete, listKeys/action, etc. - * - * @param operation the operation value to set. - * @return the OperationMetadataDisplay object itself. - */ - public OperationMetadataDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Friendly name of the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Friendly name of the operation. - * - * @param description the description value to set. - * @return the OperationMetadataDisplay object itself. - */ - public OperationMetadataDisplay withDescription(String description) { - this.description = description; - 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("provider", this.provider); - jsonWriter.writeStringField("resource", this.resource); - jsonWriter.writeStringField("operation", this.operation); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationMetadataDisplay from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationMetadataDisplay 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 OperationMetadataDisplay. - */ - public static OperationMetadataDisplay fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationMetadataDisplay deserializedOperationMetadataDisplay = new OperationMetadataDisplay(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provider".equals(fieldName)) { - deserializedOperationMetadataDisplay.provider = reader.getString(); - } else if ("resource".equals(fieldName)) { - deserializedOperationMetadataDisplay.resource = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedOperationMetadataDisplay.operation = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedOperationMetadataDisplay.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationMetadataDisplay; - }); - } -} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationResult.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationResult.java index ab53412c6079..e0eeecea1cd8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationResult.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Operations.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Operations.java index 4209d6ce54a2..d75f91b4f5ae 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Operations.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Operations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Origin.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Origin.java new file mode 100644 index 000000000000..0c9e9b0e656d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Origin.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.devtestlabs.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ParameterInfo.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ParameterInfo.java index aeb0bfef1d23..938e5a4a50ee 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ParameterInfo.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ParameterInfo.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -72,14 +72,6 @@ public ParameterInfo withValue(String value) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ParametersValueFileInfo.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ParametersValueFileInfo.java index c72564fdbf24..6e0ef171d35e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ParametersValueFileInfo.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ParametersValueFileInfo.java @@ -1,20 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.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 java.io.IOException; +import java.util.Map; /** * A file containing a set of parameter values for an ARM template. */ -@Fluent +@Immutable public final class ParametersValueFileInfo implements JsonSerializable { /* * File name. @@ -24,12 +25,12 @@ public final class ParametersValueFileInfo implements JsonSerializable parametersValueInfo; /** * Creates an instance of ParametersValueFileInfo class. */ - public ParametersValueFileInfo() { + private ParametersValueFileInfo() { } /** @@ -41,45 +42,15 @@ public String fileName() { return this.fileName; } - /** - * Set the fileName property: File name. - * - * @param fileName the fileName value to set. - * @return the ParametersValueFileInfo object itself. - */ - public ParametersValueFileInfo withFileName(String fileName) { - this.fileName = fileName; - return this; - } - /** * Get the parametersValueInfo property: Contents of the file. * * @return the parametersValueInfo value. */ - public Object parametersValueInfo() { + public Map parametersValueInfo() { return this.parametersValueInfo; } - /** - * Set the parametersValueInfo property: Contents of the file. - * - * @param parametersValueInfo the parametersValueInfo value to set. - * @return the ParametersValueFileInfo object itself. - */ - public ParametersValueFileInfo withParametersValueInfo(Object parametersValueInfo) { - this.parametersValueInfo = parametersValueInfo; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -87,7 +58,8 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("fileName", this.fileName); - jsonWriter.writeUntypedField("parametersValueInfo", this.parametersValueInfo); + jsonWriter.writeMapField("parametersValueInfo", this.parametersValueInfo, + (writer, element) -> writer.writeUntyped(element)); return jsonWriter.writeEndObject(); } @@ -109,7 +81,8 @@ public static ParametersValueFileInfo fromJson(JsonReader jsonReader) throws IOE if ("fileName".equals(fieldName)) { deserializedParametersValueFileInfo.fileName = reader.getString(); } else if ("parametersValueInfo".equals(fieldName)) { - deserializedParametersValueFileInfo.parametersValueInfo = reader.readUntyped(); + Map parametersValueInfo = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedParametersValueFileInfo.parametersValueInfo = parametersValueInfo; } else { reader.skipChildren(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PercentageCostThresholdProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PercentageCostThresholdProperties.java index d87ede53621e..2d00784ffb99 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PercentageCostThresholdProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PercentageCostThresholdProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -47,14 +47,6 @@ public PercentageCostThresholdProperties withThresholdValue(Double thresholdValu return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policies.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policies.java index c2ddfcda76d4..99c206bf1b72 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policies.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policies.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -12,45 +12,13 @@ * Resource collection API of Policies. */ public interface Policies { - /** - * List policies in a given policy set. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String labName, String policySetName); - - /** - * List policies in a given policy set. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String labName, String policySetName, String expand, - String filter, Integer top, String orderby, Context context); - /** * Get policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -64,10 +32,10 @@ Response getWithResponse(String resourceGroupName, String labName, Strin /** * Get policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -78,10 +46,10 @@ Response getWithResponse(String resourceGroupName, String labName, Strin /** * Delete policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -94,16 +62,48 @@ Response deleteWithResponse(String resourceGroupName, String labName, Stri /** * Delete policy. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param name The name of the Policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void delete(String resourceGroupName, String labName, String policySetName, String name); + /** + * List policies in a given policy set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName, String policySetName); + + /** + * List policies in a given policy set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. + * @param expand Specify the $expand query. Example: 'properties($select=description)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName, String policySetName, String expand, + String filter, Integer top, String orderby, Context context); + /** * Get policy. * diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policy.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policy.java index 414e180bd7ee..08d713c843da 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policy.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policy.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.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.PolicyInner; import java.time.OffsetDateTime; @@ -36,18 +37,25 @@ public interface Policy { String type(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the tags property: The tags of the resource. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the location property: The location of the resource. * * @return the location value. */ String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the description property: The description of the policy. @@ -144,8 +152,8 @@ public interface Policy { /** * The entirety of the Policy definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -155,28 +163,7 @@ interface DefinitionStages { /** * The first stage of the Policy definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the Policy definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -186,9 +173,9 @@ interface WithParentResource { /** * Specifies resourceGroupName, labName, policySetName. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param policySetName policysets. * @return the next definition stage. */ WithCreate withExistingPolicyset(String resourceGroupName, String labName, String policySetName); @@ -198,9 +185,9 @@ interface WithParentResource { * The stage of the Policy definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithDescription, - DefinitionStages.WithStatus, DefinitionStages.WithFactName, DefinitionStages.WithFactData, - DefinitionStages.WithThreshold, DefinitionStages.WithEvaluatorType { + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithDescription, DefinitionStages.WithStatus, DefinitionStages.WithFactName, + DefinitionStages.WithFactData, DefinitionStages.WithThreshold, DefinitionStages.WithEvaluatorType { /** * Executes the create request. * @@ -217,14 +204,35 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithDes Policy create(Context context); } + /** + * The stage of the Policy definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the resource. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the resource. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the Policy definition allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: Resource tags.. + * Specifies the tags property: The tags of the resource.. * - * @param tags Resource tags. + * @param tags The tags of the resource. * @return the next definition stage. */ WithCreate withTags(Map tags); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyEvaluatorType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyEvaluatorType.java index cd4afe35d775..03d8b5c12f91 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyEvaluatorType.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyEvaluatorType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFactName.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFactName.java index bacee94652c9..d555c32d7228 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFactName.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFactName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFragment.java index 33d8a2bdc9e1..a6d26fd663a8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public PolicyFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySetResult.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySetResult.java index c3b68673cbad..1ddfdfd675aa 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySetResult.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySetResult.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.devtestlabs.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; @@ -15,7 +15,7 @@ /** * Result of a policy set evaluation. */ -@Fluent +@Immutable public final class PolicySetResult implements JsonSerializable { /* * A value indicating whether this policy set evaluation has discovered violations. @@ -30,7 +30,7 @@ public final class PolicySetResult implements JsonSerializable /** * Creates an instance of PolicySetResult class. */ - public PolicySetResult() { + private PolicySetResult() { } /** @@ -42,17 +42,6 @@ public Boolean hasError() { return this.hasError; } - /** - * Set the hasError property: A value indicating whether this policy set evaluation has discovered violations. - * - * @param hasError the hasError value to set. - * @return the PolicySetResult object itself. - */ - public PolicySetResult withHasError(Boolean hasError) { - this.hasError = hasError; - return this; - } - /** * Get the policyViolations property: The list of policy violations. * @@ -62,28 +51,6 @@ public List policyViolations() { return this.policyViolations; } - /** - * Set the policyViolations property: The list of policy violations. - * - * @param policyViolations the policyViolations value to set. - * @return the PolicySetResult object itself. - */ - public PolicySetResult withPolicyViolations(List policyViolations) { - this.policyViolations = policyViolations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (policyViolations() != null) { - policyViolations().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySets.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySets.java index 62d17d5736a5..ebaff05060db 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySets.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySets.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -14,9 +14,9 @@ public interface PolicySets { /** * Evaluates lab policy. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the policy set. + * @param name The name of the PolicySet. * @param evaluatePoliciesRequest Request body for evaluating a policy set. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -30,9 +30,9 @@ Response evaluatePoliciesWithResponse(String resourceG /** * Evaluates lab policy. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the policy set. + * @param name The name of the PolicySet. * @param evaluatePoliciesRequest Request body for evaluating a policy set. * @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/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyStatus.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyStatus.java index 8e204386975e..17bd1cbe6297 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyStatus.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyViolation.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyViolation.java index f0aa89d02775..b312eca19365 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyViolation.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyViolation.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.devtestlabs.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 @@ /** * Policy violation. */ -@Fluent +@Immutable public final class PolicyViolation implements JsonSerializable { /* * The code of the policy violation. @@ -29,7 +29,7 @@ public final class PolicyViolation implements JsonSerializable /** * Creates an instance of PolicyViolation class. */ - public PolicyViolation() { + private PolicyViolation() { } /** @@ -41,17 +41,6 @@ public String code() { return this.code; } - /** - * Set the code property: The code of the policy violation. - * - * @param code the code value to set. - * @return the PolicyViolation object itself. - */ - public PolicyViolation withCode(String code) { - this.code = code; - return this; - } - /** * Get the message property: The message of the policy violation. * @@ -61,25 +50,6 @@ public String message() { return this.message; } - /** - * Set the message property: The message of the policy violation. - * - * @param message the message value to set. - * @return the PolicyViolation object itself. - */ - public PolicyViolation withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Port.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Port.java index c225c824e912..1723d8eaaf25 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Port.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Port.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -72,14 +72,6 @@ public Port withBackendPort(Integer backendPort) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PremiumDataDisk.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PremiumDataDisk.java index 95f7a8f7e71a..17663691826c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PremiumDataDisk.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PremiumDataDisk.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperationResult.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperationResult.java deleted file mode 100644 index ea66a6e22af3..000000000000 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperationResult.java +++ /dev/null @@ -1,116 +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.devtestlabs.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.devtestlabs.fluent.models.OperationMetadataInner; -import java.io.IOException; -import java.util.List; - -/** - * Result of the request to list REST API operations. - */ -@Fluent -public final class ProviderOperationResult implements JsonSerializable { - /* - * List of operations supported by the resource provider. - */ - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - private String nextLink; - - /** - * Creates an instance of ProviderOperationResult class. - */ - public ProviderOperationResult() { - } - - /** - * Get the value property: List of operations supported by the resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of operations supported by the resource provider. - * - * @param value the value value to set. - * @return the ProviderOperationResult object itself. - */ - public ProviderOperationResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProviderOperationResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProviderOperationResult 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 ProviderOperationResult. - */ - public static ProviderOperationResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProviderOperationResult deserializedProviderOperationResult = new ProviderOperationResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> OperationMetadataInner.fromJson(reader1)); - deserializedProviderOperationResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedProviderOperationResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedProviderOperationResult; - }); - } -} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperations.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperations.java index cf0b9d7a382e..452d06ac4768 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperations.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -12,22 +12,24 @@ */ public interface ProviderOperations { /** - * Result of the request to list REST API operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** - * Result of the request to list REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/RdpConnection.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/RdpConnection.java index fe0bf10814b8..b5812f4e7124 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/RdpConnection.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/RdpConnection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ReportingCycleType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ReportingCycleType.java index 1a5a89600d1f..c34025a17bca 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ReportingCycleType.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ReportingCycleType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResizeLabVirtualMachineProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResizeLabVirtualMachineProperties.java index a4fbe0fc964f..b5b811efd37e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResizeLabVirtualMachineProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResizeLabVirtualMachineProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -47,14 +47,6 @@ public ResizeLabVirtualMachineProperties withSize(String size) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/RetargetScheduleProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/RetargetScheduleProperties.java index ff11aa2760a8..99bbaac47b76 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/RetargetScheduleProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/RetargetScheduleProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -74,14 +74,6 @@ public RetargetScheduleProperties withTargetResourceId(String targetResourceId) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedule.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedule.java index 03a1a2e83c7d..14dde5710ee8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedule.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedule.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.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; import java.time.OffsetDateTime; @@ -35,6 +36,13 @@ public interface Schedule { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -43,11 +51,11 @@ public interface Schedule { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). @@ -163,8 +171,8 @@ public interface Schedule { /** * The entirety of the Schedule definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } /** @@ -174,28 +182,7 @@ interface DefinitionStages { /** * The first stage of the Schedule definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the Schedule definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); + interface Blank extends WithResourceGroup { } /** @@ -205,7 +192,7 @@ interface WithResourceGroup { /** * Specifies resourceGroupName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); @@ -215,7 +202,8 @@ interface WithResourceGroup { * The stage of the Schedule 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.WithStatus, + interface WithCreate + extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithStatus, DefinitionStages.WithTaskType, DefinitionStages.WithWeeklyRecurrence, DefinitionStages.WithDailyRecurrence, DefinitionStages.WithHourlyRecurrence, DefinitionStages.WithTimeZoneId, DefinitionStages.WithNotificationSettings, DefinitionStages.WithTargetResourceId { @@ -235,6 +223,27 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSta Schedule create(Context context); } + /** + * The stage of the Schedule definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the Schedule definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleCreationParameter.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleCreationParameter.java index 71dfc7d973ea..3232637bfd72 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleCreationParameter.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleCreationParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -298,17 +298,6 @@ public ScheduleCreationParameter withTargetResourceId(String targetResourceId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleFragment.java index 6b1562de7ef2..9eb858ed4b58 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public ScheduleFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedules.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedules.java index a513e3163c51..52b9e8fc35e5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedules.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedules.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -14,70 +14,70 @@ */ public interface Schedules { /** - * List schedules in a given lab. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String labName); + Response getWithResponse(String resourceGroupName, String labName, String name, String expand, + Context context); /** - * List schedules in a given lab. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule. */ - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, - String orderby, Context context); + Schedule get(String resourceGroupName, String labName, String name); /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. + * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response}. + * @return a schedule along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String labName, String name, String expand, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, + ScheduleInner schedule, Context context); /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return a schedule. */ - Schedule get(String resourceGroupName, String labName, String name); + Schedule createOrUpdate(String resourceGroupName, String labName, String name, ScheduleInner schedule); /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -85,29 +85,29 @@ Response getWithResponse(String resourceGroupName, String labName, Str * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a schedule along with {@link Response}. */ - Response createOrUpdateWithResponse(String resourceGroupName, String labName, String name, - ScheduleInner schedule, Context context); + Response updateWithResponse(String resourceGroupName, String labName, String name, + ScheduleFragment schedule, Context context); /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a schedule. */ - Schedule createOrUpdate(String resourceGroupName, String labName, String name, ScheduleInner schedule); + Schedule update(String resourceGroupName, String labName, String name, ScheduleFragment schedule); /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -119,9 +119,9 @@ Response createOrUpdateWithResponse(String resourceGroupName, String l /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -129,41 +129,41 @@ Response createOrUpdateWithResponse(String resourceGroupName, String l void delete(String resourceGroupName, String labName, String name); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given lab. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Response updateWithResponse(String resourceGroupName, String labName, String name, - ScheduleFragment schedule, Context context); + PagedIterable list(String resourceGroupName, String labName); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given lab. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Schedule update(String resourceGroupName, String labName, String name, ScheduleFragment schedule); + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, + String orderby, Context context); /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -173,9 +173,9 @@ Response updateWithResponse(String resourceGroupName, String labName, /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -186,9 +186,9 @@ Response updateWithResponse(String resourceGroupName, String labName, /** * Lists all applicable schedules. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -199,9 +199,9 @@ Response updateWithResponse(String resourceGroupName, String labName, /** * Lists all applicable schedules. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param name The name of the Schedule. * @param context The context to associate with this 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/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secret.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secret.java index d1923c86555d..8c7ed591af6b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secret.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secret.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.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.SecretInner; import java.util.Map; @@ -34,6 +35,13 @@ public interface Secret { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -42,11 +50,11 @@ public interface Secret { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the value property: The value of the secret for secret creation. @@ -100,8 +108,8 @@ public interface Secret { /** * The entirety of the Secret definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -111,28 +119,7 @@ interface DefinitionStages { /** * The first stage of the Secret definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the Secret definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -140,21 +127,22 @@ interface WithLocation { */ interface WithParentResource { /** - * Specifies resourceGroupName, labName, username. + * Specifies resourceGroupName, labName, userName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @return the next definition stage. */ - WithCreate withExistingUser(String resourceGroupName, String labName, String username); + WithCreate withExistingUser(String resourceGroupName, String labName, String userName); } /** * The stage of the Secret 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.WithValue { + interface WithCreate + extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithValue { /** * Executes the create request. * @@ -171,6 +159,27 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithVal Secret create(Context context); } + /** + * The stage of the Secret definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the Secret definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretFragment.java index 7a65df84ff6e..b934b737372c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public SecretFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secrets.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secrets.java index f3e01f2f499f..1f561f149ce6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secrets.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secrets.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -13,96 +13,96 @@ */ public interface Secrets { /** - * List secrets in a given user profile. + * Get secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. + * @param name The name of the secret. + * @param expand Specify the $expand query. Example: 'properties($select=value)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return secret along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String labName, String username); + Response getWithResponse(String resourceGroupName, String labName, String userName, String name, + String expand, Context context); /** - * List secrets in a given user profile. + * Get secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. + * @param name The name of the secret. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return secret. */ - PagedIterable list(String resourceGroupName, String labName, String username, String expand, String filter, - Integer top, String orderby, Context context); + Secret get(String resourceGroupName, String labName, String userName, String name); /** - * Get secret. + * Delete secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String labName, String username, String name, - String expand, Context context); + Response deleteWithResponse(String resourceGroupName, String labName, String userName, String name, + Context context); /** - * Get secret. + * Delete secret. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the secret. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret. */ - Secret get(String resourceGroupName, String labName, String username, String name); + void delete(String resourceGroupName, String labName, String userName, String name); /** - * Delete secret. + * List secrets in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the secret. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Response deleteWithResponse(String resourceGroupName, String labName, String username, String name, - Context context); + PagedIterable list(String resourceGroupName, String labName, String userName); /** - * Delete secret. + * List secrets in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the secret. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=value)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String username, String name); + PagedIterable list(String resourceGroupName, String labName, String userName, String expand, String filter, + Integer top, String orderby, Context context); /** * Get secret. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabric.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabric.java index 3052bf792260..db98d5729e2f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabric.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabric.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.devtestlabs.models; import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricInner; import java.util.Map; @@ -35,6 +36,13 @@ public interface ServiceFabric { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -43,11 +51,11 @@ public interface ServiceFabric { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the externalServiceFabricId property: The backing service fabric resource's id. @@ -116,8 +124,8 @@ public interface ServiceFabric { /** * The entirety of the ServiceFabric definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -127,28 +135,7 @@ interface DefinitionStages { /** * The first stage of the ServiceFabric definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the ServiceFabric definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -156,22 +143,22 @@ interface WithLocation { */ interface WithParentResource { /** - * Specifies resourceGroupName, labName, username. + * Specifies resourceGroupName, labName, userName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @return the next definition stage. */ - WithCreate withExistingUser(String resourceGroupName, String labName, String username); + WithCreate withExistingUser(String resourceGroupName, String labName, String userName); } /** * The stage of the ServiceFabric 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.WithExternalServiceFabricId, - DefinitionStages.WithEnvironmentId { + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithExternalServiceFabricId, DefinitionStages.WithEnvironmentId { /** * Executes the create request. * @@ -188,6 +175,27 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithExt ServiceFabric create(Context context); } + /** + * The stage of the ServiceFabric definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the ServiceFabric definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricFragment.java index 07edf74d6612..b9c4f237a3c8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public ServiceFabricFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricProperties.java index 777931141a48..f31b7fd2fd0b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricSchedules.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricSchedules.java index fd8b7d3eda80..6ad9d83498af 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricSchedules.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricSchedules.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -14,80 +14,81 @@ */ public interface ServiceFabricSchedules { /** - * List schedules in a given service fabric. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String labName, String username, String serviceFabricName); + Response getWithResponse(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, String expand, Context context); /** - * List schedules in a given service fabric. + * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return schedule. */ - PagedIterable list(String resourceGroupName, String labName, String username, String serviceFabricName, - String expand, String filter, Integer top, String orderby, Context context); + Schedule get(String resourceGroupName, String labName, String userName, String serviceFabricName, String name); /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. + * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule along with {@link Response}. + * @return a schedule along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, String expand, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, ScheduleInner schedule, Context context); /** - * Get schedule. + * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. + * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return a schedule. */ - Schedule get(String resourceGroupName, String labName, String username, String serviceFabricName, String name); + Schedule createOrUpdate(String resourceGroupName, String labName, String userName, String serviceFabricName, + String name, ScheduleInner schedule); /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -95,119 +96,118 @@ Response getWithResponse(String resourceGroupName, String labName, Str * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a schedule along with {@link Response}. */ - Response createOrUpdateWithResponse(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, ScheduleInner schedule, Context context); + Response updateWithResponse(String resourceGroupName, String labName, String userName, + String serviceFabricName, String name, ScheduleFragment schedule, Context context); /** - * Create or replace an existing schedule. + * Allows modifying tags of schedules. All other properties will be ignored. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a schedule. */ - Schedule createOrUpdate(String resourceGroupName, String labName, String username, String serviceFabricName, - String name, ScheduleInner schedule); + Schedule update(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, + ScheduleFragment schedule); /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String labName, String username, + Response deleteWithResponse(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, Context context); /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 labName, String username, String serviceFabricName, String name); + void delete(String resourceGroupName, String labName, String userName, String serviceFabricName, String name); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given service fabric. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Response updateWithResponse(String resourceGroupName, String labName, String username, - String serviceFabricName, String name, ScheduleFragment schedule, Context context); + PagedIterable list(String resourceGroupName, String labName, String userName, String serviceFabricName); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given service fabric. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Schedule update(String resourceGroupName, String labName, String username, String serviceFabricName, String name, - ScheduleFragment schedule); + PagedIterable list(String resourceGroupName, String labName, String userName, String serviceFabricName, + String expand, String filter, Integer top, String orderby, Context context); /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void execute(String resourceGroupName, String labName, String username, String serviceFabricName, String name); + void execute(String resourceGroupName, String labName, String userName, String serviceFabricName, String name); /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param userName users. + * @param serviceFabricName servicefabrics. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void execute(String resourceGroupName, String labName, String username, String serviceFabricName, String name, + void execute(String resourceGroupName, String labName, String userName, String serviceFabricName, String name, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabrics.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabrics.java index d761deb438b0..5e185030e5c4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabrics.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabrics.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -13,101 +13,101 @@ */ public interface ServiceFabrics { /** - * List service fabrics in a given user profile. + * Get service fabric. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. + * @param name The name of the service fabric. + * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return service fabric along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String labName, String username); + Response getWithResponse(String resourceGroupName, String labName, String userName, String name, + String expand, Context context); /** - * List service fabrics in a given user profile. + * Get service fabric. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param userName The name of the user profile. + * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation as paginated response with {@link PagedIterable}. + * @return service fabric. */ - PagedIterable list(String resourceGroupName, String labName, String username, String expand, - String filter, Integer top, String orderby, Context context); + ServiceFabric get(String resourceGroupName, String labName, String userName, String name); /** - * Get service fabric. + * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service fabric along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String labName, String username, String name, - String expand, Context context); + void delete(String resourceGroupName, String labName, String userName, String name); /** - * Get service fabric. + * Delete service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service fabric. */ - ServiceFabric get(String resourceGroupName, String labName, String username, String name); + void delete(String resourceGroupName, String labName, String userName, String name, Context context); /** - * Delete service fabric. This operation can take a while to complete. + * List service fabrics in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. + * @param userName The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String username, String name); + PagedIterable list(String resourceGroupName, String labName, String userName); /** - * Delete service fabric. This operation can take a while to complete. + * List service fabrics in a given user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the service fabric. + * @param userName The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String username, String name, Context context); + PagedIterable list(String resourceGroupName, String labName, String userName, String expand, + String filter, Integer top, String orderby, Context context); /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -116,75 +116,75 @@ Response getWithResponse(String resourceGroupName, String labName * @return schedules applicable to a virtual machine along with {@link Response}. */ Response listApplicableSchedulesWithResponse(String resourceGroupName, String labName, - String username, String name, Context context); + String userName, String name, Context context); /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return schedules applicable to a virtual machine. */ - ApplicableSchedule listApplicableSchedules(String resourceGroupName, String labName, String username, String name); + ApplicableSchedule listApplicableSchedules(String resourceGroupName, String labName, String userName, String name); /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void start(String resourceGroupName, String labName, String username, String name); + void start(String resourceGroupName, String labName, String userName, String name); /** * Start a service fabric. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void start(String resourceGroupName, String labName, String username, String name, Context context); + void start(String resourceGroupName, String labName, String userName, String name, Context context); /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void stop(String resourceGroupName, String labName, String username, String name); + void stop(String resourceGroupName, String labName, String userName, String name); /** * Stop a service fabric This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param username The name of the user profile. + * @param userName The name of the user profile. * @param name The name of the service fabric. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void stop(String resourceGroupName, String labName, String username, String name, Context context); + void stop(String resourceGroupName, String labName, String userName, String name, Context context); /** * Get service fabric. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunner.java index 3c5165be2c90..5946fe36cb8c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunner.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.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceRunnerInner; import java.util.Map; @@ -35,18 +36,18 @@ public interface ServiceRunner { String type(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the tags property: Resource tags. * - * @return the location value. + * @return the tags value. */ - String location(); + Map tags(); /** - * Gets the tags property: Resource tags. + * Gets the location property: The geo-location where the resource lives. * - * @return the tags value. + * @return the location value. */ - Map tags(); + String location(); /** * Gets the identity property: The identity of the resource. @@ -55,6 +56,13 @@ public interface ServiceRunner { */ IdentityProperties identity(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the region of the resource. * @@ -86,8 +94,8 @@ public interface ServiceRunner { /** * The entirety of the ServiceRunner definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -97,28 +105,7 @@ interface DefinitionStages { /** * The first stage of the ServiceRunner definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the ServiceRunner definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -128,7 +115,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, labName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @return the next definition stage. */ @@ -139,7 +126,8 @@ interface WithParentResource { * The stage of the ServiceRunner 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 { + interface WithCreate + extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithIdentity { /** * Executes the create request. * @@ -156,6 +144,27 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIde ServiceRunner create(Context context); } + /** + * The stage of the ServiceRunner definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the ServiceRunner definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunners.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunners.java index 72b58e7eec34..c9155bf536c7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunners.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunners.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -14,7 +14,7 @@ public interface ServiceRunners { /** * Get service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @param context The context to associate with this operation. @@ -28,7 +28,7 @@ public interface ServiceRunners { /** * Get service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -41,7 +41,7 @@ public interface ServiceRunners { /** * Delete service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @param context The context to associate with this operation. @@ -55,7 +55,7 @@ public interface ServiceRunners { /** * Delete service runner. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the service runner. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedPublicIpAddressConfiguration.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedPublicIpAddressConfiguration.java index bf8d6fe1da17..6adabb2e2cf8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedPublicIpAddressConfiguration.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedPublicIpAddressConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -48,17 +48,6 @@ public SharedPublicIpAddressConfiguration withInboundNatRules(List e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SourceControlType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SourceControlType.java index bc65113c3369..28fe2449e08a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SourceControlType.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SourceControlType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/StorageType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/StorageType.java index 532ff9004b53..1ec1795df764 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/StorageType.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/StorageType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Subnet.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Subnet.java index 25e337a66a1a..c76ba9712f03 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Subnet.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Subnet.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -99,14 +99,6 @@ public Subnet withAllowPublicIp(UsagePermissionType allowPublicIp) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetOverride.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetOverride.java index 5246b75a9a39..6770254d9799 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetOverride.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetOverride.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -177,17 +177,6 @@ public SubnetOverride withVirtualNetworkPoolName(String virtualNetworkPoolName) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sharedPublicIpAddressConfiguration() != null) { - sharedPublicIpAddressConfiguration().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetSharedPublicIpAddressConfiguration.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetSharedPublicIpAddressConfiguration.java index 07fcc5cbd42a..410c7ae8b328 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetSharedPublicIpAddressConfiguration.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetSharedPublicIpAddressConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -49,17 +49,6 @@ public SubnetSharedPublicIpAddressConfiguration withAllowedPorts(List allo return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (allowedPorts() != null) { - allowedPorts().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostProperties.java index 9c4e4de8e464..d36c88880824 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -176,17 +176,6 @@ public TargetCostProperties withCycleType(ReportingCycleType cycleType) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (costThresholds() != null) { - costThresholds().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostStatus.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostStatus.java index d8c19a312fa1..ca478676088e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostStatus.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TransportProtocol.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TransportProtocol.java index b4308921886f..01e13f68f954 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TransportProtocol.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TransportProtocol.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UpdateResource.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UpdateResource.java index 4641b758ac4f..e279aaa6dde9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UpdateResource.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UpdateResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -48,14 +48,6 @@ public UpdateResource withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UsagePermissionType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UsagePermissionType.java index 4a59dd31385d..a8afabe10b80 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UsagePermissionType.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UsagePermissionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/User.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/User.java index 1868c2e88e3d..7b2376f4aa4e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/User.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/User.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.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.UserInner; import java.time.OffsetDateTime; @@ -35,6 +36,13 @@ public interface User { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -43,11 +51,11 @@ public interface User { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the identity property: The identity of the user. @@ -115,8 +123,8 @@ public interface User { /** * The entirety of the User definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -126,28 +134,7 @@ interface DefinitionStages { /** * The first stage of the User definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the User definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -157,7 +144,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, labName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @return the next definition stage. */ @@ -168,8 +155,8 @@ interface WithParentResource { * The stage of the User 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.WithSecretStore { + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithIdentity, DefinitionStages.WithSecretStore { /** * Executes the create request. * @@ -186,6 +173,27 @@ interface WithCreate User create(Context context); } + /** + * The stage of the User definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the User definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserFragment.java index 7ece705a72c7..93bddaefafc2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public UserFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserIdentity.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserIdentity.java index 7aa70eb80c25..bf8a01778718 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserIdentity.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -152,14 +152,6 @@ public UserIdentity withAppId(String appId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserSecretStore.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserSecretStore.java index 4ae1f2afd324..61307f19b641 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserSecretStore.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserSecretStore.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -72,14 +72,6 @@ public UserSecretStore withKeyVaultId(String keyVaultId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Users.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Users.java index 80ead01a7729..8c71eef450cc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Users.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Users.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -13,88 +13,88 @@ */ public interface Users { /** - * List user profiles in a given lab. + * Get user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. + * @param name The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=identity)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return user profile along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String labName); + Response getWithResponse(String resourceGroupName, String labName, String name, String expand, + Context context); /** - * List user profiles in a given lab. + * Get user profile. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param name The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return user profile. */ - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, - String orderby, Context context); + User get(String resourceGroupName, String labName, String name); /** - * Get user profile. + * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user profile along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String labName, String name, String expand, - Context context); + void delete(String resourceGroupName, String labName, String name); /** - * Get user profile. + * Delete user profile. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the user profile. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user profile. */ - User get(String resourceGroupName, String labName, String name); + void delete(String resourceGroupName, String labName, String name, Context context); /** - * Delete user profile. This operation can take a while to complete. + * List user profiles in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the user profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String name); + PagedIterable list(String resourceGroupName, String labName); /** - * Delete user profile. This operation can take a while to complete. + * List user profiles in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the user profile. + * @param expand Specify the $expand query. Example: 'properties($select=identity)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String name, Context context); + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, Integer top, + String orderby, Context context); /** * Get user profile. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineCreationSource.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineCreationSource.java index 69d7333be85c..039c6b3d917c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineCreationSource.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineCreationSource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineSchedules.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineSchedules.java index 0faca4e28912..4f9d78c33e3d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineSchedules.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineSchedules.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -13,45 +13,13 @@ * Resource collection API of VirtualMachineSchedules. */ public interface VirtualMachineSchedules { - /** - * List schedules in a given virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String labName, String virtualMachineName); - - /** - * List schedules in a given virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String labName, String virtualMachineName, String expand, - String filter, Integer top, String orderby, Context context); - /** * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -65,10 +33,10 @@ Response getWithResponse(String resourceGroupName, String labName, Str /** * Get schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -79,10 +47,10 @@ Response getWithResponse(String resourceGroupName, String labName, Str /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param schedule A schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -96,10 +64,10 @@ Response createOrUpdateWithResponse(String resourceGroupName, String l /** * Create or replace an existing schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param schedule A schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -109,13 +77,46 @@ Response createOrUpdateWithResponse(String resourceGroupName, String l Schedule createOrUpdate(String resourceGroupName, String labName, String virtualMachineName, String name, ScheduleInner schedule); + /** + * Allows modifying tags of schedules. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. + * @param schedule A schedule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a schedule along with {@link Response}. + */ + Response updateWithResponse(String resourceGroupName, String labName, String virtualMachineName, + String name, ScheduleFragment schedule, Context context); + + /** + * Allows modifying tags of schedules. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. + * @param schedule A schedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a schedule. + */ + Schedule update(String resourceGroupName, String labName, String virtualMachineName, String name, + ScheduleFragment schedule); + /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -128,10 +129,10 @@ Response deleteWithResponse(String resourceGroupName, String labName, Stri /** * Delete schedule. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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,45 +140,44 @@ Response deleteWithResponse(String resourceGroupName, String labName, Stri void delete(String resourceGroupName, String labName, String virtualMachineName, String name); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given virtual machine. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param schedule A schedule. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule along with {@link Response}. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Response updateWithResponse(String resourceGroupName, String labName, String virtualMachineName, - String name, ScheduleFragment schedule, Context context); + PagedIterable list(String resourceGroupName, String labName, String virtualMachineName); /** - * Allows modifying tags of schedules. All other properties will be ignored. + * List schedules in a given virtual machine. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @param schedule A schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param expand Specify the $expand query. Example: 'properties($select=status)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - Schedule update(String resourceGroupName, String labName, String virtualMachineName, String name, - ScheduleFragment schedule); + PagedIterable list(String resourceGroupName, String labName, String virtualMachineName, String expand, + String filter, Integer top, String orderby, Context context); /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -187,10 +187,10 @@ Schedule update(String resourceGroupName, String labName, String virtualMachineN /** * Execute a schedule. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName labs. + * @param virtualMachineName virtualmachines. + * @param name The name of the Schedule. * @param context The context to associate with this 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/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachines.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachines.java index 63adefe5395e..9aa5b4dc5e1f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachines.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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.devtestlabs.models; @@ -12,41 +12,10 @@ * Resource collection API of VirtualMachines. */ public interface VirtualMachines { - /** - * List virtual machines in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String labName); - - /** - * List virtual machines in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: - * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context); - /** * Get virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param expand Specify the $expand query. Example: @@ -63,7 +32,7 @@ Response getWithResponse(String resourceGroupName, String lab /** * Get virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -76,7 +45,7 @@ Response getWithResponse(String resourceGroupName, String lab /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -88,7 +57,7 @@ Response getWithResponse(String resourceGroupName, String lab /** * Delete virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -98,10 +67,41 @@ Response getWithResponse(String resourceGroupName, String lab */ void delete(String resourceGroupName, String labName, String name, Context context); + /** + * List virtual machines in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName); + + /** + * List virtual machines in a given lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: + * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context); + /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a virtual machine. @@ -114,7 +114,7 @@ Response getWithResponse(String resourceGroupName, String lab /** * Attach a new or existing data disk to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param dataDiskProperties Request body for adding a new or existing data disk to a virtual machine. @@ -129,7 +129,7 @@ void addDataDisk(String resourceGroupName, String labName, String name, DataDisk /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a virtual machine. @@ -143,7 +143,7 @@ void applyArtifacts(String resourceGroupName, String labName, String name, /** * Apply artifacts to virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param applyArtifactsRequest Request body for applying artifacts to a virtual machine. @@ -158,7 +158,7 @@ void applyArtifacts(String resourceGroupName, String labName, String name, /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -170,7 +170,7 @@ void applyArtifacts(String resourceGroupName, String labName, String name, /** * Take ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -183,7 +183,7 @@ void applyArtifacts(String resourceGroupName, String labName, String name, /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a virtual machine. @@ -197,7 +197,7 @@ void detachDataDisk(String resourceGroupName, String labName, String name, /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param detachDataDiskProperties Request body for detaching data disk from a virtual machine. @@ -212,7 +212,7 @@ void detachDataDisk(String resourceGroupName, String labName, String name, /** * Gets a string that represents the contents of the RDP file for the virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -228,7 +228,7 @@ Response getRdpFileContentsWithResponse(String resourceGroupName, /** * Gets a string that represents the contents of the RDP file for the virtual machine. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -241,7 +241,7 @@ Response getRdpFileContentsWithResponse(String resourceGroupName, /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -256,7 +256,7 @@ Response listApplicableSchedulesWithResponse(String resource /** * Lists the applicable start/stop schedules, if any. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -269,7 +269,7 @@ Response listApplicableSchedulesWithResponse(String resource /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -281,7 +281,7 @@ Response listApplicableSchedulesWithResponse(String resource /** * Redeploy a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -294,7 +294,7 @@ Response listApplicableSchedulesWithResponse(String resource /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a virtual machine. @@ -308,7 +308,7 @@ void resize(String resourceGroupName, String labName, String name, /** * Resize Virtual Machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param resizeLabVirtualMachineProperties Request body for resizing a virtual machine. @@ -323,7 +323,7 @@ void resize(String resourceGroupName, String labName, String name, /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -335,7 +335,7 @@ void resize(String resourceGroupName, String labName, String name, /** * Restart a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -348,7 +348,7 @@ void resize(String resourceGroupName, String labName, String name, /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -360,7 +360,7 @@ void resize(String resourceGroupName, String labName, String name, /** * Start a virtual machine. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -373,7 +373,7 @@ void resize(String resourceGroupName, String labName, String name, /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -385,7 +385,7 @@ void resize(String resourceGroupName, String labName, String name, /** * Stop a virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -399,7 +399,7 @@ void resize(String resourceGroupName, String labName, String name, * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -412,7 +412,7 @@ void resize(String resourceGroupName, String labName, String name, * Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take * a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. @@ -425,7 +425,7 @@ void resize(String resourceGroupName, String labName, String name, /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -437,7 +437,7 @@ void resize(String resourceGroupName, String labName, String name, /** * Release ownership of an existing virtual machine This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual machine. * @param context The context to associate with this operation. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetwork.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetwork.java index e3f754ee603f..c5c2f16df303 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetwork.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetwork.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.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.VirtualNetworkInner; import java.time.OffsetDateTime; @@ -36,6 +37,13 @@ public interface VirtualNetwork { */ String type(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -44,11 +52,11 @@ public interface VirtualNetwork { String location(); /** - * Gets the tags property: Resource tags. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the tags value. + * @return the systemData value. */ - Map tags(); + SystemData systemData(); /** * Gets the allowedSubnets property: The allowed subnets of the virtual network. @@ -137,8 +145,8 @@ public interface VirtualNetwork { /** * The entirety of the VirtualNetwork definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -148,28 +156,7 @@ interface DefinitionStages { /** * The first stage of the VirtualNetwork definition. */ - interface Blank extends WithLocation { - } - - /** - * The stage of the VirtualNetwork definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** @@ -179,7 +166,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, labName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @return the next definition stage. */ @@ -190,8 +177,8 @@ interface WithParentResource { * The stage of the VirtualNetwork 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.WithAllowedSubnets, DefinitionStages.WithDescription, + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithAllowedSubnets, DefinitionStages.WithDescription, DefinitionStages.WithExternalProviderResourceId, DefinitionStages.WithSubnetOverrides { /** * Executes the create request. @@ -209,6 +196,27 @@ interface WithCreate VirtualNetwork create(Context context); } + /** + * The stage of the VirtualNetwork definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** * The stage of the VirtualNetwork definition allowing to specify tags. */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkFragment.java index 55f864364d76..f0993efdd5a2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkFragment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -31,15 +31,6 @@ public VirtualNetworkFragment withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworks.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworks.java index 4d7d7a46a313..4685facbc5d1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworks.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworks.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -13,88 +13,88 @@ */ public interface VirtualNetworks { /** - * List virtual networks in a given lab. + * Get virtual network. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. + * @param name The name of the virtual network. + * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. + * @return virtual network along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String labName); + Response getWithResponse(String resourceGroupName, String labName, String name, String expand, + Context context); /** - * List virtual networks in a given lab. + * Get virtual network. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). - * @param top The maximum number of resources to return from the operation. Example: '$top=10'. - * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. - * @param context The context to associate with this operation. + * @param name The name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation as paginated response with {@link PagedIterable}. + * @return virtual network. */ - PagedIterable list(String resourceGroupName, String labName, String expand, String filter, - Integer top, String orderby, Context context); + VirtualNetwork get(String resourceGroupName, String labName, String name); /** - * Get virtual network. + * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. - * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual network along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String labName, String name, String expand, - Context context); + void delete(String resourceGroupName, String labName, String name); /** - * Get virtual network. + * Delete virtual network. This operation can take a while to complete. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. * @param name The name of the virtual network. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual network. */ - VirtualNetwork get(String resourceGroupName, String labName, String name); + void delete(String resourceGroupName, String labName, String name, Context context); /** - * Delete virtual network. This operation can take a while to complete. + * List virtual networks in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual network. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String name); + PagedIterable list(String resourceGroupName, String labName); /** - * Delete virtual network. This operation can take a while to complete. + * List virtual networks in a given lab. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param labName The name of the lab. - * @param name The name of the virtual network. + * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String labName, String name, Context context); + PagedIterable list(String resourceGroupName, String labName, String expand, String filter, + Integer top, String orderby, Context context); /** * Get virtual network. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WeekDetails.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WeekDetails.java index e62ee8cdfba8..96f6014a3d9a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WeekDetails.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WeekDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -75,14 +75,6 @@ public WeekDetails withTime(String time) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsInfo.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsInfo.java index 3a9c06435f9d..3e4e9ae01fdf 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsInfo.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsInfo.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; @@ -49,14 +49,6 @@ public WindowsOsInfo withWindowsOsState(WindowsOsState windowsOsState) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsState.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsState.java index 8c5c2ab3231f..611f113063fb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsState.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/package-info.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/package-info.java index f66ef92fffd3..fdd9306983f9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/package-info.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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 DevTestLabsClient. + * Package containing the data models for DevTestLabs. * The DevTest Labs Client. */ package com.azure.resourcemanager.devtestlabs.models; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/package-info.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/package-info.java index f5f2f54bbcf8..9af063f05a97 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/package-info.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/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 DevTestLabsClient. + * Package containing the classes for DevTestLabs. * The DevTest Labs Client. */ package com.azure.resourcemanager.devtestlabs; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/module-info.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/module-info.java index 4074e02de797..600bc267a1ad 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/module-info.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/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.devtestlabs { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.devtestlabs.fluent.models to com.azure.core; opens com.azure.resourcemanager.devtestlabs.models to com.azure.core; + opens com.azure.resourcemanager.devtestlabs.implementation.models to com.azure.core; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/resources/META-INF/azure-resourcemanager-devtestlabs_metadata.json b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/resources/META-INF/azure-resourcemanager-devtestlabs_metadata.json new file mode 100644 index 000000000000..9d50710325a8 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/resources/META-INF/azure-resourcemanager-devtestlabs_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.DevTestLab":"2018-09-15"},"crossLanguagePackageId":"Microsoft.DevTestLab","crossLanguageVersion":"50e646d6069e","crossLanguageDefinitions":{"com.azure.resourcemanager.devtestlabs.fluent.ArmTemplatesClient":"Microsoft.DevTestLab.ArmTemplates","com.azure.resourcemanager.devtestlabs.fluent.ArmTemplatesClient.get":"Microsoft.DevTestLab.ArmTemplates.get","com.azure.resourcemanager.devtestlabs.fluent.ArmTemplatesClient.getWithResponse":"Microsoft.DevTestLab.ArmTemplates.get","com.azure.resourcemanager.devtestlabs.fluent.ArmTemplatesClient.list":"Microsoft.DevTestLab.ArmTemplates.list","com.azure.resourcemanager.devtestlabs.fluent.ArtifactSourcesClient":"Microsoft.DevTestLab.ArtifactSources","com.azure.resourcemanager.devtestlabs.fluent.ArtifactSourcesClient.createOrUpdate":"Microsoft.DevTestLab.ArtifactSources.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.ArtifactSourcesClient.createOrUpdateWithResponse":"Microsoft.DevTestLab.ArtifactSources.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.ArtifactSourcesClient.delete":"Microsoft.DevTestLab.ArtifactSources.delete","com.azure.resourcemanager.devtestlabs.fluent.ArtifactSourcesClient.deleteWithResponse":"Microsoft.DevTestLab.ArtifactSources.delete","com.azure.resourcemanager.devtestlabs.fluent.ArtifactSourcesClient.get":"Microsoft.DevTestLab.ArtifactSources.get","com.azure.resourcemanager.devtestlabs.fluent.ArtifactSourcesClient.getWithResponse":"Microsoft.DevTestLab.ArtifactSources.get","com.azure.resourcemanager.devtestlabs.fluent.ArtifactSourcesClient.list":"Microsoft.DevTestLab.ArtifactSources.list","com.azure.resourcemanager.devtestlabs.fluent.ArtifactSourcesClient.update":"Microsoft.DevTestLab.ArtifactSources.update","com.azure.resourcemanager.devtestlabs.fluent.ArtifactSourcesClient.updateWithResponse":"Microsoft.DevTestLab.ArtifactSources.update","com.azure.resourcemanager.devtestlabs.fluent.ArtifactsClient":"Microsoft.DevTestLab.Artifacts","com.azure.resourcemanager.devtestlabs.fluent.ArtifactsClient.generateArmTemplate":"Microsoft.DevTestLab.Artifacts.generateArmTemplate","com.azure.resourcemanager.devtestlabs.fluent.ArtifactsClient.generateArmTemplateWithResponse":"Microsoft.DevTestLab.Artifacts.generateArmTemplate","com.azure.resourcemanager.devtestlabs.fluent.ArtifactsClient.get":"Microsoft.DevTestLab.Artifacts.get","com.azure.resourcemanager.devtestlabs.fluent.ArtifactsClient.getWithResponse":"Microsoft.DevTestLab.Artifacts.get","com.azure.resourcemanager.devtestlabs.fluent.ArtifactsClient.list":"Microsoft.DevTestLab.Artifacts.list","com.azure.resourcemanager.devtestlabs.fluent.CostsClient":"Microsoft.DevTestLab.Costs","com.azure.resourcemanager.devtestlabs.fluent.CostsClient.createOrUpdate":"Microsoft.DevTestLab.Costs.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.CostsClient.createOrUpdateWithResponse":"Microsoft.DevTestLab.Costs.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.CostsClient.get":"Microsoft.DevTestLab.Costs.get","com.azure.resourcemanager.devtestlabs.fluent.CostsClient.getWithResponse":"Microsoft.DevTestLab.Costs.get","com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient":"Microsoft.DevTestLab.CustomImages","com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient.beginCreateOrUpdate":"Microsoft.DevTestLab.CustomImages.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient.beginDelete":"Microsoft.DevTestLab.CustomImages.delete","com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient.createOrUpdate":"Microsoft.DevTestLab.CustomImages.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient.delete":"Microsoft.DevTestLab.CustomImages.delete","com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient.get":"Microsoft.DevTestLab.CustomImages.get","com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient.getWithResponse":"Microsoft.DevTestLab.CustomImages.get","com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient.list":"Microsoft.DevTestLab.CustomImages.list","com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient.update":"Microsoft.DevTestLab.CustomImages.update","com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient.updateWithResponse":"Microsoft.DevTestLab.CustomImages.update","com.azure.resourcemanager.devtestlabs.fluent.DevTestLabsManagementClient":"Microsoft.DevTestLab","com.azure.resourcemanager.devtestlabs.fluent.DisksClient":"Microsoft.DevTestLab.Disks","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.attach":"Microsoft.DevTestLab.Disks.attach","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.beginAttach":"Microsoft.DevTestLab.Disks.attach","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.beginCreateOrUpdate":"Microsoft.DevTestLab.Disks.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.beginDelete":"Microsoft.DevTestLab.Disks.delete","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.beginDetach":"Microsoft.DevTestLab.Disks.detach","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.createOrUpdate":"Microsoft.DevTestLab.Disks.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.delete":"Microsoft.DevTestLab.Disks.delete","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.detach":"Microsoft.DevTestLab.Disks.detach","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.get":"Microsoft.DevTestLab.Disks.get","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.getWithResponse":"Microsoft.DevTestLab.Disks.get","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.list":"Microsoft.DevTestLab.Disks.list","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.update":"Microsoft.DevTestLab.Disks.update","com.azure.resourcemanager.devtestlabs.fluent.DisksClient.updateWithResponse":"Microsoft.DevTestLab.Disks.update","com.azure.resourcemanager.devtestlabs.fluent.EnvironmentsClient":"Microsoft.DevTestLab.Environments","com.azure.resourcemanager.devtestlabs.fluent.EnvironmentsClient.beginCreateOrUpdate":"Microsoft.DevTestLab.Environments.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.EnvironmentsClient.beginDelete":"Microsoft.DevTestLab.Environments.delete","com.azure.resourcemanager.devtestlabs.fluent.EnvironmentsClient.createOrUpdate":"Microsoft.DevTestLab.Environments.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.EnvironmentsClient.delete":"Microsoft.DevTestLab.Environments.delete","com.azure.resourcemanager.devtestlabs.fluent.EnvironmentsClient.get":"Microsoft.DevTestLab.Environments.get","com.azure.resourcemanager.devtestlabs.fluent.EnvironmentsClient.getWithResponse":"Microsoft.DevTestLab.Environments.get","com.azure.resourcemanager.devtestlabs.fluent.EnvironmentsClient.list":"Microsoft.DevTestLab.Environments.list","com.azure.resourcemanager.devtestlabs.fluent.EnvironmentsClient.update":"Microsoft.DevTestLab.Environments.update","com.azure.resourcemanager.devtestlabs.fluent.EnvironmentsClient.updateWithResponse":"Microsoft.DevTestLab.Environments.update","com.azure.resourcemanager.devtestlabs.fluent.FormulasClient":"Microsoft.DevTestLab.Formulas","com.azure.resourcemanager.devtestlabs.fluent.FormulasClient.beginCreateOrUpdate":"Microsoft.DevTestLab.Formulas.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.FormulasClient.createOrUpdate":"Microsoft.DevTestLab.Formulas.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.FormulasClient.delete":"Microsoft.DevTestLab.Formulas.delete","com.azure.resourcemanager.devtestlabs.fluent.FormulasClient.deleteWithResponse":"Microsoft.DevTestLab.Formulas.delete","com.azure.resourcemanager.devtestlabs.fluent.FormulasClient.get":"Microsoft.DevTestLab.Formulas.get","com.azure.resourcemanager.devtestlabs.fluent.FormulasClient.getWithResponse":"Microsoft.DevTestLab.Formulas.get","com.azure.resourcemanager.devtestlabs.fluent.FormulasClient.list":"Microsoft.DevTestLab.Formulas.list","com.azure.resourcemanager.devtestlabs.fluent.FormulasClient.update":"Microsoft.DevTestLab.Formulas.update","com.azure.resourcemanager.devtestlabs.fluent.FormulasClient.updateWithResponse":"Microsoft.DevTestLab.Formulas.update","com.azure.resourcemanager.devtestlabs.fluent.GalleryImagesClient":"Microsoft.DevTestLab.GalleryImages","com.azure.resourcemanager.devtestlabs.fluent.GalleryImagesClient.list":"Microsoft.DevTestLab.GalleryImages.list","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient":"Microsoft.DevTestLab.GlobalSchedules","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.beginExecute":"Microsoft.DevTestLab.GlobalSchedules.execute","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.beginRetarget":"Microsoft.DevTestLab.GlobalSchedules.retarget","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.createOrUpdate":"Microsoft.DevTestLab.GlobalSchedules.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.createOrUpdateWithResponse":"Microsoft.DevTestLab.GlobalSchedules.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.delete":"Microsoft.DevTestLab.GlobalSchedules.delete","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.deleteWithResponse":"Microsoft.DevTestLab.GlobalSchedules.delete","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.execute":"Microsoft.DevTestLab.GlobalSchedules.execute","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.getByResourceGroup":"Microsoft.DevTestLab.GlobalSchedules.get","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.getByResourceGroupWithResponse":"Microsoft.DevTestLab.GlobalSchedules.get","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.list":"Microsoft.DevTestLab.GlobalSchedules.listBySubscription","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.listByResourceGroup":"Microsoft.DevTestLab.GlobalSchedules.listByResourceGroup","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.retarget":"Microsoft.DevTestLab.GlobalSchedules.retarget","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.update":"Microsoft.DevTestLab.GlobalSchedules.update","com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient.updateWithResponse":"Microsoft.DevTestLab.GlobalSchedules.update","com.azure.resourcemanager.devtestlabs.fluent.LabsClient":"Microsoft.DevTestLab.Labs","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.beginClaimAnyVm":"Microsoft.DevTestLab.Labs.claimAnyVm","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.beginCreateEnvironment":"Microsoft.DevTestLab.Labs.createEnvironment","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.beginCreateOrUpdate":"Microsoft.DevTestLab.Labs.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.beginDelete":"Microsoft.DevTestLab.Labs.delete","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.beginExportResourceUsage":"Microsoft.DevTestLab.Labs.exportResourceUsage","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.beginImportVirtualMachine":"Microsoft.DevTestLab.Labs.importVirtualMachine","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.claimAnyVm":"Microsoft.DevTestLab.Labs.claimAnyVm","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.createEnvironment":"Microsoft.DevTestLab.Labs.createEnvironment","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.createOrUpdate":"Microsoft.DevTestLab.Labs.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.delete":"Microsoft.DevTestLab.Labs.delete","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.exportResourceUsage":"Microsoft.DevTestLab.Labs.exportResourceUsage","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.generateUploadUri":"Microsoft.DevTestLab.Labs.generateUploadUri","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.generateUploadUriWithResponse":"Microsoft.DevTestLab.Labs.generateUploadUri","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.getByResourceGroup":"Microsoft.DevTestLab.Labs.get","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.getByResourceGroupWithResponse":"Microsoft.DevTestLab.Labs.get","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.importVirtualMachine":"Microsoft.DevTestLab.Labs.importVirtualMachine","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.list":"Microsoft.DevTestLab.Labs.listBySubscription","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.listByResourceGroup":"Microsoft.DevTestLab.Labs.listByResourceGroup","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.listVhds":"Microsoft.DevTestLab.Labs.listVhds","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.update":"Microsoft.DevTestLab.Labs.update","com.azure.resourcemanager.devtestlabs.fluent.LabsClient.updateWithResponse":"Microsoft.DevTestLab.Labs.update","com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient":"Microsoft.DevTestLab.NotificationChannels","com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient.createOrUpdate":"Microsoft.DevTestLab.NotificationChannels.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient.createOrUpdateWithResponse":"Microsoft.DevTestLab.NotificationChannels.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient.delete":"Microsoft.DevTestLab.NotificationChannels.delete","com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient.deleteWithResponse":"Microsoft.DevTestLab.NotificationChannels.delete","com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient.get":"Microsoft.DevTestLab.NotificationChannels.get","com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient.getWithResponse":"Microsoft.DevTestLab.NotificationChannels.get","com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient.list":"Microsoft.DevTestLab.NotificationChannels.list","com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient.notify":"Microsoft.DevTestLab.NotificationChannels.notify","com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient.notifyWithResponse":"Microsoft.DevTestLab.NotificationChannels.notify","com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient.update":"Microsoft.DevTestLab.NotificationChannels.update","com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient.updateWithResponse":"Microsoft.DevTestLab.NotificationChannels.update","com.azure.resourcemanager.devtestlabs.fluent.OperationsClient":"Microsoft.DevTestLab.Operations","com.azure.resourcemanager.devtestlabs.fluent.OperationsClient.get":"Microsoft.DevTestLab.Operations.get","com.azure.resourcemanager.devtestlabs.fluent.OperationsClient.getWithResponse":"Microsoft.DevTestLab.Operations.get","com.azure.resourcemanager.devtestlabs.fluent.PoliciesClient":"Microsoft.DevTestLab.Policies","com.azure.resourcemanager.devtestlabs.fluent.PoliciesClient.createOrUpdate":"Microsoft.DevTestLab.Policies.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.PoliciesClient.createOrUpdateWithResponse":"Microsoft.DevTestLab.Policies.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.PoliciesClient.delete":"Microsoft.DevTestLab.Policies.delete","com.azure.resourcemanager.devtestlabs.fluent.PoliciesClient.deleteWithResponse":"Microsoft.DevTestLab.Policies.delete","com.azure.resourcemanager.devtestlabs.fluent.PoliciesClient.get":"Microsoft.DevTestLab.Policies.get","com.azure.resourcemanager.devtestlabs.fluent.PoliciesClient.getWithResponse":"Microsoft.DevTestLab.Policies.get","com.azure.resourcemanager.devtestlabs.fluent.PoliciesClient.list":"Microsoft.DevTestLab.Policies.list","com.azure.resourcemanager.devtestlabs.fluent.PoliciesClient.update":"Microsoft.DevTestLab.Policies.update","com.azure.resourcemanager.devtestlabs.fluent.PoliciesClient.updateWithResponse":"Microsoft.DevTestLab.Policies.update","com.azure.resourcemanager.devtestlabs.fluent.PolicySetsClient":"Microsoft.DevTestLab.PolicySets","com.azure.resourcemanager.devtestlabs.fluent.PolicySetsClient.evaluatePolicies":"Microsoft.DevTestLab.PolicySets.evaluatePolicies","com.azure.resourcemanager.devtestlabs.fluent.PolicySetsClient.evaluatePoliciesWithResponse":"Microsoft.DevTestLab.PolicySets.evaluatePolicies","com.azure.resourcemanager.devtestlabs.fluent.ProviderOperationsClient":"Microsoft.DevTestLab.ProviderOperations","com.azure.resourcemanager.devtestlabs.fluent.ProviderOperationsClient.list":"Azure.ResourceManager.ProviderOperations.list","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient":"Microsoft.DevTestLab.Schedules","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient.beginExecute":"Microsoft.DevTestLab.Schedules.execute","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient.createOrUpdate":"Microsoft.DevTestLab.Schedules.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient.createOrUpdateWithResponse":"Microsoft.DevTestLab.Schedules.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient.delete":"Microsoft.DevTestLab.Schedules.delete","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient.deleteWithResponse":"Microsoft.DevTestLab.Schedules.delete","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient.execute":"Microsoft.DevTestLab.Schedules.execute","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient.get":"Microsoft.DevTestLab.Schedules.get","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient.getWithResponse":"Microsoft.DevTestLab.Schedules.get","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient.list":"Microsoft.DevTestLab.Schedules.list","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient.listApplicable":"Microsoft.DevTestLab.Schedules.listApplicable","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient.update":"Microsoft.DevTestLab.Schedules.update","com.azure.resourcemanager.devtestlabs.fluent.SchedulesClient.updateWithResponse":"Microsoft.DevTestLab.Schedules.update","com.azure.resourcemanager.devtestlabs.fluent.SecretsClient":"Microsoft.DevTestLab.Secrets","com.azure.resourcemanager.devtestlabs.fluent.SecretsClient.beginCreateOrUpdate":"Microsoft.DevTestLab.Secrets.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.SecretsClient.createOrUpdate":"Microsoft.DevTestLab.Secrets.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.SecretsClient.delete":"Microsoft.DevTestLab.Secrets.delete","com.azure.resourcemanager.devtestlabs.fluent.SecretsClient.deleteWithResponse":"Microsoft.DevTestLab.Secrets.delete","com.azure.resourcemanager.devtestlabs.fluent.SecretsClient.get":"Microsoft.DevTestLab.Secrets.get","com.azure.resourcemanager.devtestlabs.fluent.SecretsClient.getWithResponse":"Microsoft.DevTestLab.Secrets.get","com.azure.resourcemanager.devtestlabs.fluent.SecretsClient.list":"Microsoft.DevTestLab.Secrets.list","com.azure.resourcemanager.devtestlabs.fluent.SecretsClient.update":"Microsoft.DevTestLab.Secrets.update","com.azure.resourcemanager.devtestlabs.fluent.SecretsClient.updateWithResponse":"Microsoft.DevTestLab.Secrets.update","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient":"Microsoft.DevTestLab.ServiceFabricSchedules","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient.beginExecute":"Microsoft.DevTestLab.ServiceFabricSchedules.execute","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient.createOrUpdate":"Microsoft.DevTestLab.ServiceFabricSchedules.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient.createOrUpdateWithResponse":"Microsoft.DevTestLab.ServiceFabricSchedules.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient.delete":"Microsoft.DevTestLab.ServiceFabricSchedules.delete","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient.deleteWithResponse":"Microsoft.DevTestLab.ServiceFabricSchedules.delete","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient.execute":"Microsoft.DevTestLab.ServiceFabricSchedules.execute","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient.get":"Microsoft.DevTestLab.ServiceFabricSchedules.get","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient.getWithResponse":"Microsoft.DevTestLab.ServiceFabricSchedules.get","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient.list":"Microsoft.DevTestLab.ServiceFabricSchedules.list","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient.update":"Microsoft.DevTestLab.ServiceFabricSchedules.update","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient.updateWithResponse":"Microsoft.DevTestLab.ServiceFabricSchedules.update","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient":"Microsoft.DevTestLab.ServiceFabrics","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.beginCreateOrUpdate":"Microsoft.DevTestLab.ServiceFabrics.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.beginDelete":"Microsoft.DevTestLab.ServiceFabrics.delete","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.beginStart":"Microsoft.DevTestLab.ServiceFabrics.start","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.beginStop":"Microsoft.DevTestLab.ServiceFabrics.stop","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.createOrUpdate":"Microsoft.DevTestLab.ServiceFabrics.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.delete":"Microsoft.DevTestLab.ServiceFabrics.delete","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.get":"Microsoft.DevTestLab.ServiceFabrics.get","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.getWithResponse":"Microsoft.DevTestLab.ServiceFabrics.get","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.list":"Microsoft.DevTestLab.ServiceFabrics.list","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.listApplicableSchedules":"Microsoft.DevTestLab.ServiceFabrics.listApplicableSchedules","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.listApplicableSchedulesWithResponse":"Microsoft.DevTestLab.ServiceFabrics.listApplicableSchedules","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.start":"Microsoft.DevTestLab.ServiceFabrics.start","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.stop":"Microsoft.DevTestLab.ServiceFabrics.stop","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.update":"Microsoft.DevTestLab.ServiceFabrics.update","com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient.updateWithResponse":"Microsoft.DevTestLab.ServiceFabrics.update","com.azure.resourcemanager.devtestlabs.fluent.ServiceRunnersClient":"Microsoft.DevTestLab.ServiceRunners","com.azure.resourcemanager.devtestlabs.fluent.ServiceRunnersClient.createOrUpdate":"Microsoft.DevTestLab.ServiceRunners.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.ServiceRunnersClient.createOrUpdateWithResponse":"Microsoft.DevTestLab.ServiceRunners.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.ServiceRunnersClient.delete":"Microsoft.DevTestLab.ServiceRunners.delete","com.azure.resourcemanager.devtestlabs.fluent.ServiceRunnersClient.deleteWithResponse":"Microsoft.DevTestLab.ServiceRunners.delete","com.azure.resourcemanager.devtestlabs.fluent.ServiceRunnersClient.get":"Microsoft.DevTestLab.ServiceRunners.get","com.azure.resourcemanager.devtestlabs.fluent.ServiceRunnersClient.getWithResponse":"Microsoft.DevTestLab.ServiceRunners.get","com.azure.resourcemanager.devtestlabs.fluent.UsersClient":"Microsoft.DevTestLab.Users","com.azure.resourcemanager.devtestlabs.fluent.UsersClient.beginCreateOrUpdate":"Microsoft.DevTestLab.Users.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.UsersClient.beginDelete":"Microsoft.DevTestLab.Users.delete","com.azure.resourcemanager.devtestlabs.fluent.UsersClient.createOrUpdate":"Microsoft.DevTestLab.Users.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.UsersClient.delete":"Microsoft.DevTestLab.Users.delete","com.azure.resourcemanager.devtestlabs.fluent.UsersClient.get":"Microsoft.DevTestLab.Users.get","com.azure.resourcemanager.devtestlabs.fluent.UsersClient.getWithResponse":"Microsoft.DevTestLab.Users.get","com.azure.resourcemanager.devtestlabs.fluent.UsersClient.list":"Microsoft.DevTestLab.Users.list","com.azure.resourcemanager.devtestlabs.fluent.UsersClient.update":"Microsoft.DevTestLab.Users.update","com.azure.resourcemanager.devtestlabs.fluent.UsersClient.updateWithResponse":"Microsoft.DevTestLab.Users.update","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient":"Microsoft.DevTestLab.VirtualMachineSchedules","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient.beginExecute":"Microsoft.DevTestLab.VirtualMachineSchedules.execute","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient.createOrUpdate":"Microsoft.DevTestLab.VirtualMachineSchedules.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient.createOrUpdateWithResponse":"Microsoft.DevTestLab.VirtualMachineSchedules.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient.delete":"Microsoft.DevTestLab.VirtualMachineSchedules.delete","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient.deleteWithResponse":"Microsoft.DevTestLab.VirtualMachineSchedules.delete","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient.execute":"Microsoft.DevTestLab.VirtualMachineSchedules.execute","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient.get":"Microsoft.DevTestLab.VirtualMachineSchedules.get","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient.getWithResponse":"Microsoft.DevTestLab.VirtualMachineSchedules.get","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient.list":"Microsoft.DevTestLab.VirtualMachineSchedules.list","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient.update":"Microsoft.DevTestLab.VirtualMachineSchedules.update","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient.updateWithResponse":"Microsoft.DevTestLab.VirtualMachineSchedules.update","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient":"Microsoft.DevTestLab.VirtualMachines","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.addDataDisk":"Microsoft.DevTestLab.VirtualMachines.addDataDisk","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.applyArtifacts":"Microsoft.DevTestLab.VirtualMachines.applyArtifacts","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginAddDataDisk":"Microsoft.DevTestLab.VirtualMachines.addDataDisk","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginApplyArtifacts":"Microsoft.DevTestLab.VirtualMachines.applyArtifacts","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginClaim":"Microsoft.DevTestLab.VirtualMachines.claim","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginCreateOrUpdate":"Microsoft.DevTestLab.VirtualMachines.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginDelete":"Microsoft.DevTestLab.VirtualMachines.delete","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginDetachDataDisk":"Microsoft.DevTestLab.VirtualMachines.detachDataDisk","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginRedeploy":"Microsoft.DevTestLab.VirtualMachines.redeploy","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginResize":"Microsoft.DevTestLab.VirtualMachines.resize","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginRestart":"Microsoft.DevTestLab.VirtualMachines.restart","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginStart":"Microsoft.DevTestLab.VirtualMachines.start","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginStop":"Microsoft.DevTestLab.VirtualMachines.stop","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginTransferDisks":"Microsoft.DevTestLab.VirtualMachines.transferDisks","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.beginUnClaim":"Microsoft.DevTestLab.VirtualMachines.unClaim","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.claim":"Microsoft.DevTestLab.VirtualMachines.claim","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.createOrUpdate":"Microsoft.DevTestLab.VirtualMachines.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.delete":"Microsoft.DevTestLab.VirtualMachines.delete","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.detachDataDisk":"Microsoft.DevTestLab.VirtualMachines.detachDataDisk","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.get":"Microsoft.DevTestLab.VirtualMachines.get","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.getRdpFileContents":"Microsoft.DevTestLab.VirtualMachines.getRdpFileContents","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.getRdpFileContentsWithResponse":"Microsoft.DevTestLab.VirtualMachines.getRdpFileContents","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.getWithResponse":"Microsoft.DevTestLab.VirtualMachines.get","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.list":"Microsoft.DevTestLab.VirtualMachines.list","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.listApplicableSchedules":"Microsoft.DevTestLab.VirtualMachines.listApplicableSchedules","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.listApplicableSchedulesWithResponse":"Microsoft.DevTestLab.VirtualMachines.listApplicableSchedules","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.redeploy":"Microsoft.DevTestLab.VirtualMachines.redeploy","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.resize":"Microsoft.DevTestLab.VirtualMachines.resize","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.restart":"Microsoft.DevTestLab.VirtualMachines.restart","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.start":"Microsoft.DevTestLab.VirtualMachines.start","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.stop":"Microsoft.DevTestLab.VirtualMachines.stop","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.transferDisks":"Microsoft.DevTestLab.VirtualMachines.transferDisks","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.unClaim":"Microsoft.DevTestLab.VirtualMachines.unClaim","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.update":"Microsoft.DevTestLab.VirtualMachines.update","com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient.updateWithResponse":"Microsoft.DevTestLab.VirtualMachines.update","com.azure.resourcemanager.devtestlabs.fluent.VirtualNetworksClient":"Microsoft.DevTestLab.VirtualNetworks","com.azure.resourcemanager.devtestlabs.fluent.VirtualNetworksClient.beginCreateOrUpdate":"Microsoft.DevTestLab.VirtualNetworks.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.VirtualNetworksClient.beginDelete":"Microsoft.DevTestLab.VirtualNetworks.delete","com.azure.resourcemanager.devtestlabs.fluent.VirtualNetworksClient.createOrUpdate":"Microsoft.DevTestLab.VirtualNetworks.createOrUpdate","com.azure.resourcemanager.devtestlabs.fluent.VirtualNetworksClient.delete":"Microsoft.DevTestLab.VirtualNetworks.delete","com.azure.resourcemanager.devtestlabs.fluent.VirtualNetworksClient.get":"Microsoft.DevTestLab.VirtualNetworks.get","com.azure.resourcemanager.devtestlabs.fluent.VirtualNetworksClient.getWithResponse":"Microsoft.DevTestLab.VirtualNetworks.get","com.azure.resourcemanager.devtestlabs.fluent.VirtualNetworksClient.list":"Microsoft.DevTestLab.VirtualNetworks.list","com.azure.resourcemanager.devtestlabs.fluent.VirtualNetworksClient.update":"Microsoft.DevTestLab.VirtualNetworks.update","com.azure.resourcemanager.devtestlabs.fluent.VirtualNetworksClient.updateWithResponse":"Microsoft.DevTestLab.VirtualNetworks.update","com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner":"Microsoft.DevTestLab.ApplicableSchedule","com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableSchedulePropertiesInner":"Microsoft.DevTestLab.ApplicableScheduleProperties","com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInfoInner":"Microsoft.DevTestLab.ArmTemplateInfo","com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInner":"Microsoft.DevTestLab.ArmTemplate","com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateProperties":"Microsoft.DevTestLab.ArmTemplateProperties","com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactInner":"Microsoft.DevTestLab.Artifact","com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactProperties":"Microsoft.DevTestLab.ArtifactProperties","com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactSourceInner":"Microsoft.DevTestLab.ArtifactSource","com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactSourceProperties":"Microsoft.DevTestLab.ArtifactSourceProperties","com.azure.resourcemanager.devtestlabs.fluent.models.CustomImageInner":"Microsoft.DevTestLab.CustomImage","com.azure.resourcemanager.devtestlabs.fluent.models.CustomImageProperties":"Microsoft.DevTestLab.CustomImageProperties","com.azure.resourcemanager.devtestlabs.fluent.models.DiskInner":"Microsoft.DevTestLab.Disk","com.azure.resourcemanager.devtestlabs.fluent.models.DiskProperties":"Microsoft.DevTestLab.DiskProperties","com.azure.resourcemanager.devtestlabs.fluent.models.DtlEnvironmentInner":"Microsoft.DevTestLab.DtlEnvironment","com.azure.resourcemanager.devtestlabs.fluent.models.EnvironmentProperties":"Microsoft.DevTestLab.EnvironmentProperties","com.azure.resourcemanager.devtestlabs.fluent.models.EvaluatePoliciesResponseInner":"Microsoft.DevTestLab.EvaluatePoliciesResponse","com.azure.resourcemanager.devtestlabs.fluent.models.FormulaInner":"Microsoft.DevTestLab.Formula","com.azure.resourcemanager.devtestlabs.fluent.models.FormulaProperties":"Microsoft.DevTestLab.FormulaProperties","com.azure.resourcemanager.devtestlabs.fluent.models.GalleryImageInner":"Microsoft.DevTestLab.GalleryImage","com.azure.resourcemanager.devtestlabs.fluent.models.GalleryImageProperties":"Microsoft.DevTestLab.GalleryImageProperties","com.azure.resourcemanager.devtestlabs.fluent.models.GenerateUploadUriResponseInner":"Microsoft.DevTestLab.GenerateUploadUriResponse","com.azure.resourcemanager.devtestlabs.fluent.models.LabCostInner":"Microsoft.DevTestLab.LabCost","com.azure.resourcemanager.devtestlabs.fluent.models.LabCostProperties":"Microsoft.DevTestLab.LabCostProperties","com.azure.resourcemanager.devtestlabs.fluent.models.LabInner":"Microsoft.DevTestLab.Lab","com.azure.resourcemanager.devtestlabs.fluent.models.LabProperties":"Microsoft.DevTestLab.LabProperties","com.azure.resourcemanager.devtestlabs.fluent.models.LabVhdInner":"Microsoft.DevTestLab.LabVhd","com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterProperties":"Microsoft.DevTestLab.LabVirtualMachineCreationParameterProperties","com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineInner":"Microsoft.DevTestLab.LabVirtualMachine","com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachinePropertiesInner":"Microsoft.DevTestLab.LabVirtualMachineProperties","com.azure.resourcemanager.devtestlabs.fluent.models.NotificationChannelInner":"Microsoft.DevTestLab.NotificationChannel","com.azure.resourcemanager.devtestlabs.fluent.models.NotificationChannelProperties":"Microsoft.DevTestLab.NotificationChannelProperties","com.azure.resourcemanager.devtestlabs.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.devtestlabs.fluent.models.OperationResultInner":"Microsoft.DevTestLab.OperationResult","com.azure.resourcemanager.devtestlabs.fluent.models.PolicyInner":"Microsoft.DevTestLab.Policy","com.azure.resourcemanager.devtestlabs.fluent.models.PolicyProperties":"Microsoft.DevTestLab.PolicyProperties","com.azure.resourcemanager.devtestlabs.fluent.models.RdpConnectionInner":"Microsoft.DevTestLab.RdpConnection","com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleCreationParameterProperties":"Microsoft.DevTestLab.ScheduleCreationParameterProperties","com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner":"Microsoft.DevTestLab.Schedule","com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleProperties":"Microsoft.DevTestLab.ScheduleProperties","com.azure.resourcemanager.devtestlabs.fluent.models.SecretInner":"Microsoft.DevTestLab.Secret","com.azure.resourcemanager.devtestlabs.fluent.models.SecretProperties":"Microsoft.DevTestLab.SecretProperties","com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricInner":"Microsoft.DevTestLab.ServiceFabric","com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricPropertiesInner":"Microsoft.DevTestLab.ServiceFabricProperties","com.azure.resourcemanager.devtestlabs.fluent.models.ServiceRunnerInner":"Microsoft.DevTestLab.ServiceRunner","com.azure.resourcemanager.devtestlabs.fluent.models.UserInner":"Microsoft.DevTestLab.User","com.azure.resourcemanager.devtestlabs.fluent.models.UserProperties":"Microsoft.DevTestLab.UserProperties","com.azure.resourcemanager.devtestlabs.fluent.models.VirtualNetworkInner":"Microsoft.DevTestLab.VirtualNetwork","com.azure.resourcemanager.devtestlabs.fluent.models.VirtualNetworkProperties":"Microsoft.DevTestLab.VirtualNetworkProperties","com.azure.resourcemanager.devtestlabs.implementation.DevTestLabsManagementClientBuilder":"Microsoft.DevTestLab","com.azure.resourcemanager.devtestlabs.implementation.models.ArmTemplateList":"Microsoft.DevTestLab.ArmTemplateList","com.azure.resourcemanager.devtestlabs.implementation.models.ArtifactList":"Microsoft.DevTestLab.ArtifactList","com.azure.resourcemanager.devtestlabs.implementation.models.ArtifactSourceList":"Microsoft.DevTestLab.ArtifactSourceList","com.azure.resourcemanager.devtestlabs.implementation.models.CustomImageList":"Microsoft.DevTestLab.CustomImageList","com.azure.resourcemanager.devtestlabs.implementation.models.DiskList":"Microsoft.DevTestLab.DiskList","com.azure.resourcemanager.devtestlabs.implementation.models.DtlEnvironmentList":"Microsoft.DevTestLab.DtlEnvironmentList","com.azure.resourcemanager.devtestlabs.implementation.models.FormulaList":"Microsoft.DevTestLab.FormulaList","com.azure.resourcemanager.devtestlabs.implementation.models.GalleryImageList":"Microsoft.DevTestLab.GalleryImageList","com.azure.resourcemanager.devtestlabs.implementation.models.LabList":"Microsoft.DevTestLab.LabList","com.azure.resourcemanager.devtestlabs.implementation.models.LabVhdList":"Microsoft.DevTestLab.LabVhdList","com.azure.resourcemanager.devtestlabs.implementation.models.LabVirtualMachineList":"Microsoft.DevTestLab.LabVirtualMachineList","com.azure.resourcemanager.devtestlabs.implementation.models.NotificationChannelList":"Microsoft.DevTestLab.NotificationChannelList","com.azure.resourcemanager.devtestlabs.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.devtestlabs.implementation.models.PolicyList":"Microsoft.DevTestLab.PolicyList","com.azure.resourcemanager.devtestlabs.implementation.models.ScheduleList":"Microsoft.DevTestLab.ScheduleList","com.azure.resourcemanager.devtestlabs.implementation.models.SecretList":"Microsoft.DevTestLab.SecretList","com.azure.resourcemanager.devtestlabs.implementation.models.ServiceFabricList":"Microsoft.DevTestLab.ServiceFabricList","com.azure.resourcemanager.devtestlabs.implementation.models.UserList":"Microsoft.DevTestLab.UserList","com.azure.resourcemanager.devtestlabs.implementation.models.VirtualNetworkList":"Microsoft.DevTestLab.VirtualNetworkList","com.azure.resourcemanager.devtestlabs.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.devtestlabs.models.ApplyArtifactsRequest":"Microsoft.DevTestLab.ApplyArtifactsRequest","com.azure.resourcemanager.devtestlabs.models.ArmTemplateParameterProperties":"Microsoft.DevTestLab.ArmTemplateParameterProperties","com.azure.resourcemanager.devtestlabs.models.ArtifactDeploymentStatusProperties":"Microsoft.DevTestLab.ArtifactDeploymentStatusProperties","com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties":"Microsoft.DevTestLab.ArtifactInstallProperties","com.azure.resourcemanager.devtestlabs.models.ArtifactParameterProperties":"Microsoft.DevTestLab.ArtifactParameterProperties","com.azure.resourcemanager.devtestlabs.models.ArtifactSourceFragment":"Microsoft.DevTestLab.ArtifactSourceFragment","com.azure.resourcemanager.devtestlabs.models.AttachDiskProperties":"Microsoft.DevTestLab.AttachDiskProperties","com.azure.resourcemanager.devtestlabs.models.AttachNewDataDiskOptions":"Microsoft.DevTestLab.AttachNewDataDiskOptions","com.azure.resourcemanager.devtestlabs.models.BulkCreationParameters":"Microsoft.DevTestLab.BulkCreationParameters","com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk":"Microsoft.DevTestLab.ComputeDataDisk","com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus":"Microsoft.DevTestLab.ComputeVmInstanceViewStatus","com.azure.resourcemanager.devtestlabs.models.ComputeVmProperties":"Microsoft.DevTestLab.ComputeVmProperties","com.azure.resourcemanager.devtestlabs.models.CostThresholdProperties":"Microsoft.DevTestLab.CostThresholdProperties","com.azure.resourcemanager.devtestlabs.models.CostThresholdStatus":"Microsoft.DevTestLab.CostThresholdStatus","com.azure.resourcemanager.devtestlabs.models.CostType":"Microsoft.DevTestLab.CostType","com.azure.resourcemanager.devtestlabs.models.CustomImageFragment":"Microsoft.DevTestLab.CustomImageFragment","com.azure.resourcemanager.devtestlabs.models.CustomImageOsType":"Microsoft.DevTestLab.CustomImageOsType","com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesCustom":"Microsoft.DevTestLab.CustomImagePropertiesCustom","com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromPlan":"Microsoft.DevTestLab.CustomImagePropertiesFromPlan","com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromVm":"Microsoft.DevTestLab.CustomImagePropertiesFromVm","com.azure.resourcemanager.devtestlabs.models.DataDiskProperties":"Microsoft.DevTestLab.DataDiskProperties","com.azure.resourcemanager.devtestlabs.models.DataDiskStorageTypeInfo":"Microsoft.DevTestLab.DataDiskStorageTypeInfo","com.azure.resourcemanager.devtestlabs.models.DayDetails":"Microsoft.DevTestLab.DayDetails","com.azure.resourcemanager.devtestlabs.models.DetachDataDiskProperties":"Microsoft.DevTestLab.DetachDataDiskProperties","com.azure.resourcemanager.devtestlabs.models.DetachDiskProperties":"Microsoft.DevTestLab.DetachDiskProperties","com.azure.resourcemanager.devtestlabs.models.DiskFragment":"Microsoft.DevTestLab.DiskFragment","com.azure.resourcemanager.devtestlabs.models.DtlEnvironmentFragment":"Microsoft.DevTestLab.DtlEnvironmentFragment","com.azure.resourcemanager.devtestlabs.models.EnableStatus":"Microsoft.DevTestLab.EnableStatus","com.azure.resourcemanager.devtestlabs.models.EnvironmentDeploymentProperties":"Microsoft.DevTestLab.EnvironmentDeploymentProperties","com.azure.resourcemanager.devtestlabs.models.EnvironmentPermission":"Microsoft.DevTestLab.EnvironmentPermission","com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesProperties":"Microsoft.DevTestLab.EvaluatePoliciesProperties","com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesRequest":"Microsoft.DevTestLab.EvaluatePoliciesRequest","com.azure.resourcemanager.devtestlabs.models.Event":"Microsoft.DevTestLab.Event","com.azure.resourcemanager.devtestlabs.models.ExportResourceUsageParameters":"Microsoft.DevTestLab.ExportResourceUsageParameters","com.azure.resourcemanager.devtestlabs.models.ExternalSubnet":"Microsoft.DevTestLab.ExternalSubnet","com.azure.resourcemanager.devtestlabs.models.FileUploadOptions":"Microsoft.DevTestLab.FileUploadOptions","com.azure.resourcemanager.devtestlabs.models.FormulaFragment":"Microsoft.DevTestLab.FormulaFragment","com.azure.resourcemanager.devtestlabs.models.FormulaPropertiesFromVm":"Microsoft.DevTestLab.FormulaPropertiesFromVm","com.azure.resourcemanager.devtestlabs.models.GalleryImageReference":"Microsoft.DevTestLab.GalleryImageReference","com.azure.resourcemanager.devtestlabs.models.GenerateArmTemplateRequest":"Microsoft.DevTestLab.GenerateArmTemplateRequest","com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriParameter":"Microsoft.DevTestLab.GenerateUploadUriParameter","com.azure.resourcemanager.devtestlabs.models.HostCachingOptions":"Microsoft.DevTestLab.HostCachingOptions","com.azure.resourcemanager.devtestlabs.models.HourDetails":"Microsoft.DevTestLab.HourDetails","com.azure.resourcemanager.devtestlabs.models.HttpStatusCode":"Microsoft.DevTestLab.HttpStatusCode","com.azure.resourcemanager.devtestlabs.models.IdentityProperties":"Microsoft.DevTestLab.IdentityProperties","com.azure.resourcemanager.devtestlabs.models.ImportLabVirtualMachineRequest":"Microsoft.DevTestLab.ImportLabVirtualMachineRequest","com.azure.resourcemanager.devtestlabs.models.InboundNatRule":"Microsoft.DevTestLab.InboundNatRule","com.azure.resourcemanager.devtestlabs.models.LabAnnouncementProperties":"Microsoft.DevTestLab.LabAnnouncementProperties","com.azure.resourcemanager.devtestlabs.models.LabCostDetailsProperties":"Microsoft.DevTestLab.LabCostDetailsProperties","com.azure.resourcemanager.devtestlabs.models.LabCostSummaryProperties":"Microsoft.DevTestLab.LabCostSummaryProperties","com.azure.resourcemanager.devtestlabs.models.LabFragment":"Microsoft.DevTestLab.LabFragment","com.azure.resourcemanager.devtestlabs.models.LabResourceCostProperties":"Microsoft.DevTestLab.LabResourceCostProperties","com.azure.resourcemanager.devtestlabs.models.LabSupportProperties":"Microsoft.DevTestLab.LabSupportProperties","com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter":"Microsoft.DevTestLab.LabVirtualMachineCreationParameter","com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineFragment":"Microsoft.DevTestLab.LabVirtualMachineFragment","com.azure.resourcemanager.devtestlabs.models.LinuxOsInfo":"Microsoft.DevTestLab.LinuxOsInfo","com.azure.resourcemanager.devtestlabs.models.LinuxOsState":"Microsoft.DevTestLab.LinuxOsState","com.azure.resourcemanager.devtestlabs.models.ManagedIdentityType":"Microsoft.DevTestLab.ManagedIdentityType","com.azure.resourcemanager.devtestlabs.models.NetworkInterfaceProperties":"Microsoft.DevTestLab.NetworkInterfaceProperties","com.azure.resourcemanager.devtestlabs.models.NotificationChannelEventType":"Microsoft.DevTestLab.NotificationChannelEventType","com.azure.resourcemanager.devtestlabs.models.NotificationChannelFragment":"Microsoft.DevTestLab.NotificationChannelFragment","com.azure.resourcemanager.devtestlabs.models.NotificationSettings":"Microsoft.DevTestLab.NotificationSettings","com.azure.resourcemanager.devtestlabs.models.NotifyParameters":"Microsoft.DevTestLab.NotifyParameters","com.azure.resourcemanager.devtestlabs.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.devtestlabs.models.OperationError":"Microsoft.DevTestLab.OperationError","com.azure.resourcemanager.devtestlabs.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.devtestlabs.models.ParameterInfo":"Microsoft.DevTestLab.ParameterInfo","com.azure.resourcemanager.devtestlabs.models.ParametersValueFileInfo":"Microsoft.DevTestLab.ParametersValueFileInfo","com.azure.resourcemanager.devtestlabs.models.PercentageCostThresholdProperties":"Microsoft.DevTestLab.PercentageCostThresholdProperties","com.azure.resourcemanager.devtestlabs.models.PolicyEvaluatorType":"Microsoft.DevTestLab.PolicyEvaluatorType","com.azure.resourcemanager.devtestlabs.models.PolicyFactName":"Microsoft.DevTestLab.PolicyFactName","com.azure.resourcemanager.devtestlabs.models.PolicyFragment":"Microsoft.DevTestLab.PolicyFragment","com.azure.resourcemanager.devtestlabs.models.PolicySetResult":"Microsoft.DevTestLab.PolicySetResult","com.azure.resourcemanager.devtestlabs.models.PolicyStatus":"Microsoft.DevTestLab.PolicyStatus","com.azure.resourcemanager.devtestlabs.models.PolicyViolation":"Microsoft.DevTestLab.PolicyViolation","com.azure.resourcemanager.devtestlabs.models.Port":"Microsoft.DevTestLab.Port","com.azure.resourcemanager.devtestlabs.models.PremiumDataDisk":"Microsoft.DevTestLab.PremiumDataDisk","com.azure.resourcemanager.devtestlabs.models.ReportingCycleType":"Microsoft.DevTestLab.ReportingCycleType","com.azure.resourcemanager.devtestlabs.models.ResizeLabVirtualMachineProperties":"Microsoft.DevTestLab.ResizeLabVirtualMachineProperties","com.azure.resourcemanager.devtestlabs.models.RetargetScheduleProperties":"Microsoft.DevTestLab.RetargetScheduleProperties","com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter":"Microsoft.DevTestLab.ScheduleCreationParameter","com.azure.resourcemanager.devtestlabs.models.ScheduleFragment":"Microsoft.DevTestLab.ScheduleFragment","com.azure.resourcemanager.devtestlabs.models.SecretFragment":"Microsoft.DevTestLab.SecretFragment","com.azure.resourcemanager.devtestlabs.models.ServiceFabricFragment":"Microsoft.DevTestLab.ServiceFabricFragment","com.azure.resourcemanager.devtestlabs.models.SharedPublicIpAddressConfiguration":"Microsoft.DevTestLab.SharedPublicIpAddressConfiguration","com.azure.resourcemanager.devtestlabs.models.SourceControlType":"Microsoft.DevTestLab.SourceControlType","com.azure.resourcemanager.devtestlabs.models.StorageType":"Microsoft.DevTestLab.StorageType","com.azure.resourcemanager.devtestlabs.models.Subnet":"Microsoft.DevTestLab.Subnet","com.azure.resourcemanager.devtestlabs.models.SubnetOverride":"Microsoft.DevTestLab.SubnetOverride","com.azure.resourcemanager.devtestlabs.models.SubnetSharedPublicIpAddressConfiguration":"Microsoft.DevTestLab.SubnetSharedPublicIpAddressConfiguration","com.azure.resourcemanager.devtestlabs.models.TargetCostProperties":"Microsoft.DevTestLab.TargetCostProperties","com.azure.resourcemanager.devtestlabs.models.TargetCostStatus":"Microsoft.DevTestLab.TargetCostStatus","com.azure.resourcemanager.devtestlabs.models.TransportProtocol":"Microsoft.DevTestLab.TransportProtocol","com.azure.resourcemanager.devtestlabs.models.UpdateResource":"Microsoft.DevTestLab.UpdateResource","com.azure.resourcemanager.devtestlabs.models.UsagePermissionType":"Microsoft.DevTestLab.UsagePermissionType","com.azure.resourcemanager.devtestlabs.models.UserFragment":"Microsoft.DevTestLab.UserFragment","com.azure.resourcemanager.devtestlabs.models.UserIdentity":"Microsoft.DevTestLab.UserIdentity","com.azure.resourcemanager.devtestlabs.models.UserSecretStore":"Microsoft.DevTestLab.UserSecretStore","com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource":"Microsoft.DevTestLab.VirtualMachineCreationSource","com.azure.resourcemanager.devtestlabs.models.VirtualNetworkFragment":"Microsoft.DevTestLab.VirtualNetworkFragment","com.azure.resourcemanager.devtestlabs.models.WeekDetails":"Microsoft.DevTestLab.WeekDetails","com.azure.resourcemanager.devtestlabs.models.WindowsOsInfo":"Microsoft.DevTestLab.WindowsOsInfo","com.azure.resourcemanager.devtestlabs.models.WindowsOsState":"Microsoft.DevTestLab.WindowsOsState"},"generatedFiles":["src/main/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManager.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArmTemplatesClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactSourcesClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactsClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CostsClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CustomImagesClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DevTestLabsManagementClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DisksClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/EnvironmentsClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/FormulasClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GalleryImagesClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GlobalSchedulesClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/LabsClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/NotificationChannelsClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PoliciesClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PolicySetsClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ProviderOperationsClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SchedulesClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SecretsClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricSchedulesClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricsClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceRunnersClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/UsersClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachineSchedulesClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachinesClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualNetworksClient.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableScheduleInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableSchedulePropertiesInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInfoInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DtlEnvironmentInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EvaluatePoliciesResponseInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GenerateUploadUriResponseInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVhdInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachinePropertiesInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationResultInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/RdpConnectionInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleCreationParameterProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricPropertiesInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceRunnerInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkInner.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/devtestlabs/fluent/package-info.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableScheduleImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableSchedulePropertiesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateInfoImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourceImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImageImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsManagementClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DiskImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DtlEnvironmentImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EvaluatePoliciesResponseImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulaImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImageImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GenerateUploadUriResponseImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabCostImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVhdImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachinePropertiesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationResultImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicyImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/RdpConnectionImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ScheduleImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricPropertiesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnerImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UserImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworkImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksClientImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksImpl.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ArmTemplateList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ArtifactList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ArtifactSourceList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/CustomImageList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/DiskList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/DtlEnvironmentList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/FormulaList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/GalleryImageList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/LabList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/LabVhdList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/LabVirtualMachineList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/NotificationChannelList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/PolicyList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ScheduleList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/SecretList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/ServiceFabricList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/UserList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/models/VirtualNetworkList.java","src/main/java/com/azure/resourcemanager/devtestlabs/implementation/package-info.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ActionType.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableSchedule.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplyArtifactsRequest.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplate.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateInfo.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateParameterProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplates.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifact.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactDeploymentStatusProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactInstallProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactParameterProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSource.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSources.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifacts.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachDiskProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachNewDataDiskOptions.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/BulkCreationParameters.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeDataDisk.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeVmInstanceViewStatus.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeVmProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdStatus.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/CostType.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Costs.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImage.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageOsType.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesCustom.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromPlan.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromVm.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImages.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskStorageTypeInfo.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/DayDetails.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/DetachDataDiskProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/DetachDiskProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Disk.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Disks.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/EnableStatus.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentDeploymentProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentPermission.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Environments.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesRequest.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/EvaluatePoliciesResponse.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Event.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ExportResourceUsageParameters.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ExternalSubnet.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/FileUploadOptions.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Formula.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaPropertiesFromVm.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Formulas.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImage.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageReference.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImages.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateArmTemplateRequest.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateUploadUriParameter.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/GenerateUploadUriResponse.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/GlobalSchedules.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/HostCachingOptions.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/HourDetails.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/HttpStatusCode.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/IdentityProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ImportLabVirtualMachineRequest.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/InboundNatRule.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Lab.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LabAnnouncementProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCost.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCostDetailsProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCostSummaryProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LabFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LabResourceCostProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSupportProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVhd.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachine.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineCreationParameter.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Labs.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsInfo.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsState.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ManagedIdentityType.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/NetworkInterfaceProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannel.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelEventType.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannels.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationSettings.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/NotifyParameters.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Operation.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationError.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationResult.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Operations.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Origin.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ParameterInfo.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ParametersValueFileInfo.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/PercentageCostThresholdProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Policies.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Policy.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyEvaluatorType.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFactName.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySetResult.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySets.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyStatus.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyViolation.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Port.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/PremiumDataDisk.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperations.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/RdpConnection.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ReportingCycleType.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ResizeLabVirtualMachineProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/RetargetScheduleProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedule.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleCreationParameter.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedules.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Secret.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Secrets.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabric.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricSchedules.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabrics.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunner.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunners.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedPublicIpAddressConfiguration.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/SourceControlType.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/StorageType.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Subnet.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetOverride.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetSharedPublicIpAddressConfiguration.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostProperties.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostStatus.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/TransportProtocol.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/UpdateResource.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/UsagePermissionType.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/User.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/UserFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/UserIdentity.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/UserSecretStore.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/Users.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineCreationSource.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineSchedules.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachines.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetwork.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkFragment.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworks.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/WeekDetails.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsInfo.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsState.java","src/main/java/com/azure/resourcemanager/devtestlabs/models/package-info.java","src/main/java/com/azure/resourcemanager/devtestlabs/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/resources/azure-resourcemanager-devtestlabs.properties b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/resources/azure-resourcemanager-devtestlabs.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/resources/azure-resourcemanager-devtestlabs.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetSamples.java index db48c6f04929..270217113720 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class ArmTemplatesGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_Get.json + * x-ms-original-file: 2018-09-15/ArmTemplates_Get.json */ /** * Sample code: ArmTemplates_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListSamples.java index 7bcc546eb557..1b31320c0b20 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class ArmTemplatesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_List.json + * x-ms-original-file: 2018-09-15/ArmTemplates_List.json */ /** * Sample code: ArmTemplates_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesCreateOrUpdateSamples.java index 7b608942da5a..adf0248138d3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,8 +14,7 @@ */ public final class ArtifactSourcesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ArtifactSources_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/ArtifactSources_CreateOrUpdate.json */ /** * Sample code: ArtifactSources_CreateOrUpdate. @@ -25,7 +24,6 @@ public final class ArtifactSourcesCreateOrUpdateSamples { public static void artifactSourcesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.artifactSources() .define("{artifactSourceName}") - .withRegion((String) null) .withExistingLab("resourceGroupName", "{labName}") .withTags(mapOf("tagName1", "tagValue1")) .withDisplayName("{displayName}") diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteSamples.java index f0f6a15fc513..fc36b0e54e54 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class ArtifactSourcesDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Delete - * .json + * x-ms-original-file: 2018-09-15/ArtifactSources_Delete.json */ /** * Sample code: ArtifactSources_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesGetSamples.java index e90b0e52a1b1..2dfe82880f6d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class ArtifactSourcesGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Get. - * json + * x-ms-original-file: 2018-09-15/ArtifactSources_Get.json */ /** * Sample code: ArtifactSources_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesListSamples.java index 57b6f167d48b..60a176cefb77 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class ArtifactSourcesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_List. - * json + * x-ms-original-file: 2018-09-15/ArtifactSources_List.json */ /** * Sample code: ArtifactSources_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesUpdateSamples.java index 2eaeaeca55ab..05f387a0156d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,9 +13,7 @@ */ public final class ArtifactSourcesUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Update - * .json + * x-ms-original-file: 2018-09-15/ArtifactSources_Update.json */ /** * Sample code: ArtifactSources_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateSamples.java index e2b9977877a5..2c42c972d808 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,8 +12,7 @@ */ public final class ArtifactsGenerateArmTemplateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Artifacts_GenerateArmTemplate.json + * x-ms-original-file: 2018-09-15/Artifacts_GenerateArmTemplate.json */ /** * Sample code: Artifacts_GenerateArmTemplate. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetSamples.java index 3c760bb6edc9..699c553c659d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class ArtifactsGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_Get.json + * x-ms-original-file: 2018-09-15/Artifacts_Get.json */ /** * Sample code: Artifacts_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListSamples.java index 4adedb4edd20..718f1bd88200 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class ArtifactsListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_List.json + * x-ms-original-file: 2018-09-15/Artifacts_List.json */ /** * Sample code: Artifacts_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsCreateOrUpdateSamples.java index 21e66e095de1..281059f9db2b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -18,9 +18,7 @@ */ public final class CostsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_CreateOrUpdate. - * json + * x-ms-original-file: 2018-09-15/Costs_CreateOrUpdate.json */ /** * Sample code: Costs_CreateOrUpdate. @@ -30,7 +28,6 @@ public final class CostsCreateOrUpdateSamples { public static void costsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.costs() .define("targetCost") - .withRegion((String) null) .withExistingLab("resourceGroupName", "{labName}") .withTargetCost(new TargetCostProperties().withStatus(TargetCostStatus.ENABLED) .withTarget(100) diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsGetSamples.java index 9a656cb9d9b1..703fefd54a93 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class CostsGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_Get.json + * x-ms-original-file: 2018-09-15/Costs_Get.json */ /** * Sample code: Costs_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateSamples.java index f545f674f2ea..7f44c0efa7a3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -15,8 +15,7 @@ */ public final class CustomImagesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * CustomImages_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/CustomImages_CreateOrUpdate.json */ /** * Sample code: CustomImages_CreateOrUpdate. @@ -26,7 +25,6 @@ public final class CustomImagesCreateOrUpdateSamples { public static void customImagesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.customImages() .define("{customImageName}") - .withRegion((String) null) .withExistingLab("resourceGroupName", "{labName}") .withTags(mapOf("tagName1", "tagValue1")) .withVm(new CustomImagePropertiesFromVm().withSourceVmId( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteSamples.java index 22fd5b76b394..0b4b32e470fe 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class CustomImagesDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Delete. - * json + * x-ms-original-file: 2018-09-15/CustomImages_Delete.json */ /** * Sample code: CustomImages_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetSamples.java index 9560d1f73b24..a9e1d99e614f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class CustomImagesGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Get.json + * x-ms-original-file: 2018-09-15/CustomImages_Get.json */ /** * Sample code: CustomImages_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListSamples.java index 6aec132c299d..5894cf742ff0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class CustomImagesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_List.json + * x-ms-original-file: 2018-09-15/CustomImages_List.json */ /** * Sample code: CustomImages_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesUpdateSamples.java index 9ef14bdd641a..46a375f21de7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,9 +13,7 @@ */ public final class CustomImagesUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Update. - * json + * x-ms-original-file: 2018-09-15/CustomImages_Update.json */ /** * Sample code: CustomImages_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachSamples.java index 0bf12b647dbb..b543181dea2d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,8 +11,7 @@ */ public final class DisksAttachSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Attach.json + * x-ms-original-file: 2018-09-15/Disks_Attach.json */ /** * Sample code: Disks_Attach. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateSamples.java index a1bf02c2b220..063880172a33 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,9 +11,7 @@ */ public final class DisksCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_CreateOrUpdate. - * json + * x-ms-original-file: 2018-09-15/Disks_CreateOrUpdate.json */ /** * Sample code: Disks_CreateOrUpdate. @@ -23,7 +21,6 @@ public final class DisksCreateOrUpdateSamples { public static void disksCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.disks() .define("{diskName}") - .withRegion((String) null) .withExistingUser("resourceGroupName", "{labName}", "{userId}") .withDiskType(StorageType.STANDARD) .withDiskSizeGiB(1023) diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteSamples.java index 4caf3c460ffe..0905044bf655 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class DisksDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Delete.json + * x-ms-original-file: 2018-09-15/Disks_Delete.json */ /** * Sample code: Disks_Delete. @@ -18,7 +17,6 @@ public final class DisksDeleteSamples { * @param manager Entry point to DevTestLabsManager. */ public static void disksDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { - manager.disks() - .delete("resourceGroupName", "{labName}", "{userId}", "{diskName}", com.azure.core.util.Context.NONE); + manager.disks().delete("resourceGroupName", "{labName}", "@me", "{diskName}", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachSamples.java index b48e5d62cb2b..53a76256ada0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,8 +11,7 @@ */ public final class DisksDetachSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Detach.json + * x-ms-original-file: 2018-09-15/Disks_Detach.json */ /** * Sample code: Disks_Detach. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetSamples.java index 625c4e0a8b7e..e5c8e4a3b9ab 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class DisksGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Get.json + * x-ms-original-file: 2018-09-15/Disks_Get.json */ /** * Sample code: Disks_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksListSamples.java index 01fd44b28073..0b9d75ccd3a2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class DisksListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_List.json + * x-ms-original-file: 2018-09-15/Disks_List.json */ /** * Sample code: Disks_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksUpdateSamples.java index 4ddca77818b4..e7bd1208d7dc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class DisksUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Update.json + * x-ms-original-file: 2018-09-15/Disks_Update.json */ /** * Sample code: Disks_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateSamples.java index f6f1fe29c04d..9968423270b6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,8 +12,7 @@ */ public final class EnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Environments_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/Environments_CreateOrUpdate.json */ /** * Sample code: Environments_CreateOrUpdate. @@ -23,7 +22,6 @@ public final class EnvironmentsCreateOrUpdateSamples { public static void environmentsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.environments() .define("{environmentName}") - .withRegion((String) null) .withExistingUser("resourceGroupName", "{labName}", "@me") .withDeploymentProperties(new EnvironmentDeploymentProperties().withArmTemplateId( "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}") diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteSamples.java index d61ad3272301..146b22a96e1e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class EnvironmentsDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Delete. - * json + * x-ms-original-file: 2018-09-15/Environments_Delete.json */ /** * Sample code: Environments_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetSamples.java index af36a3d50b67..9117663d4827 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class EnvironmentsGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Get.json + * x-ms-original-file: 2018-09-15/Environments_Get.json */ /** * Sample code: Environments_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListSamples.java index 8261133972fe..6aa41614d9ec 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class EnvironmentsListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_List.json + * x-ms-original-file: 2018-09-15/Environments_List.json */ /** * Sample code: Environments_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsUpdateSamples.java index 5bb22c5006fc..d2100a9063ae 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,9 +13,7 @@ */ public final class EnvironmentsUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Update. - * json + * x-ms-original-file: 2018-09-15/Environments_Update.json */ /** * Sample code: Environments_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java index 3c2431e5bddd..d6573e638887 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -18,8 +18,7 @@ */ public final class FormulasCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Formulas_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/Formulas_CreateOrUpdate.json */ /** * Sample code: Formulas_CreateOrUpdate. @@ -29,8 +28,8 @@ public final class FormulasCreateOrUpdateSamples { public static void formulasCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.formulas() .define("{formulaName}") - .withRegion("{location}") .withExistingLab("resourceGroupName", "{labName}") + .withRegion("{location}") .withDescription("Formula using a Linux base") .withFormulaContent(new LabVirtualMachineCreationParameter().withLocation("{location}") .withNotes("Ubuntu Server 20.10") diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteSamples.java index 6f926649c4cb..4556e0b73927 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class FormulasDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Delete.json + * x-ms-original-file: 2018-09-15/Formulas_Delete.json */ /** * Sample code: Formulas_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasGetSamples.java index 63d4836f6042..08e138b2f9c2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class FormulasGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Get.json + * x-ms-original-file: 2018-09-15/Formulas_Get.json */ /** * Sample code: Formulas_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasListSamples.java index a3af86a1ea9a..d4e7f4097c13 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class FormulasListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_List.json + * x-ms-original-file: 2018-09-15/Formulas_List.json */ /** * Sample code: Formulas_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasUpdateSamples.java index 512376284e38..bc9a0a8ed281 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class FormulasUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Update.json + * x-ms-original-file: 2018-09-15/Formulas_Update.json */ /** * Sample code: Formulas_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListSamples.java index 44cd7d790770..32f245f60779 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class GalleryImagesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GalleryImages_List. - * json + * x-ms-original-file: 2018-09-15/GalleryImages_List.json */ /** * Sample code: GalleryImages_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateSamples.java index a11a6c931cf9..25c322da79ed 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class GlobalSchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * GlobalSchedules_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/GlobalSchedules_CreateOrUpdate.json */ /** * Sample code: GlobalSchedules_CreateOrUpdate. @@ -24,7 +23,6 @@ public final class GlobalSchedulesCreateOrUpdateSamples { public static void globalSchedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.globalSchedules() .define("labvmautostart") - .withRegion((String) null) .withExistingResourceGroup("resourceGroupName") .withStatus(EnableStatus.ENABLED) .withTaskType("LabVmsStartupTask") diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteSamples.java index c31c7e7e175a..6c0b25492bfc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class GlobalSchedulesDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Delete - * .json + * x-ms-original-file: 2018-09-15/GlobalSchedules_Delete.json */ /** * Sample code: GlobalSchedules_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteSamples.java index 6f7a55f42276..d1696ed480ae 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class GlobalSchedulesExecuteSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * GlobalSchedules_Execute.json + * x-ms-original-file: 2018-09-15/GlobalSchedules_Execute.json */ /** * Sample code: GlobalSchedules_Execute. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupSamples.java index e6609da44310..0513bbabb5d6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class GlobalSchedulesGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Get. - * json + * x-ms-original-file: 2018-09-15/GlobalSchedules_Get.json */ /** * Sample code: GlobalSchedules_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupSamples.java index 26f3d81e6344..b191cdd59acd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class GlobalSchedulesListByResourceGroupSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * GlobalSchedules_ListByResourceGroup.json + * x-ms-original-file: 2018-09-15/GlobalSchedules_ListByResourceGroup.json */ /** * Sample code: GlobalSchedules_ListByResourceGroup. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListSamples.java index a8e78c3b869b..8e081145f67a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class GlobalSchedulesListSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * GlobalSchedules_ListBySubscription.json + * x-ms-original-file: 2018-09-15/GlobalSchedules_ListBySubscription.json */ /** * Sample code: GlobalSchedules_ListBySubscription. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetSamples.java index 3e745233a171..dadb16f9ddd5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,8 +11,7 @@ */ public final class GlobalSchedulesRetargetSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * GlobalSchedules_Retarget.json + * x-ms-original-file: 2018-09-15/GlobalSchedules_Retarget.json */ /** * Sample code: GlobalSchedules_Retarget. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesUpdateSamples.java index 5a802b88592a..c85b8d961dd5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,9 +13,7 @@ */ public final class GlobalSchedulesUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Update - * .json + * x-ms-original-file: 2018-09-15/GlobalSchedules_Update.json */ /** * Sample code: GlobalSchedules_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmSamples.java index 3befc142aed1..e6bae03299ff 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class LabsClaimAnyVmSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ClaimAnyVm.json + * x-ms-original-file: 2018-09-15/Labs_ClaimAnyVm.json */ /** * Sample code: Labs_ClaimAnyVm. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateEnvironmentSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateEnvironmentSamples.java index 9837a5bdf756..5a3f9e303ebd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateEnvironmentSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateEnvironmentSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,9 +14,7 @@ */ public final class LabsCreateEnvironmentSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateEnvironment - * .json + * x-ms-original-file: 2018-09-15/Labs_CreateEnvironment.json */ /** * Sample code: Labs_CreateEnvironment. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateSamples.java index 4498f269a54f..6c0790799d67 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,9 +13,7 @@ */ public final class LabsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateOrUpdate. - * json + * x-ms-original-file: 2018-09-15/Labs_CreateOrUpdate.json */ /** * Sample code: Labs_CreateOrUpdate. @@ -25,8 +23,8 @@ public final class LabsCreateOrUpdateSamples { public static void labsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.labs() .define("{labName}") - .withRegion("{location}") .withExistingResourceGroup("resourceGroupName") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) .withLabStorageType(StorageType.fromString("{Standard|Premium}")) .create(); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteSamples.java index 06eed19ba207..1498c5903212 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class LabsDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Delete.json + * x-ms-original-file: 2018-09-15/Labs_Delete.json */ /** * Sample code: Labs_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageSamples.java index 82282553ebe7..9b2770934e01 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,8 +12,7 @@ */ public final class LabsExportResourceUsageSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Labs_ExportResourceUsage.json + * x-ms-original-file: 2018-09-15/Labs_ExportResourceUsage.json */ /** * Sample code: Labs_ExportResourceUsage. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriSamples.java index 5a4a98c81880..a7d2ee242a9d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,9 +11,7 @@ */ public final class LabsGenerateUploadUriSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_GenerateUploadUri - * .json + * x-ms-original-file: 2018-09-15/Labs_GenerateUploadUri.json */ /** * Sample code: Labs_GenerateUploadUri. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupSamples.java index a55c6a044979..35d6c1ae2766 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class LabsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Get.json + * x-ms-original-file: 2018-09-15/Labs_Get.json */ /** * Sample code: Labs_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineSamples.java index c33e60f9784f..b17e44d638c8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,8 +11,7 @@ */ public final class LabsImportVirtualMachineSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Labs_ImportVirtualMachine.json + * x-ms-original-file: 2018-09-15/Labs_ImportVirtualMachine.json */ /** * Sample code: Labs_ImportVirtualMachine. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupSamples.java index adbbfc6b321c..ba6e9fdb3a84 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class LabsListByResourceGroupSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Labs_ListByResourceGroup.json + * x-ms-original-file: 2018-09-15/Labs_ListByResourceGroup.json */ /** * Sample code: Labs_ListByResourceGroup. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListSamples.java index 73803b9bfc29..1d718b0dfbea 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class LabsListSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Labs_ListBySubscription.json + * x-ms-original-file: 2018-09-15/Labs_ListBySubscription.json */ /** * Sample code: Labs_ListBySubscription. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsSamples.java index 7c93285060d3..3cc4d1f17715 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class LabsListVhdsSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListVhds.json + * x-ms-original-file: 2018-09-15/Labs_ListVhds.json */ /** * Sample code: Labs_ListVhds. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsUpdateSamples.java index 4e8d94239e72..15b82a66d876 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,8 +11,7 @@ */ public final class LabsUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Update.json + * x-ms-original-file: 2018-09-15/Labs_Update.json */ /** * Sample code: Labs_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateSamples.java index 05f87b4c9ada..46f0f41a8d3b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class NotificationChannelsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * NotificationChannels_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/NotificationChannels_CreateOrUpdate.json */ /** * Sample code: NotificationChannels_CreateOrUpdate. @@ -25,7 +24,6 @@ public final class NotificationChannelsCreateOrUpdateSamples { notificationChannelsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.notificationChannels() .define("{notificationChannelName}") - .withRegion((String) null) .withExistingLab("resourceGroupName", "{labName}") .withWebhookUrl("{webhookUrl}") .withEmailRecipient("{email}") diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteSamples.java index c6fa59f7d49d..0f0326a73267 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class NotificationChannelsDeleteSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * NotificationChannels_Delete.json + * x-ms-original-file: 2018-09-15/NotificationChannels_Delete.json */ /** * Sample code: NotificationChannels_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetSamples.java index f14ff03b74a7..9b4799c9c66f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class NotificationChannelsGetSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * NotificationChannels_Get.json + * x-ms-original-file: 2018-09-15/NotificationChannels_Get.json */ /** * Sample code: NotificationChannels_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListSamples.java index 9d065e53c508..e4341b2c735a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class NotificationChannelsListSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * NotificationChannels_List.json + * x-ms-original-file: 2018-09-15/NotificationChannels_List.json */ /** * Sample code: NotificationChannels_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifySamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifySamples.java index fcf6847d36da..ae324e727962 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifySamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,8 +12,7 @@ */ public final class NotificationChannelsNotifySamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * NotificationChannels_Notify.json + * x-ms-original-file: 2018-09-15/NotificationChannels_Notify.json */ /** * Sample code: NotificationChannels_Notify. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsUpdateSamples.java index 304dc68fb201..464fc8dd9421 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,8 +11,7 @@ */ public final class NotificationChannelsUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * NotificationChannels_Update.json + * x-ms-original-file: 2018-09-15/NotificationChannels_Update.json */ /** * Sample code: NotificationChannels_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/OperationsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/OperationsGetSamples.java index 17a0d9093f04..7aec08f38fa0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/OperationsGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/OperationsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class OperationsGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Operations_Get.json + * x-ms-original-file: 2018-09-15/Operations_Get.json */ /** * Sample code: Operations_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateSamples.java index 0380ae503545..2ebe14c182bc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -15,8 +15,7 @@ */ public final class PoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Policies_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/Policies_CreateOrUpdate.json */ /** * Sample code: Policies_CreateOrUpdate. @@ -26,8 +25,8 @@ public final class PoliciesCreateOrUpdateSamples { public static void policiesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.policies() .define("{policyName}") - .withRegion("{location}") .withExistingPolicyset("resourceGroupName", "{labName}", "{policySetName}") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) .withDescription("{policyDescription}") .withStatus(PolicyStatus.fromString("{policyStatus}")) diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteSamples.java index ee21716f05a6..e9f798edf09d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class PoliciesDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Delete.json + * x-ms-original-file: 2018-09-15/Policies_Delete.json */ /** * Sample code: Policies_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetSamples.java index 57f3bb2a6e7c..481a676c2eaa 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class PoliciesGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Get.json + * x-ms-original-file: 2018-09-15/Policies_Get.json */ /** * Sample code: Policies_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListSamples.java index 1f4d6f9b2592..e35a16a81909 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class PoliciesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_List.json + * x-ms-original-file: 2018-09-15/Policies_List.json */ /** * Sample code: Policies_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesUpdateSamples.java index b12bc3bc3243..a8061cd8ebc9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class PoliciesUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Update.json + * x-ms-original-file: 2018-09-15/Policies_Update.json */ /** * Sample code: Policies_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PolicySetsEvaluatePoliciesSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PolicySetsEvaluatePoliciesSamples.java index c6c81b3efde6..2112bf7730ea 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PolicySetsEvaluatePoliciesSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PolicySetsEvaluatePoliciesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class PolicySetsEvaluatePoliciesSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * PolicySets_EvaluatePolicies.json + * x-ms-original-file: 2018-09-15/PolicySets_EvaluatePolicies.json */ /** * Sample code: PolicySets_EvaluatePolicies. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListSamples.java index 9808b598c84f..31b087cbcccb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class ProviderOperationsListSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ProviderOperations_List.json + * x-ms-original-file: 2018-09-15/ProviderOperations_List.json */ /** * Sample code: ProviderOperations_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateSamples.java index 43337fafaa95..506a3b0b49fa 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -19,8 +19,7 @@ */ public final class SchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Schedules_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/Schedules_CreateOrUpdate.json */ /** * Sample code: Schedules_CreateOrUpdate. @@ -30,8 +29,8 @@ public final class SchedulesCreateOrUpdateSamples { public static void schedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.schedules() .createOrUpdateWithResponse("resourceGroupName", "{labName}", "{scheduleName}", - new ScheduleInner().withLocation("{location}") - .withTags(mapOf("tagName1", "tagValue1")) + new ScheduleInner().withTags(mapOf("tagName1", "tagValue1")) + .withLocation("{location}") .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) .withTaskType("{myLabVmTaskType}") .withWeeklyRecurrence(new WeekDetails().withWeekdays(Arrays.asList("Monday", "Wednesday", "Friday")) diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteSamples.java index 9b875a9b9334..c7bc21e8f4dc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class SchedulesDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Delete.json + * x-ms-original-file: 2018-09-15/Schedules_Delete.json */ /** * Sample code: Schedules_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteSamples.java index adf42bfb4ff9..870316b82d04 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class SchedulesExecuteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Execute.json + * x-ms-original-file: 2018-09-15/Schedules_Execute.json */ /** * Sample code: Schedules_Execute. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetSamples.java index 7d9906cd3e2c..c1a476275bb7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class SchedulesGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Get.json + * x-ms-original-file: 2018-09-15/Schedules_Get.json */ /** * Sample code: Schedules_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableSamples.java index 112e3e48072d..e94c71030764 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class SchedulesListApplicableSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * Schedules_ListApplicable.json + * x-ms-original-file: 2018-09-15/Schedules_ListApplicable.json */ /** * Sample code: Schedules_ListApplicable. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListSamples.java index 8adf722ef706..ae9cf7fdfbd9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class SchedulesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_List.json + * x-ms-original-file: 2018-09-15/Schedules_List.json */ /** * Sample code: Schedules_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateSamples.java index d59d4227b723..7f3eb61494ed 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class SchedulesUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Update.json + * x-ms-original-file: 2018-09-15/Schedules_Update.json */ /** * Sample code: Schedules_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateSamples.java index fb7b7c257abe..ba2352994c98 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class SecretsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_CreateOrUpdate - * .json + * x-ms-original-file: 2018-09-15/Secrets_CreateOrUpdate.json */ /** * Sample code: Secrets_CreateOrUpdate. @@ -21,7 +19,6 @@ public final class SecretsCreateOrUpdateSamples { public static void secretsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.secrets() .define("{secretName}") - .withRegion((String) null) .withExistingUser("resourceGroupName", "{labName}", "{userName}") .withValue("{secret}") .create(); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteSamples.java index 01fa32cbdb3e..b60d3e0afced 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class SecretsDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Delete.json + * x-ms-original-file: 2018-09-15/Secrets_Delete.json */ /** * Sample code: Secrets_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetSamples.java index 1c3c3e7743c7..759add1c37c6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class SecretsGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Get.json + * x-ms-original-file: 2018-09-15/Secrets_Get.json */ /** * Sample code: Secrets_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListSamples.java index 8a7c9cfcdaed..2b51affc41f4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class SecretsListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_List.json + * x-ms-original-file: 2018-09-15/Secrets_List.json */ /** * Sample code: Secrets_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsUpdateSamples.java index f156a3ec62fe..fd03e8218d6a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class SecretsUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Update.json + * x-ms-original-file: 2018-09-15/Secrets_Update.json */ /** * Sample code: Secrets_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateSamples.java index 629530db9528..445b8fc40fc4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -19,8 +19,7 @@ */ public final class ServiceFabricSchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabricSchedules_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/ServiceFabricSchedules_CreateOrUpdate.json */ /** * Sample code: ServiceFabricSchedules_CreateOrUpdate. @@ -32,8 +31,8 @@ public final class ServiceFabricSchedulesCreateOrUpdateSamples { manager.serviceFabricSchedules() .createOrUpdateWithResponse("resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", - new ScheduleInner().withLocation("{location}") - .withTags(mapOf("tagName1", "tagValue1")) + new ScheduleInner().withTags(mapOf("tagName1", "tagValue1")) + .withLocation("{location}") .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) .withTaskType( "{Unknown|LabVmsShutdownTask|LabVmsStartupTask|LabVmReclamationTask|ComputeVmShutdownTask}") diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteSamples.java index fab1786f24ce..919a4c1b4dbf 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class ServiceFabricSchedulesDeleteSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabricSchedules_Delete.json + * x-ms-original-file: 2018-09-15/ServiceFabricSchedules_Delete.json */ /** * Sample code: ServiceFabricSchedules_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteSamples.java index fdbb4505312b..d9fba159a9a7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class ServiceFabricSchedulesExecuteSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabricSchedules_Execute.json + * x-ms-original-file: 2018-09-15/ServiceFabricSchedules_Execute.json */ /** * Sample code: ServiceFabricSchedules_Execute. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetSamples.java index 79b460539999..a4004881868a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class ServiceFabricSchedulesGetSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabricSchedules_Get.json + * x-ms-original-file: 2018-09-15/ServiceFabricSchedules_Get.json */ /** * Sample code: ServiceFabricSchedules_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListSamples.java index 7fa110f0810d..82519b16f4d8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class ServiceFabricSchedulesListSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabricSchedules_List.json + * x-ms-original-file: 2018-09-15/ServiceFabricSchedules_List.json */ /** * Sample code: ServiceFabricSchedules_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateSamples.java index c4a689dc2e44..4ee46f6e40cf 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class ServiceFabricSchedulesUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabricSchedules_Update.json + * x-ms-original-file: 2018-09-15/ServiceFabricSchedules_Update.json */ /** * Sample code: ServiceFabricSchedules_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateSamples.java index cb8a36bb889a..5b456ed788dc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,8 +12,7 @@ */ public final class ServiceFabricsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabrics_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/ServiceFabrics_CreateOrUpdate.json */ /** * Sample code: ServiceFabrics_CreateOrUpdate. @@ -23,8 +22,8 @@ public final class ServiceFabricsCreateOrUpdateSamples { public static void serviceFabricsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.serviceFabrics() .define("{serviceFabricName}") - .withRegion("{location}") .withExistingUser("resourceGroupName", "{labName}", "{userName}") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) .withExternalServiceFabricId("{serviceFabricId}") .withEnvironmentId("{environmentId}") diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteSamples.java index 498f20877fa7..cc28ae37c5f4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class ServiceFabricsDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Delete. - * json + * x-ms-original-file: 2018-09-15/ServiceFabrics_Delete.json */ /** * Sample code: ServiceFabrics_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetSamples.java index 1be7715fdb87..f1105289ae69 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class ServiceFabricsGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Get. - * json + * x-ms-original-file: 2018-09-15/ServiceFabrics_Get.json */ /** * Sample code: ServiceFabrics_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesSamples.java index 1203d9309718..51578a08c037 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class ServiceFabricsListApplicableSchedulesSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceFabrics_ListApplicableSchedules.json + * x-ms-original-file: 2018-09-15/ServiceFabrics_ListApplicableSchedules.json */ /** * Sample code: ServiceFabrics_ListApplicableSchedules. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListSamples.java index 183a00221290..ca894fccb53b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class ServiceFabricsListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_List. - * json + * x-ms-original-file: 2018-09-15/ServiceFabrics_List.json */ /** * Sample code: ServiceFabrics_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartSamples.java index 75f0800222fe..a6223393eca2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class ServiceFabricsStartSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Start. - * json + * x-ms-original-file: 2018-09-15/ServiceFabrics_Start.json */ /** * Sample code: ServiceFabrics_Start. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopSamples.java index e12d0fc21de3..8342115fb460 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class ServiceFabricsStopSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Stop. - * json + * x-ms-original-file: 2018-09-15/ServiceFabrics_Stop.json */ /** * Sample code: ServiceFabrics_Stop. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsUpdateSamples.java index 9eac707c8368..b36990423c30 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,9 +13,7 @@ */ public final class ServiceFabricsUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Update. - * json + * x-ms-original-file: 2018-09-15/ServiceFabrics_Update.json */ /** * Sample code: ServiceFabrics_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersCreateOrUpdateSamples.java index c95fc5eeae63..01308377df19 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,8 +14,7 @@ */ public final class ServiceRunnersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * ServiceRunners_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/ServiceRunners_CreateOrUpdate.json */ /** * Sample code: ServiceRunners_CreateOrUpdate. @@ -25,8 +24,8 @@ public final class ServiceRunnersCreateOrUpdateSamples { public static void serviceRunnersCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.serviceRunners() .define("{servicerunnerName}") - .withRegion("{location}") .withExistingLab("resourceGroupName", "{devtestlabName}") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) .withIdentity(new IdentityProperties().withType(ManagedIdentityType.fromString("{identityType}")) .withPrincipalId("{identityPrincipalId}") diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteSamples.java index a08055dee366..dd7f86eedefd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class ServiceRunnersDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Delete. - * json + * x-ms-original-file: 2018-09-15/ServiceRunners_Delete.json */ /** * Sample code: ServiceRunners_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersGetSamples.java index 6995446236d0..e3381e8675da 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class ServiceRunnersGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Get. - * json + * x-ms-original-file: 2018-09-15/ServiceRunners_Get.json */ /** * Sample code: ServiceRunners_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersCreateOrUpdateSamples.java index 8b2ab3237e9e..c81b4cdf8b33 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,9 +14,7 @@ */ public final class UsersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_CreateOrUpdate. - * json + * x-ms-original-file: 2018-09-15/Users_CreateOrUpdate.json */ /** * Sample code: Users_CreateOrUpdate. @@ -26,8 +24,8 @@ public final class UsersCreateOrUpdateSamples { public static void usersCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.users() .define("{userName}") - .withRegion("{location}") .withExistingLab("resourceGroupName", "{devtestlabName}") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) .withIdentity(new UserIdentity().withPrincipalName("{principalName}") .withPrincipalId("{principalId}") diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteSamples.java index 8274bdd44928..e03f0d459a78 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class UsersDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Delete.json + * x-ms-original-file: 2018-09-15/Users_Delete.json */ /** * Sample code: Users_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersGetSamples.java index 14c46bca9362..c179a422cfc1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class UsersGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Get.json + * x-ms-original-file: 2018-09-15/Users_Get.json */ /** * Sample code: Users_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersListSamples.java index 5bcb38a91a3a..7ca8c86cbc70 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class UsersListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_List.json + * x-ms-original-file: 2018-09-15/Users_List.json */ /** * Sample code: Users_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersUpdateSamples.java index aae5bf4730de..29bf79c4b974 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class UsersUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Update.json + * x-ms-original-file: 2018-09-15/Users_Update.json */ /** * Sample code: Users_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateSamples.java index f92d1e3cb9f1..c41fdfae25f6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -19,8 +19,7 @@ */ public final class VirtualMachineSchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachineSchedules_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/VirtualMachineSchedules_CreateOrUpdate.json */ /** * Sample code: VirtualMachineSchedules_CreateOrUpdate. @@ -31,8 +30,8 @@ public final class VirtualMachineSchedulesCreateOrUpdateSamples { virtualMachineSchedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.virtualMachineSchedules() .createOrUpdateWithResponse("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", - new ScheduleInner().withLocation("{location}") - .withTags(mapOf("tagName1", "tagValue1")) + new ScheduleInner().withTags(mapOf("tagName1", "tagValue1")) + .withLocation("{location}") .withStatus(EnableStatus.ENABLED) .withTaskType("LabVmsShutdownTask") .withWeeklyRecurrence( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteSamples.java index 5582f9b9cdbb..6861ef2acba8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class VirtualMachineSchedulesDeleteSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachineSchedules_Delete.json + * x-ms-original-file: 2018-09-15/VirtualMachineSchedules_Delete.json */ /** * Sample code: VirtualMachineSchedules_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteSamples.java index e9914da1ef5f..7eb8aaba4223 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class VirtualMachineSchedulesExecuteSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachineSchedules_Execute.json + * x-ms-original-file: 2018-09-15/VirtualMachineSchedules_Execute.json */ /** * Sample code: VirtualMachineSchedules_Execute. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetSamples.java index e48b46543a31..6e04277a4a88 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class VirtualMachineSchedulesGetSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachineSchedules_Get.json + * x-ms-original-file: 2018-09-15/VirtualMachineSchedules_Get.json */ /** * Sample code: VirtualMachineSchedules_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListSamples.java index 9382340d26c1..304c4b7981e0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class VirtualMachineSchedulesListSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachineSchedules_List.json + * x-ms-original-file: 2018-09-15/VirtualMachineSchedules_List.json */ /** * Sample code: VirtualMachineSchedules_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateSamples.java index da17e727ebcf..d200a6c24076 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class VirtualMachineSchedulesUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachineSchedules_Update.json + * x-ms-original-file: 2018-09-15/VirtualMachineSchedules_Update.json */ /** * Sample code: VirtualMachineSchedules_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskSamples.java index dc7479ecd7ea..0cabe304f0b7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class VirtualMachinesAddDataDiskSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_AddDataDisk.json + * x-ms-original-file: 2018-09-15/VirtualMachines_AddDataDisk.json */ /** * Sample code: VirtualMachines_AddDataDisk. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsSamples.java index a135a64b15a6..b8fbf0722e5e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class VirtualMachinesApplyArtifactsSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_ApplyArtifacts.json + * x-ms-original-file: 2018-09-15/VirtualMachines_ApplyArtifacts.json */ /** * Sample code: VirtualMachines_ApplyArtifacts. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimSamples.java index 31378e1dc8ee..b07c2e8d5c65 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class VirtualMachinesClaimSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Claim. - * json + * x-ms-original-file: 2018-09-15/VirtualMachines_Claim.json */ /** * Sample code: VirtualMachines_Claim. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesCreateOrUpdateSamples.java index 249ad6489b2d..2962fb67449b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,8 +13,7 @@ */ public final class VirtualMachinesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/VirtualMachines_CreateOrUpdate.json */ /** * Sample code: VirtualMachines_CreateOrUpdate. @@ -24,8 +23,8 @@ public final class VirtualMachinesCreateOrUpdateSamples { public static void virtualMachinesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.virtualMachines() .define("{vmName}") - .withRegion("{location}") .withExistingLab("resourceGroupName", "{labName}") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) .withSize("Standard_A2_v2") .withUsername("{userName}") diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteSamples.java index d459c027013a..875341facc99 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class VirtualMachinesDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Delete - * .json + * x-ms-original-file: 2018-09-15/VirtualMachines_Delete.json */ /** * Sample code: VirtualMachines_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskSamples.java index f3669c380220..d3eed0524541 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,8 +11,7 @@ */ public final class VirtualMachinesDetachDataDiskSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_DetachDataDisk.json + * x-ms-original-file: 2018-09-15/VirtualMachines_DetachDataDisk.json */ /** * Sample code: VirtualMachines_DetachDataDisk. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsSamples.java index e1c9b3ee7a28..2f02572eb6d6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class VirtualMachinesGetRdpFileContentsSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_GetRdpFileContents.json + * x-ms-original-file: 2018-09-15/VirtualMachines_GetRdpFileContents.json */ /** * Sample code: VirtualMachines_GetRdpFileContents. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetSamples.java index 10f150d96528..81f35ad27248 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/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.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class VirtualMachinesGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Get. - * json + * x-ms-original-file: 2018-09-15/VirtualMachines_Get.json */ /** * Sample code: VirtualMachines_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesSamples.java index e84bd2bba551..a935b073ed64 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class VirtualMachinesListApplicableSchedulesSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_ListApplicableSchedules.json + * x-ms-original-file: 2018-09-15/VirtualMachines_ListApplicableSchedules.json */ /** * Sample code: VirtualMachines_ListApplicableSchedules. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListSamples.java index eea45d490223..0e10ccba2f50 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/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.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class VirtualMachinesListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_List. - * json + * x-ms-original-file: 2018-09-15/VirtualMachines_List.json */ /** * Sample code: VirtualMachines_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeploySamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeploySamples.java index 94706a855e2e..ce1d5b1ba895 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeploySamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeploySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class VirtualMachinesRedeploySamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_Redeploy.json + * x-ms-original-file: 2018-09-15/VirtualMachines_Redeploy.json */ /** * Sample code: VirtualMachines_Redeploy. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeSamples.java index 3cfc52ee7154..c8820a658f07 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,9 +11,7 @@ */ public final class VirtualMachinesResizeSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Resize - * .json + * x-ms-original-file: 2018-09-15/VirtualMachines_Resize.json */ /** * Sample code: VirtualMachines_Resize. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartSamples.java index 220f7e880c0d..135f2b3316d5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class VirtualMachinesRestartSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_Restart.json + * x-ms-original-file: 2018-09-15/VirtualMachines_Restart.json */ /** * Sample code: VirtualMachines_Restart. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartSamples.java index 003a034fe0de..b8a48dac14f1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class VirtualMachinesStartSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Start. - * json + * x-ms-original-file: 2018-09-15/VirtualMachines_Start.json */ /** * Sample code: VirtualMachines_Start. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopSamples.java index cfd8c5e535b7..731b4f808b81 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class VirtualMachinesStopSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Stop. - * json + * x-ms-original-file: 2018-09-15/VirtualMachines_Stop.json */ /** * Sample code: VirtualMachines_Stop. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksSamples.java index efc389b1f4fa..23642b82df43 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class VirtualMachinesTransferDisksSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_TransferDisks.json + * x-ms-original-file: 2018-09-15/VirtualMachines_TransferDisks.json */ /** * Sample code: VirtualMachines_TransferDisks. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimSamples.java index 1a802f34ae02..486d374179af 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,8 +9,7 @@ */ public final class VirtualMachinesUnClaimSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualMachines_UnClaim.json + * x-ms-original-file: 2018-09-15/VirtualMachines_UnClaim.json */ /** * Sample code: VirtualMachines_UnClaim. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUpdateSamples.java index 418b76057a6a..11dd546af072 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,9 +11,7 @@ */ public final class VirtualMachinesUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Update - * .json + * x-ms-original-file: 2018-09-15/VirtualMachines_Update.json */ /** * Sample code: VirtualMachines_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateSamples.java index 99028a2c68ff..abf9fa6a4960 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateSamples.java @@ -1,9 +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.devtestlabs.generated; +import com.azure.resourcemanager.devtestlabs.models.Subnet; +import com.azure.resourcemanager.devtestlabs.models.UsagePermissionType; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -12,8 +15,7 @@ */ public final class VirtualNetworksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ - * VirtualNetworks_CreateOrUpdate.json + * x-ms-original-file: 2018-09-15/VirtualNetworks_CreateOrUpdate.json */ /** * Sample code: VirtualNetworks_CreateOrUpdate. @@ -23,9 +25,13 @@ public final class VirtualNetworksCreateOrUpdateSamples { public static void virtualNetworksCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { manager.virtualNetworks() .define("{virtualNetworkName}") - .withRegion("{location}") .withExistingLab("resourceGroupName", "{labName}") + .withRegion("{location}") .withTags(mapOf("tagName1", "tagValue1")) + .withAllowedSubnets(Arrays.asList(new Subnet().withResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{virtualNetworkName}Subnet") + .withLabSubnetName("{virtualNetworkName}Subnet") + .withAllowPublicIp(UsagePermissionType.ALLOW))) .create(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteSamples.java index f36377267ce2..d397103ecaad 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class VirtualNetworksDeleteSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Delete - * .json + * x-ms-original-file: 2018-09-15/VirtualNetworks_Delete.json */ /** * Sample code: VirtualNetworks_Delete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetSamples.java index 5207e45560d0..5f3b001ac10d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class VirtualNetworksGetSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Get. - * json + * x-ms-original-file: 2018-09-15/VirtualNetworks_Get.json */ /** * Sample code: VirtualNetworks_Get. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListSamples.java index a03bbbd56a7a..060ee054dbf9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -9,9 +9,7 @@ */ public final class VirtualNetworksListSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_List. - * json + * x-ms-original-file: 2018-09-15/VirtualNetworks_List.json */ /** * Sample code: VirtualNetworks_List. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksUpdateSamples.java index d3624bdf3daa..c7dc704b6ada 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,9 +13,7 @@ */ public final class VirtualNetworksUpdateSamples { /* - * x-ms-original-file: - * specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Update - * .json + * x-ms-original-file: 2018-09-15/VirtualNetworks_Update.json */ /** * Sample code: VirtualNetworks_Update. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplicableScheduleFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplicableScheduleFragmentTests.java deleted file mode 100644 index 40ddc076ef87..000000000000 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplicableScheduleFragmentTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.devtestlabs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.models.ApplicableScheduleFragment; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ApplicableScheduleFragmentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicableScheduleFragment model - = BinaryData.fromString("{\"tags\":{\"rx\":\"wzohm\",\"inhmdptys\":\"bsojk\",\"jp\":\"rqsgnzx\"}}") - .toObject(ApplicableScheduleFragment.class); - Assertions.assertEquals("wzohm", model.tags().get("rx")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicableScheduleFragment model - = new ApplicableScheduleFragment().withTags(mapOf("rx", "wzohm", "inhmdptys", "bsojk", "jp", "rqsgnzx")); - model = BinaryData.fromObject(model).toObject(ApplicableScheduleFragment.class); - Assertions.assertEquals("wzohm", model.tags().get("rx")); - } - - // 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/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplicableScheduleInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplicableScheduleInnerTests.java index 7bf46712bd6a..0e6ba185882e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplicableScheduleInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplicableScheduleInnerTests.java @@ -1,142 +1,51 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner; -import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; -import com.azure.resourcemanager.devtestlabs.models.DayDetails; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; -import com.azure.resourcemanager.devtestlabs.models.HourDetails; -import com.azure.resourcemanager.devtestlabs.models.NotificationSettings; -import com.azure.resourcemanager.devtestlabs.models.WeekDetails; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ApplicableScheduleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicableScheduleInner model = BinaryData.fromString( - "{\"properties\":{\"labVmsShutdown\":{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"denxau\",\"weeklyRecurrence\":{\"weekdays\":[\"kdk\",\"fmjnnawtqa\",\"pxuckpggq\",\"wey\"],\"time\":\"dhlisngwflqqmpi\"},\"dailyRecurrence\":{\"time\":\"w\"},\"hourlyRecurrence\":{\"minute\":578532092},\"timeZoneId\":\"xiw\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":975807918,\"webhookUrl\":\"asi\",\"emailRecipient\":\"tmkzjvkviirhgfgr\",\"notificationLocale\":\"dpgra\"},\"createdDate\":\"2021-03-02T16:22:17Z\",\"targetResourceId\":\"bglbyvict\",\"provisioningState\":\"brxkjzwr\",\"uniqueIdentifier\":\"ffm\"},\"location\":\"hkwfbkgozxwop\",\"tags\":{\"clnapxbiygnugjkn\":\"dpizq\"},\"id\":\"smfcttuxuuyilfl\",\"name\":\"oiquvrehmrnjhvs\",\"type\":\"jztczytqj\"},\"labVmsStartup\":{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"unfprnjletlxs\",\"weeklyRecurrence\":{\"weekdays\":[\"do\",\"ifamowazi\"],\"time\":\"knlqwzdvpiwhxqsz\"},\"dailyRecurrence\":{\"time\":\"aajquhuxylrj\"},\"hourlyRecurrence\":{\"minute\":1469986611},\"timeZoneId\":\"jbmzyospspsh\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1546796808,\"webhookUrl\":\"mspbpssdfpp\",\"emailRecipient\":\"gt\",\"notificationLocale\":\"yujtvczkcnyx\"},\"createdDate\":\"2021-12-03T00:27:17Z\",\"targetResourceId\":\"njdxvglnkvxl\",\"provisioningState\":\"aglqivbgkcvkh\",\"uniqueIdentifier\":\"vuqd\"},\"location\":\"lvoniy\",\"tags\":{\"hjknidibg\":\"ubcpzgpxti\",\"ik\":\"jxgpnrhgovfg\",\"wjrmzvuporqzd\":\"mhha\",\"vxcnqmxqps\":\"uydzvk\"},\"id\":\"okmvkhlggd\",\"name\":\"bemzqkzszuwi\",\"type\":\"tglxx\"}},\"location\":\"ljfp\",\"tags\":{\"vpqcb\":\"crmnzhrgmqgjs\",\"s\":\"rmbodt\"},\"id\":\"qgvriibakcla\",\"name\":\"jfrnxousxauzlwv\",\"type\":\"gmwohqfzizvu\"}") + "{\"location\":\"ugneikn\",\"tags\":{\"btozipqwje\":\"xgjiuqh\",\"xxgewpk\":\"mur\",\"bcg\":\"vqylkmqpzoyhl\"},\"properties\":{\"labVmsShutdown\":{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"xoe\",\"weeklyRecurrence\":{\"weekdays\":[\"jipnwj\",\"ujqlafcbahh\",\"zpofoiyjwpfilk\"],\"time\":\"kholvd\"},\"dailyRecurrence\":{\"time\":\"iauogphuartv\"},\"hourlyRecurrence\":{\"minute\":1904382549},\"timeZoneId\":\"efchn\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":2083295369,\"webhookUrl\":\"hkxjqirwrweooxf\",\"emailRecipient\":\"fhxwrsne\",\"notificationLocale\":\"ozqvbubqmam\"},\"createdDate\":\"2020-12-21T16:05:28Z\",\"targetResourceId\":\"xhxzgazttaboidvm\",\"provisioningState\":\"hppubowsepdfgkmt\",\"uniqueIdentifier\":\"erngbtcjuahokqto\"},\"tags\":{\"wzejywhslw\":\"uxofshfphwpnulai\",\"fugsnnfhyetefy\":\"ojpllndnpdwrpqaf\",\"ctfjgtixr\":\"oc\"},\"location\":\"zuyt\",\"id\":\"mlmuowol\",\"name\":\"au\",\"type\":\"ropions\"},\"labVmsStartup\":{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"ngajinnixjawrtmj\",\"weeklyRecurrence\":{\"weekdays\":[\"ccxlzhcoxovnek\",\"enlusfn\",\"dtjxtxrdcqt\"],\"time\":\"idttgepus\"},\"dailyRecurrence\":{\"time\":\"jtcvuwkasizies\"},\"hourlyRecurrence\":{\"minute\":1027973509},\"timeZoneId\":\"tuqfecjxeygtu\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1045251485,\"webhookUrl\":\"ewmrswnjlxu\",\"emailRecipient\":\"hwpusxj\",\"notificationLocale\":\"qehgpd\"},\"createdDate\":\"2021-03-02T08:23:47Z\",\"targetResourceId\":\"qatucoigebxnc\",\"provisioningState\":\"fepbnwgfmxjgc\",\"uniqueIdentifier\":\"jbgdlfgtdysnaquf\"},\"tags\":{\"zeqyjleziun\":\"ctqhamzjrwdk\",\"eg\":\"xdfzantkw\",\"uooqjagmdit\":\"amlbnseqacjjvpil\"},\"location\":\"eiookjbsah\",\"id\":\"dt\",\"name\":\"delqacslmoto\",\"type\":\"bnfxofvc\"}},\"id\":\"gdirazf\",\"name\":\"xejw\",\"type\":\"bmdujtmvcopexc\"}") .toObject(ApplicableScheduleInner.class); - Assertions.assertEquals("ljfp", model.location()); - Assertions.assertEquals("crmnzhrgmqgjs", model.tags().get("vpqcb")); - Assertions.assertEquals("hkwfbkgozxwop", model.labVmsShutdown().location()); - Assertions.assertEquals("dpizq", model.labVmsShutdown().tags().get("clnapxbiygnugjkn")); - Assertions.assertEquals(EnableStatus.ENABLED, model.labVmsShutdown().status()); - Assertions.assertEquals("denxau", model.labVmsShutdown().taskType()); - Assertions.assertEquals("kdk", model.labVmsShutdown().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("dhlisngwflqqmpi", model.labVmsShutdown().weeklyRecurrence().time()); - Assertions.assertEquals("w", model.labVmsShutdown().dailyRecurrence().time()); - Assertions.assertEquals(578532092, model.labVmsShutdown().hourlyRecurrence().minute()); - Assertions.assertEquals("xiw", model.labVmsShutdown().timeZoneId()); + Assertions.assertEquals("ugneikn", model.location()); + Assertions.assertEquals("xgjiuqh", model.tags().get("btozipqwje")); + Assertions.assertEquals("uxofshfphwpnulai", model.labVmsShutdown().tags().get("wzejywhslw")); + Assertions.assertEquals("zuyt", model.labVmsShutdown().location()); + Assertions.assertEquals(EnableStatus.DISABLED, model.labVmsShutdown().status()); + Assertions.assertEquals("xoe", model.labVmsShutdown().taskType()); + Assertions.assertEquals("jipnwj", model.labVmsShutdown().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("kholvd", model.labVmsShutdown().weeklyRecurrence().time()); + Assertions.assertEquals("iauogphuartv", model.labVmsShutdown().dailyRecurrence().time()); + Assertions.assertEquals(1904382549, model.labVmsShutdown().hourlyRecurrence().minute()); + Assertions.assertEquals("efchn", model.labVmsShutdown().timeZoneId()); Assertions.assertEquals(EnableStatus.DISABLED, model.labVmsShutdown().notificationSettings().status()); - Assertions.assertEquals(975807918, model.labVmsShutdown().notificationSettings().timeInMinutes()); - Assertions.assertEquals("asi", model.labVmsShutdown().notificationSettings().webhookUrl()); - Assertions.assertEquals("tmkzjvkviirhgfgr", model.labVmsShutdown().notificationSettings().emailRecipient()); - Assertions.assertEquals("dpgra", model.labVmsShutdown().notificationSettings().notificationLocale()); - Assertions.assertEquals("bglbyvict", model.labVmsShutdown().targetResourceId()); - Assertions.assertEquals("lvoniy", model.labVmsStartup().location()); - Assertions.assertEquals("ubcpzgpxti", model.labVmsStartup().tags().get("hjknidibg")); - Assertions.assertEquals(EnableStatus.DISABLED, model.labVmsStartup().status()); - Assertions.assertEquals("unfprnjletlxs", model.labVmsStartup().taskType()); - Assertions.assertEquals("do", model.labVmsStartup().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("knlqwzdvpiwhxqsz", model.labVmsStartup().weeklyRecurrence().time()); - Assertions.assertEquals("aajquhuxylrj", model.labVmsStartup().dailyRecurrence().time()); - Assertions.assertEquals(1469986611, model.labVmsStartup().hourlyRecurrence().minute()); - Assertions.assertEquals("jbmzyospspsh", model.labVmsStartup().timeZoneId()); - Assertions.assertEquals(EnableStatus.DISABLED, model.labVmsStartup().notificationSettings().status()); - Assertions.assertEquals(1546796808, model.labVmsStartup().notificationSettings().timeInMinutes()); - Assertions.assertEquals("mspbpssdfpp", model.labVmsStartup().notificationSettings().webhookUrl()); - Assertions.assertEquals("gt", model.labVmsStartup().notificationSettings().emailRecipient()); - Assertions.assertEquals("yujtvczkcnyx", model.labVmsStartup().notificationSettings().notificationLocale()); - Assertions.assertEquals("njdxvglnkvxl", model.labVmsStartup().targetResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicableScheduleInner model = new ApplicableScheduleInner().withLocation("ljfp") - .withTags(mapOf("vpqcb", "crmnzhrgmqgjs", "s", "rmbodt")) - .withLabVmsShutdown(new ScheduleInner().withLocation("hkwfbkgozxwop") - .withTags(mapOf("clnapxbiygnugjkn", "dpizq")) - .withStatus(EnableStatus.ENABLED) - .withTaskType("denxau") - .withWeeklyRecurrence( - new WeekDetails().withWeekdays(Arrays.asList("kdk", "fmjnnawtqa", "pxuckpggq", "wey")) - .withTime("dhlisngwflqqmpi")) - .withDailyRecurrence(new DayDetails().withTime("w")) - .withHourlyRecurrence(new HourDetails().withMinute(578532092)) - .withTimeZoneId("xiw") - .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.DISABLED) - .withTimeInMinutes(975807918) - .withWebhookUrl("asi") - .withEmailRecipient("tmkzjvkviirhgfgr") - .withNotificationLocale("dpgra")) - .withTargetResourceId("bglbyvict")) - .withLabVmsStartup(new ScheduleInner().withLocation("lvoniy") - .withTags(mapOf("hjknidibg", "ubcpzgpxti", "ik", "jxgpnrhgovfg", "wjrmzvuporqzd", "mhha", "vxcnqmxqps", - "uydzvk")) - .withStatus(EnableStatus.DISABLED) - .withTaskType("unfprnjletlxs") - .withWeeklyRecurrence( - new WeekDetails().withWeekdays(Arrays.asList("do", "ifamowazi")).withTime("knlqwzdvpiwhxqsz")) - .withDailyRecurrence(new DayDetails().withTime("aajquhuxylrj")) - .withHourlyRecurrence(new HourDetails().withMinute(1469986611)) - .withTimeZoneId("jbmzyospspsh") - .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.DISABLED) - .withTimeInMinutes(1546796808) - .withWebhookUrl("mspbpssdfpp") - .withEmailRecipient("gt") - .withNotificationLocale("yujtvczkcnyx")) - .withTargetResourceId("njdxvglnkvxl")); - model = BinaryData.fromObject(model).toObject(ApplicableScheduleInner.class); - Assertions.assertEquals("ljfp", model.location()); - Assertions.assertEquals("crmnzhrgmqgjs", model.tags().get("vpqcb")); - Assertions.assertEquals("hkwfbkgozxwop", model.labVmsShutdown().location()); - Assertions.assertEquals("dpizq", model.labVmsShutdown().tags().get("clnapxbiygnugjkn")); - Assertions.assertEquals(EnableStatus.ENABLED, model.labVmsShutdown().status()); - Assertions.assertEquals("denxau", model.labVmsShutdown().taskType()); - Assertions.assertEquals("kdk", model.labVmsShutdown().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("dhlisngwflqqmpi", model.labVmsShutdown().weeklyRecurrence().time()); - Assertions.assertEquals("w", model.labVmsShutdown().dailyRecurrence().time()); - Assertions.assertEquals(578532092, model.labVmsShutdown().hourlyRecurrence().minute()); - Assertions.assertEquals("xiw", model.labVmsShutdown().timeZoneId()); - Assertions.assertEquals(EnableStatus.DISABLED, model.labVmsShutdown().notificationSettings().status()); - Assertions.assertEquals(975807918, model.labVmsShutdown().notificationSettings().timeInMinutes()); - Assertions.assertEquals("asi", model.labVmsShutdown().notificationSettings().webhookUrl()); - Assertions.assertEquals("tmkzjvkviirhgfgr", model.labVmsShutdown().notificationSettings().emailRecipient()); - Assertions.assertEquals("dpgra", model.labVmsShutdown().notificationSettings().notificationLocale()); - Assertions.assertEquals("bglbyvict", model.labVmsShutdown().targetResourceId()); - Assertions.assertEquals("lvoniy", model.labVmsStartup().location()); - Assertions.assertEquals("ubcpzgpxti", model.labVmsStartup().tags().get("hjknidibg")); - Assertions.assertEquals(EnableStatus.DISABLED, model.labVmsStartup().status()); - Assertions.assertEquals("unfprnjletlxs", model.labVmsStartup().taskType()); - Assertions.assertEquals("do", model.labVmsStartup().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("knlqwzdvpiwhxqsz", model.labVmsStartup().weeklyRecurrence().time()); - Assertions.assertEquals("aajquhuxylrj", model.labVmsStartup().dailyRecurrence().time()); - Assertions.assertEquals(1469986611, model.labVmsStartup().hourlyRecurrence().minute()); - Assertions.assertEquals("jbmzyospspsh", model.labVmsStartup().timeZoneId()); - Assertions.assertEquals(EnableStatus.DISABLED, model.labVmsStartup().notificationSettings().status()); - Assertions.assertEquals(1546796808, model.labVmsStartup().notificationSettings().timeInMinutes()); - Assertions.assertEquals("mspbpssdfpp", model.labVmsStartup().notificationSettings().webhookUrl()); - Assertions.assertEquals("gt", model.labVmsStartup().notificationSettings().emailRecipient()); - Assertions.assertEquals("yujtvczkcnyx", model.labVmsStartup().notificationSettings().notificationLocale()); - Assertions.assertEquals("njdxvglnkvxl", model.labVmsStartup().targetResourceId()); - } - - // 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; + Assertions.assertEquals(2083295369, model.labVmsShutdown().notificationSettings().timeInMinutes()); + Assertions.assertEquals("hkxjqirwrweooxf", model.labVmsShutdown().notificationSettings().webhookUrl()); + Assertions.assertEquals("fhxwrsne", model.labVmsShutdown().notificationSettings().emailRecipient()); + Assertions.assertEquals("ozqvbubqmam", model.labVmsShutdown().notificationSettings().notificationLocale()); + Assertions.assertEquals("xhxzgazttaboidvm", model.labVmsShutdown().targetResourceId()); + Assertions.assertEquals("ctqhamzjrwdk", model.labVmsStartup().tags().get("zeqyjleziun")); + Assertions.assertEquals("eiookjbsah", model.labVmsStartup().location()); + Assertions.assertEquals(EnableStatus.ENABLED, model.labVmsStartup().status()); + Assertions.assertEquals("ngajinnixjawrtmj", model.labVmsStartup().taskType()); + Assertions.assertEquals("ccxlzhcoxovnek", model.labVmsStartup().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("idttgepus", model.labVmsStartup().weeklyRecurrence().time()); + Assertions.assertEquals("jtcvuwkasizies", model.labVmsStartup().dailyRecurrence().time()); + Assertions.assertEquals(1027973509, model.labVmsStartup().hourlyRecurrence().minute()); + Assertions.assertEquals("tuqfecjxeygtu", model.labVmsStartup().timeZoneId()); + Assertions.assertEquals(EnableStatus.ENABLED, model.labVmsStartup().notificationSettings().status()); + Assertions.assertEquals(1045251485, model.labVmsStartup().notificationSettings().timeInMinutes()); + Assertions.assertEquals("ewmrswnjlxu", model.labVmsStartup().notificationSettings().webhookUrl()); + Assertions.assertEquals("hwpusxj", model.labVmsStartup().notificationSettings().emailRecipient()); + Assertions.assertEquals("qehgpd", model.labVmsStartup().notificationSettings().notificationLocale()); + Assertions.assertEquals("qatucoigebxnc", model.labVmsStartup().targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplicableSchedulePropertiesInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplicableSchedulePropertiesInnerTests.java index 195d3dae1652..8b92d1aef2c9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplicableSchedulePropertiesInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplicableSchedulePropertiesInnerTests.java @@ -1,137 +1,49 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableSchedulePropertiesInner; -import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; -import com.azure.resourcemanager.devtestlabs.models.DayDetails; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; -import com.azure.resourcemanager.devtestlabs.models.HourDetails; -import com.azure.resourcemanager.devtestlabs.models.NotificationSettings; -import com.azure.resourcemanager.devtestlabs.models.WeekDetails; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ApplicableSchedulePropertiesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicableSchedulePropertiesInner model = BinaryData.fromString( - "{\"labVmsShutdown\":{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"svth\",\"weeklyRecurrence\":{\"weekdays\":[\"tekovmri\"],\"time\":\"attgplu\"},\"dailyRecurrence\":{\"time\":\"tangcfhnykzcu\"},\"hourlyRecurrence\":{\"minute\":1514018500},\"timeZoneId\":\"wlmzqwmvtxnjmxmc\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":386890050,\"webhookUrl\":\"clxyn\",\"emailRecipient\":\"k\",\"notificationLocale\":\"fabuiyjibu\"},\"createdDate\":\"2021-07-04T05:28:17Z\",\"targetResourceId\":\"ugneikn\",\"provisioningState\":\"oxgjiuqhibt\",\"uniqueIdentifier\":\"ipq\"},\"location\":\"jedmurrxxgewp\",\"tags\":{\"cgwgcloxoebqinji\":\"qylkmqpzoyhlf\",\"qlafcbahhpzpofoi\":\"nwjfu\",\"kholvd\":\"jwpfilkm\",\"uartvti\":\"dviauogp\"},\"id\":\"kyefchnmnahmnxhk\",\"name\":\"jqirwrw\",\"type\":\"ooxf\"},\"labVmsStartup\":{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"wrsnewmozqvbu\",\"weeklyRecurrence\":{\"weekdays\":[\"m\",\"sycxhxzgaz\",\"taboidvmf\",\"hppubowsepdfgkmt\"],\"time\":\"erngbtcjuahokqto\"},\"dailyRecurrence\":{\"time\":\"uxofshfphwpnulai\"},\"hourlyRecurrence\":{\"minute\":102187695},\"timeZoneId\":\"ywhslwkojpllndnp\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":211402317,\"webhookUrl\":\"gfugsnnfhyet\",\"emailRecipient\":\"ypococtfjgtixr\",\"notificationLocale\":\"zuyt\"},\"createdDate\":\"2021-03-14T11:53:49Z\",\"targetResourceId\":\"muowolbauiro\",\"provisioningState\":\"ons\",\"uniqueIdentifier\":\"nw\"},\"location\":\"ngajinnixjawrtmj\",\"tags\":{\"vnekhenlusfnrdtj\":\"yccxlzhcox\",\"ttgepuslvyjtcv\":\"txrdcqtjvi\"},\"id\":\"wkasiziesf\",\"name\":\"ughtuqfecjxeygtu\",\"type\":\"xu\"}}") + "{\"labVmsShutdown\":{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"u\",\"weeklyRecurrence\":{\"weekdays\":[\"yqltqsro\",\"tuwkffdj\",\"tsysi\"],\"time\":\"vclglxnfuij\"},\"dailyRecurrence\":{\"time\":\"usqogsfikayia\"},\"hourlyRecurrence\":{\"minute\":1168191195},\"timeZoneId\":\"ujtjiqxfz\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1427388338,\"webhookUrl\":\"kpqhjpenuygbq\",\"emailRecipient\":\"qekewvnqvcd\",\"notificationLocale\":\"uaucmf\"},\"createdDate\":\"2021-12-08T13:34:35Z\",\"targetResourceId\":\"laxpunj\",\"provisioningState\":\"kczvvita\",\"uniqueIdentifier\":\"xmfcsserxhtv\"},\"tags\":{\"sxypruuu\":\"hlwntsjgq\"},\"location\":\"nchrszizoyu\",\"id\":\"yetnd\",\"name\":\"bf\",\"type\":\"yggagflnlgmt\"},\"labVmsStartup\":{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"jmucftby\",\"weeklyRecurrence\":{\"weekdays\":[\"ohkpigqfu\",\"u\",\"kzmkwklsnoxaxmqe\"],\"time\":\"lhhjnh\"},\"dailyRecurrence\":{\"time\":\"dyynfsvkhgb\"},\"hourlyRecurrence\":{\"minute\":2020150927},\"timeZoneId\":\"arfdlpukhpyrnei\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":220520024,\"webhookUrl\":\"khnmgbrou\",\"emailRecipient\":\"dbhfhp\",\"notificationLocale\":\"azjzo\"},\"createdDate\":\"2021-09-01T00:54:58Z\",\"targetResourceId\":\"hpdulon\",\"provisioningState\":\"cnpqwteht\",\"uniqueIdentifier\":\"vrh\"},\"tags\":{\"hnsduugwbsreur\":\"yoogw\",\"fuarenlvhht\":\"q\"},\"location\":\"nvnaf\",\"id\":\"kyfede\",\"name\":\"jboslcqxypok\",\"type\":\"hminqcymczngnbdx\"}}") .toObject(ApplicableSchedulePropertiesInner.class); - Assertions.assertEquals("jedmurrxxgewp", model.labVmsShutdown().location()); - Assertions.assertEquals("qylkmqpzoyhlf", model.labVmsShutdown().tags().get("cgwgcloxoebqinji")); - Assertions.assertEquals(EnableStatus.DISABLED, model.labVmsShutdown().status()); - Assertions.assertEquals("svth", model.labVmsShutdown().taskType()); - Assertions.assertEquals("tekovmri", model.labVmsShutdown().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("attgplu", model.labVmsShutdown().weeklyRecurrence().time()); - Assertions.assertEquals("tangcfhnykzcu", model.labVmsShutdown().dailyRecurrence().time()); - Assertions.assertEquals(1514018500, model.labVmsShutdown().hourlyRecurrence().minute()); - Assertions.assertEquals("wlmzqwmvtxnjmxmc", model.labVmsShutdown().timeZoneId()); + Assertions.assertEquals("hlwntsjgq", model.labVmsShutdown().tags().get("sxypruuu")); + Assertions.assertEquals("nchrszizoyu", model.labVmsShutdown().location()); + Assertions.assertEquals(EnableStatus.ENABLED, model.labVmsShutdown().status()); + Assertions.assertEquals("u", model.labVmsShutdown().taskType()); + Assertions.assertEquals("yqltqsro", model.labVmsShutdown().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("vclglxnfuij", model.labVmsShutdown().weeklyRecurrence().time()); + Assertions.assertEquals("usqogsfikayia", model.labVmsShutdown().dailyRecurrence().time()); + Assertions.assertEquals(1168191195, model.labVmsShutdown().hourlyRecurrence().minute()); + Assertions.assertEquals("ujtjiqxfz", model.labVmsShutdown().timeZoneId()); Assertions.assertEquals(EnableStatus.ENABLED, model.labVmsShutdown().notificationSettings().status()); - Assertions.assertEquals(386890050, model.labVmsShutdown().notificationSettings().timeInMinutes()); - Assertions.assertEquals("clxyn", model.labVmsShutdown().notificationSettings().webhookUrl()); - Assertions.assertEquals("k", model.labVmsShutdown().notificationSettings().emailRecipient()); - Assertions.assertEquals("fabuiyjibu", model.labVmsShutdown().notificationSettings().notificationLocale()); - Assertions.assertEquals("ugneikn", model.labVmsShutdown().targetResourceId()); - Assertions.assertEquals("ngajinnixjawrtmj", model.labVmsStartup().location()); - Assertions.assertEquals("yccxlzhcox", model.labVmsStartup().tags().get("vnekhenlusfnrdtj")); - Assertions.assertEquals(EnableStatus.ENABLED, model.labVmsStartup().status()); - Assertions.assertEquals("wrsnewmozqvbu", model.labVmsStartup().taskType()); - Assertions.assertEquals("m", model.labVmsStartup().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("erngbtcjuahokqto", model.labVmsStartup().weeklyRecurrence().time()); - Assertions.assertEquals("uxofshfphwpnulai", model.labVmsStartup().dailyRecurrence().time()); - Assertions.assertEquals(102187695, model.labVmsStartup().hourlyRecurrence().minute()); - Assertions.assertEquals("ywhslwkojpllndnp", model.labVmsStartup().timeZoneId()); - Assertions.assertEquals(EnableStatus.DISABLED, model.labVmsStartup().notificationSettings().status()); - Assertions.assertEquals(211402317, model.labVmsStartup().notificationSettings().timeInMinutes()); - Assertions.assertEquals("gfugsnnfhyet", model.labVmsStartup().notificationSettings().webhookUrl()); - Assertions.assertEquals("ypococtfjgtixr", model.labVmsStartup().notificationSettings().emailRecipient()); - Assertions.assertEquals("zuyt", model.labVmsStartup().notificationSettings().notificationLocale()); - Assertions.assertEquals("muowolbauiro", model.labVmsStartup().targetResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicableSchedulePropertiesInner model - = new ApplicableSchedulePropertiesInner() - .withLabVmsShutdown(new ScheduleInner().withLocation("jedmurrxxgewp") - .withTags(mapOf("cgwgcloxoebqinji", "qylkmqpzoyhlf", "qlafcbahhpzpofoi", "nwjfu", "kholvd", - "jwpfilkm", "uartvti", "dviauogp")) - .withStatus(EnableStatus.DISABLED) - .withTaskType("svth") - .withWeeklyRecurrence(new WeekDetails().withWeekdays(Arrays.asList("tekovmri")).withTime("attgplu")) - .withDailyRecurrence(new DayDetails().withTime("tangcfhnykzcu")) - .withHourlyRecurrence(new HourDetails().withMinute(1514018500)) - .withTimeZoneId("wlmzqwmvtxnjmxmc") - .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.ENABLED) - .withTimeInMinutes(386890050) - .withWebhookUrl("clxyn") - .withEmailRecipient("k") - .withNotificationLocale("fabuiyjibu")) - .withTargetResourceId("ugneikn")) - .withLabVmsStartup(new ScheduleInner().withLocation("ngajinnixjawrtmj") - .withTags(mapOf("vnekhenlusfnrdtj", "yccxlzhcox", "ttgepuslvyjtcv", "txrdcqtjvi")) - .withStatus(EnableStatus.ENABLED) - .withTaskType("wrsnewmozqvbu") - .withWeeklyRecurrence(new WeekDetails() - .withWeekdays(Arrays.asList("m", "sycxhxzgaz", "taboidvmf", "hppubowsepdfgkmt")) - .withTime("erngbtcjuahokqto")) - .withDailyRecurrence(new DayDetails().withTime("uxofshfphwpnulai")) - .withHourlyRecurrence(new HourDetails().withMinute(102187695)) - .withTimeZoneId("ywhslwkojpllndnp") - .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.DISABLED) - .withTimeInMinutes(211402317) - .withWebhookUrl("gfugsnnfhyet") - .withEmailRecipient("ypococtfjgtixr") - .withNotificationLocale("zuyt")) - .withTargetResourceId("muowolbauiro")); - model = BinaryData.fromObject(model).toObject(ApplicableSchedulePropertiesInner.class); - Assertions.assertEquals("jedmurrxxgewp", model.labVmsShutdown().location()); - Assertions.assertEquals("qylkmqpzoyhlf", model.labVmsShutdown().tags().get("cgwgcloxoebqinji")); - Assertions.assertEquals(EnableStatus.DISABLED, model.labVmsShutdown().status()); - Assertions.assertEquals("svth", model.labVmsShutdown().taskType()); - Assertions.assertEquals("tekovmri", model.labVmsShutdown().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("attgplu", model.labVmsShutdown().weeklyRecurrence().time()); - Assertions.assertEquals("tangcfhnykzcu", model.labVmsShutdown().dailyRecurrence().time()); - Assertions.assertEquals(1514018500, model.labVmsShutdown().hourlyRecurrence().minute()); - Assertions.assertEquals("wlmzqwmvtxnjmxmc", model.labVmsShutdown().timeZoneId()); - Assertions.assertEquals(EnableStatus.ENABLED, model.labVmsShutdown().notificationSettings().status()); - Assertions.assertEquals(386890050, model.labVmsShutdown().notificationSettings().timeInMinutes()); - Assertions.assertEquals("clxyn", model.labVmsShutdown().notificationSettings().webhookUrl()); - Assertions.assertEquals("k", model.labVmsShutdown().notificationSettings().emailRecipient()); - Assertions.assertEquals("fabuiyjibu", model.labVmsShutdown().notificationSettings().notificationLocale()); - Assertions.assertEquals("ugneikn", model.labVmsShutdown().targetResourceId()); - Assertions.assertEquals("ngajinnixjawrtmj", model.labVmsStartup().location()); - Assertions.assertEquals("yccxlzhcox", model.labVmsStartup().tags().get("vnekhenlusfnrdtj")); - Assertions.assertEquals(EnableStatus.ENABLED, model.labVmsStartup().status()); - Assertions.assertEquals("wrsnewmozqvbu", model.labVmsStartup().taskType()); - Assertions.assertEquals("m", model.labVmsStartup().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("erngbtcjuahokqto", model.labVmsStartup().weeklyRecurrence().time()); - Assertions.assertEquals("uxofshfphwpnulai", model.labVmsStartup().dailyRecurrence().time()); - Assertions.assertEquals(102187695, model.labVmsStartup().hourlyRecurrence().minute()); - Assertions.assertEquals("ywhslwkojpllndnp", model.labVmsStartup().timeZoneId()); - Assertions.assertEquals(EnableStatus.DISABLED, model.labVmsStartup().notificationSettings().status()); - Assertions.assertEquals(211402317, model.labVmsStartup().notificationSettings().timeInMinutes()); - Assertions.assertEquals("gfugsnnfhyet", model.labVmsStartup().notificationSettings().webhookUrl()); - Assertions.assertEquals("ypococtfjgtixr", model.labVmsStartup().notificationSettings().emailRecipient()); - Assertions.assertEquals("zuyt", model.labVmsStartup().notificationSettings().notificationLocale()); - Assertions.assertEquals("muowolbauiro", model.labVmsStartup().targetResourceId()); - } - - // 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; + Assertions.assertEquals(1427388338, model.labVmsShutdown().notificationSettings().timeInMinutes()); + Assertions.assertEquals("kpqhjpenuygbq", model.labVmsShutdown().notificationSettings().webhookUrl()); + Assertions.assertEquals("qekewvnqvcd", model.labVmsShutdown().notificationSettings().emailRecipient()); + Assertions.assertEquals("uaucmf", model.labVmsShutdown().notificationSettings().notificationLocale()); + Assertions.assertEquals("laxpunj", model.labVmsShutdown().targetResourceId()); + Assertions.assertEquals("yoogw", model.labVmsStartup().tags().get("hnsduugwbsreur")); + Assertions.assertEquals("nvnaf", model.labVmsStartup().location()); + Assertions.assertEquals(EnableStatus.DISABLED, model.labVmsStartup().status()); + Assertions.assertEquals("jmucftby", model.labVmsStartup().taskType()); + Assertions.assertEquals("ohkpigqfu", model.labVmsStartup().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("lhhjnh", model.labVmsStartup().weeklyRecurrence().time()); + Assertions.assertEquals("dyynfsvkhgb", model.labVmsStartup().dailyRecurrence().time()); + Assertions.assertEquals(2020150927, model.labVmsStartup().hourlyRecurrence().minute()); + Assertions.assertEquals("arfdlpukhpyrnei", model.labVmsStartup().timeZoneId()); + Assertions.assertEquals(EnableStatus.ENABLED, model.labVmsStartup().notificationSettings().status()); + Assertions.assertEquals(220520024, model.labVmsStartup().notificationSettings().timeInMinutes()); + Assertions.assertEquals("khnmgbrou", model.labVmsStartup().notificationSettings().webhookUrl()); + Assertions.assertEquals("dbhfhp", model.labVmsStartup().notificationSettings().emailRecipient()); + Assertions.assertEquals("azjzo", model.labVmsStartup().notificationSettings().notificationLocale()); + Assertions.assertEquals("hpdulon", model.labVmsStartup().targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplyArtifactsRequestTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplyArtifactsRequestTests.java index 774a000abc24..410ca1496c8d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplyArtifactsRequestTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ApplyArtifactsRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -16,55 +16,53 @@ public final class ApplyArtifactsRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplyArtifactsRequest model = BinaryData.fromString( - "{\"artifacts\":[{\"artifactId\":\"lpu\",\"artifactTitle\":\"py\",\"parameters\":[{\"name\":\"zjcpeogk\",\"value\":\"mgbro\"},{\"name\":\"ddbhf\",\"value\":\"fpazjzoywjxhpd\"},{\"name\":\"ontacnpq\",\"value\":\"ehtuevrhr\"},{\"name\":\"yoogw\",\"value\":\"nsduugwbsre\"}],\"status\":\"fqkfuarenl\",\"deploymentStatusMessage\":\"htkln\",\"vmExtensionStatusMessage\":\"afvvk\",\"installTime\":\"2021-04-06T11:17:07Z\"},{\"artifactId\":\"ev\",\"artifactTitle\":\"oslc\",\"parameters\":[{\"name\":\"okkhminq\",\"value\":\"mczngn\"}],\"status\":\"xxewu\",\"deploymentStatusMessage\":\"nvudbchaqdtvqecr\",\"vmExtensionStatusMessage\":\"tmxxdtddmflhuy\",\"installTime\":\"2021-10-16T00:35:13Z\"},{\"artifactId\":\"tznapxbannovv\",\"artifactTitle\":\"czytprwn\",\"parameters\":[{\"name\":\"ev\",\"value\":\"lyokrrrou\"},{\"name\":\"vnsasbcrymodi\",\"value\":\"xkl\"}],\"status\":\"d\",\"deploymentStatusMessage\":\"azpmkmlmv\",\"vmExtensionStatusMessage\":\"f\",\"installTime\":\"2021-07-13T20:29:03Z\"}]}") + "{\"artifacts\":[{\"artifactId\":\"hdrlktg\",\"artifactTitle\":\"sggux\",\"parameters\":[{\"name\":\"wyw\",\"value\":\"eczgfb\"},{\"name\":\"klelssxb\",\"value\":\"c\"},{\"name\":\"zujksrlsmdes\",\"value\":\"lpvmjcdoewbidy\"}],\"status\":\"eowxvgpi\",\"deploymentStatusMessage\":\"eu\",\"vmExtensionStatusMessage\":\"sxze\",\"installTime\":\"2021-08-07T11:21:57Z\"},{\"artifactId\":\"wkufykhvuhxepm\",\"artifactTitle\":\"tznabao\",\"parameters\":[{\"name\":\"ujdjltymkmvg\",\"value\":\"hywartspph\"},{\"name\":\"xkykxdssjp\",\"value\":\"mucfxhikkf\"},{\"name\":\"mymyincqlhri\",\"value\":\"sl\"}],\"status\":\"iiovgqcgxu\",\"deploymentStatusMessage\":\"qkctotiowlxte\",\"vmExtensionStatusMessage\":\"ptjgwdt\",\"installTime\":\"2021-04-09T15:41:22Z\"}]}") .toObject(ApplyArtifactsRequest.class); - Assertions.assertEquals("lpu", model.artifacts().get(0).artifactId()); - Assertions.assertEquals("py", model.artifacts().get(0).artifactTitle()); - Assertions.assertEquals("zjcpeogk", model.artifacts().get(0).parameters().get(0).name()); - Assertions.assertEquals("mgbro", model.artifacts().get(0).parameters().get(0).value()); - Assertions.assertEquals("fqkfuarenl", model.artifacts().get(0).status()); - Assertions.assertEquals("htkln", model.artifacts().get(0).deploymentStatusMessage()); - Assertions.assertEquals("afvvk", model.artifacts().get(0).vmExtensionStatusMessage()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-06T11:17:07Z"), model.artifacts().get(0).installTime()); + Assertions.assertEquals("hdrlktg", model.artifacts().get(0).artifactId()); + Assertions.assertEquals("sggux", model.artifacts().get(0).artifactTitle()); + Assertions.assertEquals("wyw", model.artifacts().get(0).parameters().get(0).name()); + Assertions.assertEquals("eczgfb", model.artifacts().get(0).parameters().get(0).value()); + Assertions.assertEquals("eowxvgpi", model.artifacts().get(0).status()); + Assertions.assertEquals("eu", model.artifacts().get(0).deploymentStatusMessage()); + Assertions.assertEquals("sxze", model.artifacts().get(0).vmExtensionStatusMessage()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-07T11:21:57Z"), model.artifacts().get(0).installTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplyArtifactsRequest model = new ApplyArtifactsRequest().withArtifacts(Arrays.asList( - new ArtifactInstallProperties().withArtifactId("lpu") - .withArtifactTitle("py") - .withParameters(Arrays.asList(new ArtifactParameterProperties().withName("zjcpeogk").withValue("mgbro"), - new ArtifactParameterProperties().withName("ddbhf").withValue("fpazjzoywjxhpd"), - new ArtifactParameterProperties().withName("ontacnpq").withValue("ehtuevrhr"), - new ArtifactParameterProperties().withName("yoogw").withValue("nsduugwbsre"))) - .withStatus("fqkfuarenl") - .withDeploymentStatusMessage("htkln") - .withVmExtensionStatusMessage("afvvk") - .withInstallTime(OffsetDateTime.parse("2021-04-06T11:17:07Z")), - new ArtifactInstallProperties().withArtifactId("ev") - .withArtifactTitle("oslc") - .withParameters( - Arrays.asList(new ArtifactParameterProperties().withName("okkhminq").withValue("mczngn"))) - .withStatus("xxewu") - .withDeploymentStatusMessage("nvudbchaqdtvqecr") - .withVmExtensionStatusMessage("tmxxdtddmflhuy") - .withInstallTime(OffsetDateTime.parse("2021-10-16T00:35:13Z")), - new ArtifactInstallProperties().withArtifactId("tznapxbannovv") - .withArtifactTitle("czytprwn") - .withParameters(Arrays.asList(new ArtifactParameterProperties().withName("ev").withValue("lyokrrrou"), - new ArtifactParameterProperties().withName("vnsasbcrymodi").withValue("xkl"))) - .withStatus("d") - .withDeploymentStatusMessage("azpmkmlmv") - .withVmExtensionStatusMessage("f") - .withInstallTime(OffsetDateTime.parse("2021-07-13T20:29:03Z")))); + ApplyArtifactsRequest model + = new ApplyArtifactsRequest() + .withArtifacts( + Arrays.asList( + new ArtifactInstallProperties().withArtifactId("hdrlktg") + .withArtifactTitle("sggux") + .withParameters( + Arrays.asList(new ArtifactParameterProperties().withName("wyw").withValue("eczgfb"), + new ArtifactParameterProperties().withName("klelssxb").withValue("c"), + new ArtifactParameterProperties().withName("zujksrlsmdes") + .withValue("lpvmjcdoewbidy"))) + .withStatus("eowxvgpi") + .withDeploymentStatusMessage("eu") + .withVmExtensionStatusMessage("sxze") + .withInstallTime(OffsetDateTime.parse("2021-08-07T11:21:57Z")), + new ArtifactInstallProperties().withArtifactId("wkufykhvuhxepm") + .withArtifactTitle("tznabao") + .withParameters(Arrays.asList( + new ArtifactParameterProperties().withName("ujdjltymkmvg").withValue("hywartspph"), + new ArtifactParameterProperties().withName("xkykxdssjp").withValue("mucfxhikkf"), + new ArtifactParameterProperties().withName("mymyincqlhri").withValue("sl"))) + .withStatus("iiovgqcgxu") + .withDeploymentStatusMessage("qkctotiowlxte") + .withVmExtensionStatusMessage("ptjgwdt") + .withInstallTime(OffsetDateTime.parse("2021-04-09T15:41:22Z")))); model = BinaryData.fromObject(model).toObject(ApplyArtifactsRequest.class); - Assertions.assertEquals("lpu", model.artifacts().get(0).artifactId()); - Assertions.assertEquals("py", model.artifacts().get(0).artifactTitle()); - Assertions.assertEquals("zjcpeogk", model.artifacts().get(0).parameters().get(0).name()); - Assertions.assertEquals("mgbro", model.artifacts().get(0).parameters().get(0).value()); - Assertions.assertEquals("fqkfuarenl", model.artifacts().get(0).status()); - Assertions.assertEquals("htkln", model.artifacts().get(0).deploymentStatusMessage()); - Assertions.assertEquals("afvvk", model.artifacts().get(0).vmExtensionStatusMessage()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-06T11:17:07Z"), model.artifacts().get(0).installTime()); + Assertions.assertEquals("hdrlktg", model.artifacts().get(0).artifactId()); + Assertions.assertEquals("sggux", model.artifacts().get(0).artifactTitle()); + Assertions.assertEquals("wyw", model.artifacts().get(0).parameters().get(0).name()); + Assertions.assertEquals("eczgfb", model.artifacts().get(0).parameters().get(0).value()); + Assertions.assertEquals("eowxvgpi", model.artifacts().get(0).status()); + Assertions.assertEquals("eu", model.artifacts().get(0).deploymentStatusMessage()); + Assertions.assertEquals("sxze", model.artifacts().get(0).vmExtensionStatusMessage()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-07T11:21:57Z"), model.artifacts().get(0).installTime()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateInfoInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateInfoInnerTests.java index 90518d9d94f4..14d495bc7563 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateInfoInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateInfoInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -10,13 +10,8 @@ public final class ArmTemplateInfoInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ArmTemplateInfoInner model = BinaryData.fromString("{\"template\":\"datat\",\"parameters\":\"datafikdowwqu\"}") + ArmTemplateInfoInner model = BinaryData.fromString( + "{\"template\":{\"ggicccnxqhue\":\"\\\"datapqwd\\\"\",\"zrncsdt\":\"\\\"datamkttlstvlzywem\\\"\",\"bsfgytguslfea\":\"\\\"datalusiy\\\"\"},\"parameters\":{\"kyhejhzisxgf\":\"\\\"datagq\\\"\",\"raehtwdwrft\":\"\\\"dataelolppvksrpqvuj\\\"\",\"rcdlbhshfwpr\":\"\\\"datawib\\\"\"}}") .toObject(ArmTemplateInfoInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArmTemplateInfoInner model = new ArmTemplateInfoInner().withTemplate("datat").withParameters("datafikdowwqu"); - model = BinaryData.fromObject(model).toObject(ArmTemplateInfoInner.class); - } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateInnerTests.java index 5f8d82393fef..82e461a9df1e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateInnerTests.java @@ -1,43 +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.devtestlabs.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInner; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ArmTemplateInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ArmTemplateInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"c\",\"description\":\"ynqwwncwzzhxgk\",\"publisher\":\"mgucna\",\"icon\":\"t\",\"contents\":\"dataellwptfdy\",\"createdDate\":\"2020-12-31T02:22:45Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"ac\",\"parametersValueInfo\":\"datapzfqrhhuaoppp\"}],\"enabled\":false},\"location\":\"qxolzdahzx\",\"tags\":{\"grcfb\":\"bgbkdmoizpost\",\"bpvjymjhx\":\"nrmfqjhhk\",\"n\":\"j\"},\"id\":\"u\",\"name\":\"ivkrtsw\",\"type\":\"xqzvszjfa\"}") + "{\"properties\":{\"displayName\":\"ofd\",\"description\":\"uusdttouwa\",\"publisher\":\"ekqvkeln\",\"icon\":\"vbxwyjsflhh\",\"contents\":{\"joya\":\"\\\"datalnjixisxya\\\"\"},\"createdDate\":\"2021-03-22T18:13:58Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"pkii\",\"parametersValueInfo\":{\"tfolhbnx\":\"\\\"dataexznelixhnr\\\"\"}},{\"fileName\":\"alaulppggdtpnapn\",\"parametersValueInfo\":{\"pgylg\":\"\\\"dataopuhpig\\\"\",\"medjvcslynqwwncw\":\"\\\"datagit\\\"\",\"pkteo\":\"\\\"datazhxgktrmgucn\\\"\"}},{\"fileName\":\"lwptfdy\",\"parametersValueInfo\":{\"huaoppp\":\"\\\"dataqbuaceopzfqr\\\"\",\"z\":\"\\\"dataqeqxo\\\"\",\"moizpos\":\"\\\"dataahzxctobgbk\\\"\"}}],\"enabled\":false},\"tags\":{\"bpvjymjhx\":\"fbunrmfqjhhk\"},\"location\":\"yngudivk\",\"id\":\"swbxqz\",\"name\":\"szjfauvjfdxxivet\",\"type\":\"t\"}") .toObject(ArmTemplateInner.class); - Assertions.assertEquals("qxolzdahzx", model.location()); - Assertions.assertEquals("bgbkdmoizpost", model.tags().get("grcfb")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArmTemplateInner model = new ArmTemplateInner().withLocation("qxolzdahzx") - .withTags(mapOf("grcfb", "bgbkdmoizpost", "bpvjymjhx", "nrmfqjhhk", "n", "j")); - model = BinaryData.fromObject(model).toObject(ArmTemplateInner.class); - Assertions.assertEquals("qxolzdahzx", model.location()); - Assertions.assertEquals("bgbkdmoizpost", model.tags().get("grcfb")); - } - - // 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; + Assertions.assertEquals("fbunrmfqjhhk", model.tags().get("bpvjymjhx")); + Assertions.assertEquals("yngudivk", model.location()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateListTests.java index 03f5b4ec70ea..7f31c3cc66eb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateListTests.java @@ -1,53 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInner; -import com.azure.resourcemanager.devtestlabs.models.ArmTemplateList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.devtestlabs.implementation.models.ArmTemplateList; import org.junit.jupiter.api.Assertions; public final class ArmTemplateListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ArmTemplateList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"ashsfwxos\",\"description\":\"z\",\"publisher\":\"ugicjooxdjebw\",\"icon\":\"cwwfvovbvme\",\"contents\":\"datacivyhzceuo\",\"createdDate\":\"2020-12-29T21:09:26Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"ueiotwmcdyt\",\"parametersValueInfo\":\"datawit\"}],\"enabled\":false},\"location\":\"jawgqwg\",\"tags\":{\"fbkp\":\"isk\"},\"id\":\"cg\",\"name\":\"lwn\",\"type\":\"nhjdauw\"},{\"properties\":{\"displayName\":\"ylwz\",\"description\":\"dhxujznbmpo\",\"publisher\":\"wpr\",\"icon\":\"lve\",\"contents\":\"datalupj\",\"createdDate\":\"2021-04-21T08:53:38Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"bbcswsrtjri\",\"parametersValueInfo\":\"datarbpbewtghfgblcg\"},{\"fileName\":\"zvlvqhjkbegib\",\"parametersValueInfo\":\"datamxiebw\"},{\"fileName\":\"loayqcgw\",\"parametersValueInfo\":\"datazjuzgwyz\"}],\"enabled\":false},\"location\":\"xongmtsavjcbpwxq\",\"tags\":{\"rwmdyvxqtay\":\"knftguvriuh\",\"ibycno\":\"iwwroyqbexrmc\",\"nmefqsgzvahapj\":\"v\",\"zlmwlxkvugfhz\":\"zhpvgqzcjrvxd\"},\"id\":\"vawjvzunlu\",\"name\":\"hnnpr\",\"type\":\"xipeilpjzuaejx\"},{\"properties\":{\"displayName\":\"ltskzbbtd\",\"description\":\"mv\",\"publisher\":\"kgpwoz\",\"icon\":\"kfpbs\",\"contents\":\"dataofd\",\"createdDate\":\"2021-04-25T06:48:17Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"ttouwaboekqvkel\",\"parametersValueInfo\":\"datamvb\"}],\"enabled\":true},\"location\":\"jsflhhcaalnjix\",\"tags\":{\"oyaqcslyjpkiid\":\"yaw\",\"eli\":\"yexz\"},\"id\":\"hnrztfol\",\"name\":\"bnxknalaulppg\",\"type\":\"dtpnapnyiropuhp\"}],\"nextLink\":\"vpgylgqgitxmed\"}") + "{\"value\":[{\"properties\":{\"displayName\":\"weriofzpyqsem\",\"description\":\"bnetshh\",\"publisher\":\"h\",\"icon\":\"plvwiwubmwmbes\",\"contents\":{\"wtppjflcxogaoko\":\"\\\"datak\\\"\"},\"createdDate\":\"2021-04-24T14:30:43Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"kvmkqzeqq\",\"parametersValueInfo\":{\"mhhv\":\"\\\"datatfz\\\"\"}},{\"fileName\":\"ur\",\"parametersValueInfo\":{\"xbxwa\":\"\\\"datakwobdagxtibq\\\"\",\"iplbpodxunkbebxm\":\"\\\"databogqxndlkzgxhu\\\"\",\"oievseotgqrlltm\":\"\\\"databyyntwlrbqt\\\"\"}},{\"fileName\":\"lauwzizxbmpgcjef\",\"parametersValueInfo\":{\"tdum\":\"\\\"datauvpb\\\"\"}},{\"fileName\":\"p\",\"parametersValueInfo\":{\"fgohdneuelfphs\":\"\\\"databmnzbtbhjpgl\\\"\",\"v\":\"\\\"datayhtozfikdowwqu\\\"\",\"lvithhqzonosgg\":\"\\\"datazx\\\"\",\"ljuti\":\"\\\"datahcohfwdsjnk\\\"\"}}],\"enabled\":false},\"tags\":{\"ewkfvhqcrai\":\"ffgdkz\",\"uflrwd\":\"vpnpp\",\"hgw\":\"hdlxyjrxsagafcn\"},\"location\":\"pnedgf\",\"id\":\"vkcvqvpkeqd\",\"name\":\"vdrhvoo\",\"type\":\"sotbob\"},{\"properties\":{\"displayName\":\"opcjwvnhd\",\"description\":\"wmgxcxrsl\",\"publisher\":\"utwu\",\"icon\":\"grpkhjwniyqs\",\"contents\":{\"xmodf\":\"\\\"datacpdggkzzlvmbmp\\\"\"},\"createdDate\":\"2021-09-01T05:44:34Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"sbpfvmwyhr\",\"parametersValueInfo\":{\"yzvqt\":\"\\\"datayftaakcpw\\\"\",\"zksmondj\":\"\\\"datanubexk\\\"\"}}],\"enabled\":true},\"tags\":{\"v\":\"ypomgkopkwho\",\"mocmbqfqvmk\":\"ajqgxy\",\"helxprglya\":\"xozap\",\"kcbcue\":\"dd\"},\"location\":\"jxgciqibrh\",\"id\":\"xsdqrhzoymibmrqy\",\"name\":\"bahwfl\",\"type\":\"szdtmhrkwof\"},{\"properties\":{\"displayName\":\"voqacpiexpbt\",\"description\":\"wbwo\",\"publisher\":\"washr\",\"icon\":\"tkcnqxwb\",\"contents\":{\"aasipqi\":\"\\\"dataulpiuj\\\"\",\"erpqlpqwcciuqg\":\"\\\"dataobyu\\\"\",\"hykojoxafnndlpic\":\"\\\"datadbutauvfbtkuwhh\\\"\"},\"createdDate\":\"2021-09-25T08:27:56Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"cdyhbpkkpwdreqn\",\"parametersValueInfo\":{\"rsndsytgadgvra\":\"\\\"dataqfovljxywsuws\\\"\"}},{\"fileName\":\"en\",\"parametersValueInfo\":{\"wlquuijfqkace\":\"\\\"datazar\\\"\"}},{\"fileName\":\"ipfpubji\",\"parametersValueInfo\":{\"ksgplsa\":\"\\\"dataiftohqkvpu\\\"\",\"xodlqiyntorzih\":\"\\\"datanynfsynljphuo\\\"\"}},{\"fileName\":\"osjswsr\",\"parametersValueInfo\":{\"ox\":\"\\\"datayzrpzbchckqqzq\\\"\",\"rwyhqmibzyhwitsm\":\"\\\"dataysuiizynkedya\\\"\",\"pcdpumnz\":\"\\\"datapyy\\\"\",\"abikns\":\"\\\"datamwzn\\\"\"}}],\"enabled\":false},\"tags\":{\"vokotllxdyh\":\"xbldtlwwrlkdmtn\",\"oocrkvcikhnv\":\"syocogjltdtbnnha\"},\"location\":\"mqg\",\"id\":\"queziky\",\"name\":\"ggxkallatmelwuip\",\"type\":\"ccjzkzivgvv\"}],\"nextLink\":\"ayrhyrnx\"}") .toObject(ArmTemplateList.class); - Assertions.assertEquals("jawgqwg", model.value().get(0).location()); - Assertions.assertEquals("isk", model.value().get(0).tags().get("fbkp")); - Assertions.assertEquals("vpgylgqgitxmed", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArmTemplateList model = new ArmTemplateList() - .withValue(Arrays.asList(new ArmTemplateInner().withLocation("jawgqwg").withTags(mapOf("fbkp", "isk")), - new ArmTemplateInner().withLocation("xongmtsavjcbpwxq") - .withTags(mapOf("rwmdyvxqtay", "knftguvriuh", "ibycno", "iwwroyqbexrmc", "nmefqsgzvahapj", "v", - "zlmwlxkvugfhz", "zhpvgqzcjrvxd")), - new ArmTemplateInner().withLocation("jsflhhcaalnjix") - .withTags(mapOf("oyaqcslyjpkiid", "yaw", "eli", "yexz")))) - .withNextLink("vpgylgqgitxmed"); - model = BinaryData.fromObject(model).toObject(ArmTemplateList.class); - Assertions.assertEquals("jawgqwg", model.value().get(0).location()); - Assertions.assertEquals("isk", model.value().get(0).tags().get("fbkp")); - Assertions.assertEquals("vpgylgqgitxmed", 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; + Assertions.assertEquals("ffgdkz", model.value().get(0).tags().get("ewkfvhqcrai")); + Assertions.assertEquals("pnedgf", model.value().get(0).location()); + Assertions.assertEquals("ayrhyrnx", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateParameterPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateParameterPropertiesTests.java index c391bbb614da..4838059ba148 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateParameterPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplateParameterPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,18 +11,19 @@ public final class ArmTemplateParameterPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ArmTemplateParameterProperties model = BinaryData.fromString("{\"name\":\"tddunqnd\",\"value\":\"pchrqbn\"}") - .toObject(ArmTemplateParameterProperties.class); - Assertions.assertEquals("tddunqnd", model.name()); - Assertions.assertEquals("pchrqbn", model.value()); + ArmTemplateParameterProperties model + = BinaryData.fromString("{\"name\":\"kbzefezrxcczurt\",\"value\":\"ipqxbkwvzgnzv\"}") + .toObject(ArmTemplateParameterProperties.class); + Assertions.assertEquals("kbzefezrxcczurt", model.name()); + Assertions.assertEquals("ipqxbkwvzgnzv", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ArmTemplateParameterProperties model - = new ArmTemplateParameterProperties().withName("tddunqnd").withValue("pchrqbn"); + = new ArmTemplateParameterProperties().withName("kbzefezrxcczurt").withValue("ipqxbkwvzgnzv"); model = BinaryData.fromObject(model).toObject(ArmTemplateParameterProperties.class); - Assertions.assertEquals("tddunqnd", model.name()); - Assertions.assertEquals("pchrqbn", model.value()); + Assertions.assertEquals("kbzefezrxcczurt", model.name()); + Assertions.assertEquals("ipqxbkwvzgnzv", model.value()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatePropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatePropertiesTests.java index 843651fbcc3a..97f0e8048d05 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatePropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,13 +11,7 @@ public final class ArmTemplatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ArmTemplateProperties model = BinaryData.fromString( - "{\"displayName\":\"j\",\"description\":\"xxivetv\",\"publisher\":\"qaqtdoqmcbxvwvxy\",\"icon\":\"qbhsfxobl\",\"contents\":\"datak\",\"createdDate\":\"2021-11-17T19:10:27Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"wwfbkrvrnsvshq\",\"parametersValueInfo\":\"datahxcr\"},{\"fileName\":\"fovasr\",\"parametersValueInfo\":\"datav\"},{\"fileName\":\"hsqfsubcgjbirxbp\",\"parametersValueInfo\":\"datasrfbjfdtwss\"},{\"fileName\":\"ftpvjzbexil\",\"parametersValueInfo\":\"datanfqqnvwp\"}],\"enabled\":true}") + "{\"displayName\":\"aqtdoqmcbx\",\"description\":\"vxysl\",\"publisher\":\"hsfxoblytkb\",\"icon\":\"pe\",\"contents\":{\"q\":\"\\\"datafbkrvrnsvs\\\"\",\"rruvwbhsq\":\"\\\"dataohxcrsbfova\\\"\",\"gjb\":\"\\\"datasub\\\"\"},\"createdDate\":\"2021-06-17T14:12:31Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"bsrfbj\",\"parametersValueInfo\":{\"sotftpvj\":\"\\\"dataw\\\"\"}},{\"fileName\":\"exilzznfqqnvwpmq\",\"parametersValueInfo\":{\"jrybnwjewgdrjer\":\"\\\"datauoujmkcjhwqy\\\"\",\"gmifthnzd\":\"\\\"datanaenqpehindo\\\"\"}},{\"fileName\":\"sl\",\"parametersValueInfo\":{\"gynduha\":\"\\\"datayq\\\"\",\"bgycduiertgccym\":\"\\\"datahqlkthumaqo\\\"\",\"lqlfm\":\"\\\"dataaolps\\\"\"}}],\"enabled\":false}") .toObject(ArmTemplateProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArmTemplateProperties model = new ArmTemplateProperties(); - model = BinaryData.fromObject(model).toObject(ArmTemplateProperties.class); - } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetWithResponseMockTests.java index 934c07f9382d..24d212402af8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ArmTemplate; @@ -21,21 +21,20 @@ public final class ArmTemplatesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"qodkadppyibngql\",\"description\":\"ywrxw\",\"publisher\":\"dtluvvadswzsn\",\"icon\":\"emlowuowhl\",\"contents\":\"datanwyrmouv\",\"createdDate\":\"2021-09-03T13:57:41Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"zkltrfowtdvrfmv\",\"parametersValueInfo\":\"datahcvjdrqc\"},{\"fileName\":\"idhftu\",\"parametersValueInfo\":\"datahdxlw\"}],\"enabled\":false},\"location\":\"bfqz\",\"tags\":{\"fratqxmbjroumzz\":\"njyixh\",\"jtpusllywpvtiotz\":\"valqjrhuzgfxo\"},\"id\":\"pdbollg\",\"name\":\"yfqiuasig\",\"type\":\"owsocnequygdjbo\"}"; + = "{\"properties\":{\"displayName\":\"jwh\",\"description\":\"twwjwzzq\",\"publisher\":\"uzu\",\"icon\":\"y\",\"contents\":{\"tewfopazdazgbsq\":\"\\\"dataqhyqqzzdcykey\\\"\",\"c\":\"\\\"datapew\\\"\",\"qjbknl\":\"\\\"datautmdpvozg\\\"\",\"wmn\":\"\\\"dataclctzey\\\"\"},\"createdDate\":\"2021-02-18T11:50:38Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"zqauxzan\",\"parametersValueInfo\":{\"udqyemeb\":\"\\\"datavfruwkudrbcpft\\\"\",\"mjauwcgx\":\"\\\"datanaucmcirtnee\\\"\",\"zerwgudas\":\"\\\"datafnohaitran\\\"\"}},{\"fileName\":\"ubvf\",\"parametersValueInfo\":{\"y\":\"\\\"datafcocefhpr\\\"\",\"cdculr\":\"\\\"datafmpztraudsvh\\\"\"}},{\"fileName\":\"pqtmojhvrztnvgys\",\"parametersValueInfo\":{\"zlpykcfazzwjcay\":\"\\\"datadgrtwmew\\\"\",\"nsyby\":\"\\\"datarzrr\\\"\",\"kfscjfncjwv\":\"\\\"datapolwzrghsrlei\\\"\",\"qwtltngvmreupt\":\"\\\"dataag\\\"\"}},{\"fileName\":\"lzmijajwolxfsv\",\"parametersValueInfo\":{\"igt\":\"\\\"datampynwlslr\\\"\"}}],\"enabled\":true},\"tags\":{\"ssov\":\"xqlaps\",\"ievw\":\"xpavid\"},\"location\":\"cvvy\",\"id\":\"slpuxgcbdsva\",\"name\":\"pnptw\",\"type\":\"rkxgpazwugxyqvnj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); ArmTemplate response = manager.armTemplates() - .getWithResponse("smaklixqcahy", "xalybxawoijpo", "tblxpkkwjdjodqhy", "incnr", "mehllizhceu", - com.azure.core.util.Context.NONE) + .getWithResponse("rf", "s", "nlrxsmyltrwntfmt", "g", "jdxwnazkurrdre", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("bfqz", response.location()); - Assertions.assertEquals("njyixh", response.tags().get("fratqxmbjroumzz")); + Assertions.assertEquals("xqlaps", response.tags().get("ssov")); + Assertions.assertEquals("cvvy", response.location()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListMockTests.java index e3ac8c46ac77..df93afd5e5f2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ArmTemplate; @@ -22,20 +22,20 @@ public final class ArmTemplatesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"ufmpqumqyjgy\",\"description\":\"ulodsaeuzanhsfnh\",\"publisher\":\"nwph\",\"icon\":\"fngq\",\"contents\":\"datalidftujwjj\",\"createdDate\":\"2021-07-16T23:29:53Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"rkuorh\",\"parametersValueInfo\":\"datasruqnmdvha\"},{\"fileName\":\"vjytiqswbq\",\"parametersValueInfo\":\"datazwxiytx\"},{\"fileName\":\"gukvlbpkt\",\"parametersValueInfo\":\"datastyoua\"}],\"enabled\":false},\"location\":\"wreswmowegm\",\"tags\":{\"ii\":\"eyxeyguqigi\",\"xlzdesygrijwa\":\"ns\",\"fueqfrojs\":\"ufanray\"},\"id\":\"dgrhydkygywezs\",\"name\":\"iecafygzmxi\",\"type\":\"qv\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"inymmqgwokmikp\",\"description\":\"fbmjxuvji\",\"publisher\":\"dvhaxdvw\",\"icon\":\"ehpphthdklmveta\",\"contents\":{\"tooxrpog\":\"\\\"datakfqoixwgiksbb\\\"\",\"mbf\":\"\\\"dataphchgjtnhtukfaci\\\"\",\"uvwc\":\"\\\"datatumeezbxvqxb\\\"\",\"mjzwx\":\"\\\"dataasgom\\\"\"},\"createdDate\":\"2021-05-18T23:19:30Z\",\"parametersValueFilesInfo\":[{\"fileName\":\"xpwwzt\",\"parametersValueInfo\":{\"ccnaov\":\"\\\"datakkhtgfredmlscgrl\\\"\",\"yotgkwsxnsrqorc\":\"\\\"dataowazhpabacom\\\"\",\"jxcxxq\":\"\\\"dataenmvcebxeetq\\\"\"}}],\"enabled\":true},\"tags\":{\"xwjongzse\":\"kedwqurcgojmrv\",\"chskxxka\":\"qqrsil\",\"aqgvto\":\"sbvr\",\"jrthcfjzhx\":\"rulfuct\"},\"location\":\"ubqjro\",\"id\":\"vrjeqmtzzbeqrztr\",\"name\":\"alx\",\"type\":\"d\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.armTemplates() - .list("qfblhkalehpa", "awugiqjti", "gqgdminictteajoh", "ygspnbonhpczykm", "tp", 1958815578, "xqcsehch", + .list("bfe", "hldiuhzzgqlm", "aewzgiudjp", "pqht", "qhnmhk", 342924982, "zsdsuxheqdgcrux", com.azure.core.util.Context.NONE); - Assertions.assertEquals("wreswmowegm", response.iterator().next().location()); - Assertions.assertEquals("eyxeyguqigi", response.iterator().next().tags().get("ii")); + Assertions.assertEquals("kedwqurcgojmrv", response.iterator().next().tags().get("xwjongzse")); + Assertions.assertEquals("ubqjro", response.iterator().next().location()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactDeploymentStatusPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactDeploymentStatusPropertiesTests.java index d0ea727a8ce2..1181fb18e2a9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactDeploymentStatusPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactDeploymentStatusPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,21 +12,10 @@ public final class ArtifactDeploymentStatusPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ArtifactDeploymentStatusProperties model = BinaryData - .fromString("{\"deploymentStatus\":\"bf\",\"artifactsApplied\":1699550993,\"totalArtifacts\":1064887368}") + .fromString("{\"deploymentStatus\":\"kvp\",\"artifactsApplied\":894296710,\"totalArtifacts\":2020380369}") .toObject(ArtifactDeploymentStatusProperties.class); - Assertions.assertEquals("bf", model.deploymentStatus()); - Assertions.assertEquals(1699550993, model.artifactsApplied()); - Assertions.assertEquals(1064887368, model.totalArtifacts()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArtifactDeploymentStatusProperties model = new ArtifactDeploymentStatusProperties().withDeploymentStatus("bf") - .withArtifactsApplied(1699550993) - .withTotalArtifacts(1064887368); - model = BinaryData.fromObject(model).toObject(ArtifactDeploymentStatusProperties.class); - Assertions.assertEquals("bf", model.deploymentStatus()); - Assertions.assertEquals(1699550993, model.artifactsApplied()); - Assertions.assertEquals(1064887368, model.totalArtifacts()); + Assertions.assertEquals("kvp", model.deploymentStatus()); + Assertions.assertEquals(894296710, model.artifactsApplied()); + Assertions.assertEquals(2020380369, model.totalArtifacts()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactInnerTests.java index 72d9207e818f..2e73c3aaba65 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactInnerTests.java @@ -1,43 +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.devtestlabs.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactInner; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ArtifactInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ArtifactInner model = BinaryData.fromString( - "{\"properties\":{\"title\":\"wjmy\",\"description\":\"dsslswt\",\"publisher\":\"eriofzpyqs\",\"filePath\":\"wab\",\"icon\":\"tshhszhedp\",\"targetOsType\":\"wiwubm\",\"parameters\":\"databesldnkwwtppjflc\",\"createdDate\":\"2021-04-27T19:54:46Z\"},\"location\":\"aokonzmnsik\",\"tags\":{\"hvhgureod\":\"qzeqqkdltfzxm\"},\"id\":\"wobdagxtibqdx\",\"name\":\"xwak\",\"type\":\"ogqxndlkzgxhuri\"}") + "{\"properties\":{\"title\":\"ueedndrdvs\",\"description\":\"wq\",\"publisher\":\"chea\",\"filePath\":\"fmtdaaygdvwvgp\",\"icon\":\"hgwxrtfudx\",\"targetOsType\":\"xg\",\"parameters\":{\"mnpkukghimdblxg\":\"\\\"datagvr\\\"\",\"mszkkfo\":\"\\\"dataimfnjhfjx\\\"\",\"kzikfjawneaivxwc\":\"\\\"datarey\\\"\"},\"createdDate\":\"2021-06-13T02:43:50Z\"},\"tags\":{\"eae\":\"irels\"},\"location\":\"abfatkl\",\"id\":\"xbjhwuaanozjosph\",\"name\":\"oulpjrv\",\"type\":\"ag\"}") .toObject(ArtifactInner.class); - Assertions.assertEquals("aokonzmnsik", model.location()); - Assertions.assertEquals("qzeqqkdltfzxm", model.tags().get("hvhgureod")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArtifactInner model - = new ArtifactInner().withLocation("aokonzmnsik").withTags(mapOf("hvhgureod", "qzeqqkdltfzxm")); - model = BinaryData.fromObject(model).toObject(ArtifactInner.class); - Assertions.assertEquals("aokonzmnsik", model.location()); - Assertions.assertEquals("qzeqqkdltfzxm", model.tags().get("hvhgureod")); - } - - // 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; + Assertions.assertEquals("irels", model.tags().get("eae")); + Assertions.assertEquals("abfatkl", model.location()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactInstallPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactInstallPropertiesTests.java index 7966a8601721..e8b729892693 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactInstallPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactInstallPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -15,36 +15,36 @@ public final class ArtifactInstallPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ArtifactInstallProperties model = BinaryData.fromString( - "{\"artifactId\":\"gwfqatmt\",\"artifactTitle\":\"tmdvypgikdgs\",\"parameters\":[{\"name\":\"birryuzhl\",\"value\":\"joqrvqqaatj\"}],\"status\":\"rv\",\"deploymentStatusMessage\":\"upmfiibfg\",\"vmExtensionStatusMessage\":\"ioolvrwxkvtkkgll\",\"installTime\":\"2021-06-08T06:14:34Z\"}") + "{\"artifactId\":\"rabhjybigeho\",\"artifactTitle\":\"bowsk\",\"parameters\":[{\"name\":\"tzlcuiywgqywgn\",\"value\":\"vynhzgpphrcg\"}],\"status\":\"cocpecfvmmcoofsx\",\"deploymentStatusMessage\":\"evgbmqjq\",\"vmExtensionStatusMessage\":\"c\",\"installTime\":\"2021-06-22T17:35:49Z\"}") .toObject(ArtifactInstallProperties.class); - Assertions.assertEquals("gwfqatmt", model.artifactId()); - Assertions.assertEquals("tmdvypgikdgs", model.artifactTitle()); - Assertions.assertEquals("birryuzhl", model.parameters().get(0).name()); - Assertions.assertEquals("joqrvqqaatj", model.parameters().get(0).value()); - Assertions.assertEquals("rv", model.status()); - Assertions.assertEquals("upmfiibfg", model.deploymentStatusMessage()); - Assertions.assertEquals("ioolvrwxkvtkkgll", model.vmExtensionStatusMessage()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-08T06:14:34Z"), model.installTime()); + Assertions.assertEquals("rabhjybigeho", model.artifactId()); + Assertions.assertEquals("bowsk", model.artifactTitle()); + Assertions.assertEquals("tzlcuiywgqywgn", model.parameters().get(0).name()); + Assertions.assertEquals("vynhzgpphrcg", model.parameters().get(0).value()); + Assertions.assertEquals("cocpecfvmmcoofsx", model.status()); + Assertions.assertEquals("evgbmqjq", model.deploymentStatusMessage()); + Assertions.assertEquals("c", model.vmExtensionStatusMessage()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T17:35:49Z"), model.installTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ArtifactInstallProperties model = new ArtifactInstallProperties().withArtifactId("gwfqatmt") - .withArtifactTitle("tmdvypgikdgs") + ArtifactInstallProperties model = new ArtifactInstallProperties().withArtifactId("rabhjybigeho") + .withArtifactTitle("bowsk") .withParameters( - Arrays.asList(new ArtifactParameterProperties().withName("birryuzhl").withValue("joqrvqqaatj"))) - .withStatus("rv") - .withDeploymentStatusMessage("upmfiibfg") - .withVmExtensionStatusMessage("ioolvrwxkvtkkgll") - .withInstallTime(OffsetDateTime.parse("2021-06-08T06:14:34Z")); + Arrays.asList(new ArtifactParameterProperties().withName("tzlcuiywgqywgn").withValue("vynhzgpphrcg"))) + .withStatus("cocpecfvmmcoofsx") + .withDeploymentStatusMessage("evgbmqjq") + .withVmExtensionStatusMessage("c") + .withInstallTime(OffsetDateTime.parse("2021-06-22T17:35:49Z")); model = BinaryData.fromObject(model).toObject(ArtifactInstallProperties.class); - Assertions.assertEquals("gwfqatmt", model.artifactId()); - Assertions.assertEquals("tmdvypgikdgs", model.artifactTitle()); - Assertions.assertEquals("birryuzhl", model.parameters().get(0).name()); - Assertions.assertEquals("joqrvqqaatj", model.parameters().get(0).value()); - Assertions.assertEquals("rv", model.status()); - Assertions.assertEquals("upmfiibfg", model.deploymentStatusMessage()); - Assertions.assertEquals("ioolvrwxkvtkkgll", model.vmExtensionStatusMessage()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-08T06:14:34Z"), model.installTime()); + Assertions.assertEquals("rabhjybigeho", model.artifactId()); + Assertions.assertEquals("bowsk", model.artifactTitle()); + Assertions.assertEquals("tzlcuiywgqywgn", model.parameters().get(0).name()); + Assertions.assertEquals("vynhzgpphrcg", model.parameters().get(0).value()); + Assertions.assertEquals("cocpecfvmmcoofsx", model.status()); + Assertions.assertEquals("evgbmqjq", model.deploymentStatusMessage()); + Assertions.assertEquals("c", model.vmExtensionStatusMessage()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T17:35:49Z"), model.installTime()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactListTests.java index a61cd9cca71d..7e7fa7c1c631 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactListTests.java @@ -1,49 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactInner; -import com.azure.resourcemanager.devtestlabs.models.ArtifactList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.devtestlabs.implementation.models.ArtifactList; import org.junit.jupiter.api.Assertions; public final class ArtifactListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ArtifactList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"title\":\"wj\",\"description\":\"gdrjervnaenqpe\",\"publisher\":\"ndoygmifthnzdnd\",\"filePath\":\"gnayqigynduh\",\"icon\":\"hqlkthumaqo\",\"targetOsType\":\"gycdu\",\"parameters\":\"datar\",\"createdDate\":\"2021-07-05T23:49:12Z\"},\"location\":\"cym\",\"tags\":{\"ssl\":\"l\",\"d\":\"lfmmdnbbglzpswi\",\"bzmnvdfznud\":\"cwyhzdxssa\"},\"id\":\"od\",\"name\":\"xzb\",\"type\":\"cblylpstdbhhxsr\"}],\"nextLink\":\"zucerscdntnev\"}") + "{\"value\":[{\"properties\":{\"title\":\"areqna\",\"description\":\"qugjhkycube\",\"publisher\":\"gssofwq\",\"filePath\":\"qal\",\"icon\":\"mnjijpxacqqudf\",\"targetOsType\":\"yxbaaabjyvayf\",\"parameters\":{\"evfdnwnwm\":\"\\\"datarzrtuzqogsex\\\"\"},\"createdDate\":\"2021-07-23T17:12:42Z\"},\"tags\":{\"ud\":\"yceuzsoib\",\"brqubp\":\"frxtrthzvaytdwk\",\"r\":\"xhexiilivpdti\"},\"location\":\"d\",\"id\":\"axoruzfgsquy\",\"name\":\"xrxxlep\",\"type\":\"ramxjezwlwnw\"},{\"properties\":{\"title\":\"qlcvydy\",\"description\":\"tdooaoj\",\"publisher\":\"iodkooebwnujhem\",\"filePath\":\"bvdkcrodtjin\",\"icon\":\"jlfltkacjvefkdlf\",\"targetOsType\":\"kggkfpa\",\"parameters\":{\"pqblylsyxkqjnsj\":\"\\\"datawpu\\\"\",\"tiagx\":\"\\\"datar\\\"\"},\"createdDate\":\"2021-11-07T14:14:59Z\"},\"tags\":{\"psbzkfzbeyvpn\":\"e\"},\"location\":\"cvinvkjjxdxrbuuk\",\"id\":\"lewyhmlwpaz\",\"name\":\"zpof\",\"type\":\"cckwyfzqwhxxbu\"},{\"properties\":{\"title\":\"a\",\"description\":\"feqztppriol\",\"publisher\":\"rjaltolmncw\",\"filePath\":\"bqwcsdbnwdcf\",\"icon\":\"cqdpfuv\",\"targetOsType\":\"sbjjc\",\"parameters\":{\"ncormrlxqtvcof\":\"\\\"dataxbvtvudu\\\"\"},\"createdDate\":\"2021-04-19T01:16:51Z\"},\"tags\":{\"n\":\"kgjubgdknnqvsazn\"},\"location\":\"rudsg\",\"id\":\"hmk\",\"name\":\"c\",\"type\":\"rauwjuetaebu\"},{\"properties\":{\"title\":\"vdmovsmzlxwabm\",\"description\":\"efkifr\",\"publisher\":\"puqujmqlgkfbtn\",\"filePath\":\"aongbj\",\"icon\":\"tujitcjedft\",\"targetOsType\":\"ae\",\"parameters\":{\"bxarzgszufoxci\":\"\\\"datajvdcpzfoqouic\\\"\",\"haz\":\"\\\"dataopidoamciodh\\\"\",\"toego\":\"\\\"datakhnzbonlw\\\"\"},\"createdDate\":\"2021-10-02T18:29:47Z\"},\"tags\":{\"cmrvexzt\":\"hksz\",\"gsfraoyzkoow\":\"bt\",\"aldsy\":\"lmnguxaw\",\"znkbykutwpfhpagm\":\"uximerqfobw\"},\"location\":\"skdsnfdsdoakg\",\"id\":\"lmkk\",\"name\":\"evdlh\",\"type\":\"wpusdsttwvogv\"}],\"nextLink\":\"ejdcngqqmoakuf\"}") .toObject(ArtifactList.class); - Assertions.assertEquals("cym", model.value().get(0).location()); - Assertions.assertEquals("l", model.value().get(0).tags().get("ssl")); - Assertions.assertEquals("zucerscdntnev", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArtifactList model = new ArtifactList() - .withValue(Arrays.asList(new ArtifactInner().withLocation("cym") - .withTags(mapOf("ssl", "l", "d", "lfmmdnbbglzpswi", "bzmnvdfznud", "cwyhzdxssa")))) - .withNextLink("zucerscdntnev"); - model = BinaryData.fromObject(model).toObject(ArtifactList.class); - Assertions.assertEquals("cym", model.value().get(0).location()); - Assertions.assertEquals("l", model.value().get(0).tags().get("ssl")); - Assertions.assertEquals("zucerscdntnev", 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; + Assertions.assertEquals("yceuzsoib", model.value().get(0).tags().get("ud")); + Assertions.assertEquals("d", model.value().get(0).location()); + Assertions.assertEquals("ejdcngqqmoakuf", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactParameterPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactParameterPropertiesTests.java index a62276fc29d1..5041d0bb084f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactParameterPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactParameterPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,19 +11,18 @@ public final class ArtifactParameterPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ArtifactParameterProperties model - = BinaryData.fromString("{\"name\":\"gvjayvblmh\",\"value\":\"zuhbxvvyhgsopb\"}") - .toObject(ArtifactParameterProperties.class); - Assertions.assertEquals("gvjayvblmh", model.name()); - Assertions.assertEquals("zuhbxvvyhgsopb", model.value()); + ArtifactParameterProperties model = BinaryData.fromString("{\"name\":\"vkwlzuvccfwnf\",\"value\":\"acfi\"}") + .toObject(ArtifactParameterProperties.class); + Assertions.assertEquals("vkwlzuvccfwnf", model.name()); + Assertions.assertEquals("acfi", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ArtifactParameterProperties model - = new ArtifactParameterProperties().withName("gvjayvblmh").withValue("zuhbxvvyhgsopb"); + = new ArtifactParameterProperties().withName("vkwlzuvccfwnf").withValue("acfi"); model = BinaryData.fromObject(model).toObject(ArtifactParameterProperties.class); - Assertions.assertEquals("gvjayvblmh", model.name()); - Assertions.assertEquals("zuhbxvvyhgsopb", model.value()); + Assertions.assertEquals("vkwlzuvccfwnf", model.name()); + Assertions.assertEquals("acfi", model.value()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactPropertiesTests.java index de357d970f9a..b9e1dbcbe0e9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,13 +11,7 @@ public final class ArtifactPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ArtifactProperties model = BinaryData.fromString( - "{\"title\":\"bpodxunkbebxm\",\"description\":\"yyntwl\",\"publisher\":\"qtkoievs\",\"filePath\":\"tgqr\",\"icon\":\"tmuwlauwzi\",\"targetOsType\":\"bm\",\"parameters\":\"datacjefuzmu\",\"createdDate\":\"2021-06-02T10:08:07Z\"}") + "{\"title\":\"vimjwos\",\"description\":\"xitc\",\"publisher\":\"fcktqumiekke\",\"filePath\":\"ikh\",\"icon\":\"fjhdg\",\"targetOsType\":\"gebdunygaeq\",\"parameters\":{\"a\":\"\\\"dataqfatpxllrxcyjm\\\"\",\"arm\":\"\\\"datasu\\\"\",\"rw\":\"\\\"datawdmjsjqbjhhyx\\\"\",\"duhpk\":\"\\\"datayc\\\"\"},\"createdDate\":\"2021-05-16T10:11:32Z\"}") .toObject(ArtifactProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArtifactProperties model = new ArtifactProperties(); - model = BinaryData.fromObject(model).toObject(ArtifactProperties.class); - } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourceFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourceFragmentTests.java index 65369c3768f5..cfcf207ff9aa 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourceFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourceFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,18 +13,18 @@ public final class ArtifactSourceFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ArtifactSourceFragment model - = BinaryData.fromString("{\"tags\":{\"lvithhqzonosgg\":\"zx\",\"ljuti\":\"hcohfwdsjnk\"}}") - .toObject(ArtifactSourceFragment.class); - Assertions.assertEquals("zx", model.tags().get("lvithhqzonosgg")); + ArtifactSourceFragment model = BinaryData.fromString( + "{\"tags\":{\"uvriuhprwm\":\"cbpwxqpsrknft\",\"bexrmcq\":\"yvxqtayriwwroy\",\"e\":\"bycnojvkn\",\"zhpvgqzcjrvxd\":\"qsgzvahapj\"}}") + .toObject(ArtifactSourceFragment.class); + Assertions.assertEquals("cbpwxqpsrknft", model.tags().get("uvriuhprwm")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ArtifactSourceFragment model - = new ArtifactSourceFragment().withTags(mapOf("lvithhqzonosgg", "zx", "ljuti", "hcohfwdsjnk")); + ArtifactSourceFragment model = new ArtifactSourceFragment().withTags(mapOf("uvriuhprwm", "cbpwxqpsrknft", + "bexrmcq", "yvxqtayriwwroy", "e", "bycnojvkn", "zhpvgqzcjrvxd", "qsgzvahapj")); model = BinaryData.fromObject(model).toObject(ArtifactSourceFragment.class); - Assertions.assertEquals("zx", model.tags().get("lvithhqzonosgg")); + Assertions.assertEquals("cbpwxqpsrknft", model.tags().get("uvriuhprwm")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteWithResponseMockTests.java index ad07393c6952..03056ee24d69 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.artifactSources() - .deleteWithResponse("mbmslzoyov", "zdbpqv", "befgvmxn", com.azure.core.util.Context.NONE); + .deleteWithResponse("ecominxojjluxxd", "ilz", "dzzqjmu", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateWithResponseMockTests.java index d8e2a1795a5f..370a1e55972b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ArmTemplateInfo; @@ -23,23 +23,24 @@ public final class ArtifactsGenerateArmTemplateWithResponseMockTests { @Test public void testGenerateArmTemplateWithResponse() throws Exception { - String responseStr = "{\"template\":\"datatxwaljglzo\",\"parameters\":\"dataqwaafrqulhm\"}"; + String responseStr + = "{\"template\":{\"ws\":\"\\\"datavs\\\"\",\"wrasekw\":\"\\\"datagkjgya\\\"\",\"wyxqiclad\":\"\\\"datafcvoinwoqar\\\"\"},\"parameters\":{\"ob\":\"\\\"datadavuqmcbyms\\\"\",\"imioyo\":\"\\\"datalquvjezcjumvp\\\"\",\"clibbfqpsp\":\"\\\"dataglkmiqwnnr\\\"\",\"exzgpmnmabedd\":\"\\\"dataladydgnhautwu\\\"\"}}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); ArmTemplateInfo response = manager.artifacts() - .generateArmTemplateWithResponse("cpwzv", "doksqdtiwlwxlbon", "qba", "qicqchygt", - new GenerateArmTemplateRequest().withVirtualMachineName("byjanep") - .withParameters( - Arrays.asList(new ParameterInfo().withName("kxyqvgxiaodetv").withValue("kxdxuwsaifmcwn"), - new ParameterInfo().withName("bzlehgc").withValue("bcknjolgj"))) - .withLocation("xpvelszerqzevxo") - .withFileUploadOptions(FileUploadOptions.UPLOAD_FILES_AND_GENERATE_SAS_TOKENS), + .generateArmTemplateWithResponse("xin", "greohtwhlpuzjp", "eezn", "angp", + new GenerateArmTemplateRequest().withVirtualMachineName("faxy") + .withParameters(Arrays.asList(new ParameterInfo().withName("ciphmsexr").withValue("rndktx"), + new ParameterInfo().withName("onfeeqgp").withValue("ietbgnix"), + new ParameterInfo().withName("wwzkyf").withValue("wpiwxeiicrmpep"))) + .withLocation("dm") + .withFileUploadOptions(FileUploadOptions.NONE), com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetWithResponseMockTests.java index 9c3c865fa25c..c21ad56ceef7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Artifact; @@ -21,20 +21,20 @@ public final class ArtifactsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"title\":\"xtdisnjevhd\",\"description\":\"ydidwhepfwwtjf\",\"publisher\":\"esxxhmwcdbckyoi\",\"filePath\":\"kxhnegknj\",\"icon\":\"bhtmeplvuk\",\"targetOsType\":\"brlbpgs\",\"parameters\":\"dataagnchjhgemuowaky\",\"createdDate\":\"2021-08-17T10:32:52Z\"},\"location\":\"hjym\",\"tags\":{\"gdrclssolj\":\"qt\",\"dkkgjiiytssikizb\":\"mevtfycnlbvgjc\"},\"id\":\"ufqbvntnr\",\"name\":\"mqso\",\"type\":\"hcekxgnlykm\"}"; + = "{\"properties\":{\"title\":\"svuv\",\"description\":\"kqxetqmmliv\",\"publisher\":\"jxnw\",\"filePath\":\"chp\",\"icon\":\"xlehzlxpgfquwzp\",\"targetOsType\":\"ibelwcerwkw\",\"parameters\":{\"uisdzhgbdgz\":\"\\\"dataxljtxbusqtbxxn\\\"\",\"r\":\"\\\"dataagsecnadbuw\\\"\",\"zoellnkkiiwvmtum\":\"\\\"dataxfllmqiyn\\\"\"},\"createdDate\":\"2021-09-10T22:48:35Z\"},\"tags\":{\"canlduwzorxs\":\"jfuaxroqvqpilrgu\"},\"location\":\"x\",\"id\":\"klxymxkqvfqepdxc\",\"name\":\"tuubwyvpjb\",\"type\":\"wcpjqduqgi\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Artifact response = manager.artifacts() - .getWithResponse("w", "pcpahprzrvxhmtf", "ocnxz", "mj", "ngxno", com.azure.core.util.Context.NONE) + .getWithResponse("absr", "rsnrhp", "a", "iwkkvya", "xkvvcs", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("hjym", response.location()); - Assertions.assertEquals("qt", response.tags().get("gdrclssolj")); + Assertions.assertEquals("jfuaxroqvqpilrgu", response.tags().get("canlduwzorxs")); + Assertions.assertEquals("x", response.location()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListMockTests.java index 7d10496b9f8f..d7e385a409f8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Artifact; @@ -22,20 +22,20 @@ public final class ArtifactsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"title\":\"ztdsbeza\",\"description\":\"f\",\"publisher\":\"zxuizhyhnepkpe\",\"filePath\":\"arxqiubx\",\"icon\":\"kecpxdazvdh\",\"targetOsType\":\"mmkoszudb\",\"parameters\":\"datas\",\"createdDate\":\"2021-02-20T06:08:25Z\"},\"location\":\"pcaqki\",\"tags\":{\"ezyquw\":\"btfmhklbnldpvcbh\"},\"id\":\"sqxutr\",\"name\":\"brruyuuatv\",\"type\":\"mbjwcolbmxlb\"}]}"; + = "{\"value\":[{\"properties\":{\"title\":\"eb\",\"description\":\"czldbglzoutbaaqg\",\"publisher\":\"kajclyzgsn\",\"filePath\":\"bjgmnzj\",\"icon\":\"vmrxkhlobvvjbh\",\"targetOsType\":\"diqayfl\",\"parameters\":{\"elvhyibdrqrswh\":\"\\\"datauosnuud\\\"\"},\"createdDate\":\"2021-06-19T13:31:04Z\"},\"tags\":{\"owtjo\":\"y\",\"vjnn\":\"ztfwfqchvcz\"},\"location\":\"agfyvrtpqpe\",\"id\":\"z\",\"name\":\"gkrepdqhqyhw\",\"type\":\"wemvxqabckmze\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.artifacts() - .list("grmtqjk", "evadrmmwiu", "wvcmj", "kxiidisczskoswo", "iqazugamxzkr", 1386246223, "oiisbamnppcce", + .list("exkydfb", "lj", "vhuerkjddvrglieg", "tcvbiiftk", "dwgdn", 880049192, "fgmwd", com.azure.core.util.Context.NONE); - Assertions.assertEquals("pcaqki", response.iterator().next().location()); - Assertions.assertEquals("btfmhklbnldpvcbh", response.iterator().next().tags().get("ezyquw")); + Assertions.assertEquals("y", response.iterator().next().tags().get("owtjo")); + Assertions.assertEquals("agfyvrtpqpe", response.iterator().next().location()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/AttachDiskPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/AttachDiskPropertiesTests.java index 978f1a27a555..c2f0b5b95cee 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/AttachDiskPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/AttachDiskPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,14 +12,14 @@ public final class AttachDiskPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AttachDiskProperties model - = BinaryData.fromString("{\"leasedByLabVmId\":\"ha\"}").toObject(AttachDiskProperties.class); - Assertions.assertEquals("ha", model.leasedByLabVmId()); + = BinaryData.fromString("{\"leasedByLabVmId\":\"z\"}").toObject(AttachDiskProperties.class); + Assertions.assertEquals("z", model.leasedByLabVmId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AttachDiskProperties model = new AttachDiskProperties().withLeasedByLabVmId("ha"); + AttachDiskProperties model = new AttachDiskProperties().withLeasedByLabVmId("z"); model = BinaryData.fromObject(model).toObject(AttachDiskProperties.class); - Assertions.assertEquals("ha", model.leasedByLabVmId()); + Assertions.assertEquals("z", model.leasedByLabVmId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/AttachNewDataDiskOptionsTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/AttachNewDataDiskOptionsTests.java index eb03a917a62f..baf8d75bae3e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/AttachNewDataDiskOptionsTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/AttachNewDataDiskOptionsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,21 +13,21 @@ public final class AttachNewDataDiskOptionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AttachNewDataDiskOptions model = BinaryData - .fromString("{\"diskSizeGiB\":808609813,\"diskName\":\"ejjoqkagfhsxtta\",\"diskType\":\"StandardSSD\"}") + .fromString("{\"diskSizeGiB\":716851385,\"diskName\":\"rxzdmohctbqvudwx\",\"diskType\":\"Premium\"}") .toObject(AttachNewDataDiskOptions.class); - Assertions.assertEquals(808609813, model.diskSizeGiB()); - Assertions.assertEquals("ejjoqkagfhsxtta", model.diskName()); - Assertions.assertEquals(StorageType.STANDARD_SSD, model.diskType()); + Assertions.assertEquals(716851385, model.diskSizeGiB()); + Assertions.assertEquals("rxzdmohctbqvudwx", model.diskName()); + Assertions.assertEquals(StorageType.PREMIUM, model.diskType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AttachNewDataDiskOptions model = new AttachNewDataDiskOptions().withDiskSizeGiB(808609813) - .withDiskName("ejjoqkagfhsxtta") - .withDiskType(StorageType.STANDARD_SSD); + AttachNewDataDiskOptions model = new AttachNewDataDiskOptions().withDiskSizeGiB(716851385) + .withDiskName("rxzdmohctbqvudwx") + .withDiskType(StorageType.PREMIUM); model = BinaryData.fromObject(model).toObject(AttachNewDataDiskOptions.class); - Assertions.assertEquals(808609813, model.diskSizeGiB()); - Assertions.assertEquals("ejjoqkagfhsxtta", model.diskName()); - Assertions.assertEquals(StorageType.STANDARD_SSD, model.diskType()); + Assertions.assertEquals(716851385, model.diskSizeGiB()); + Assertions.assertEquals("rxzdmohctbqvudwx", model.diskName()); + Assertions.assertEquals(StorageType.PREMIUM, model.diskType()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/BulkCreationParametersTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/BulkCreationParametersTests.java index b7d3e991edd7..cef398fc71c4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/BulkCreationParametersTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/BulkCreationParametersTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,14 +12,14 @@ public final class BulkCreationParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { BulkCreationParameters model - = BinaryData.fromString("{\"instanceCount\":84302397}").toObject(BulkCreationParameters.class); - Assertions.assertEquals(84302397, model.instanceCount()); + = BinaryData.fromString("{\"instanceCount\":2050810494}").toObject(BulkCreationParameters.class); + Assertions.assertEquals(2050810494, model.instanceCount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - BulkCreationParameters model = new BulkCreationParameters().withInstanceCount(84302397); + BulkCreationParameters model = new BulkCreationParameters().withInstanceCount(2050810494); model = BinaryData.fromObject(model).toObject(BulkCreationParameters.class); - Assertions.assertEquals(84302397, model.instanceCount()); + Assertions.assertEquals(2050810494, model.instanceCount()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ComputeDataDiskTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ComputeDataDiskTests.java index 732d445d90ae..9f9719006544 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ComputeDataDiskTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ComputeDataDiskTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,24 +12,11 @@ public final class ComputeDataDiskTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ComputeDataDisk model = BinaryData.fromString( - "{\"name\":\"plrohkpigq\",\"diskUri\":\"suckzm\",\"managedDiskId\":\"klsnoxaxmqeqa\",\"diskSizeGiB\":1706604371}") + "{\"name\":\"imuvqejosovyrrl\",\"diskUri\":\"esi\",\"managedDiskId\":\"qtljqobbpihehc\",\"diskSizeGiB\":971749253}") .toObject(ComputeDataDisk.class); - Assertions.assertEquals("plrohkpigq", model.name()); - Assertions.assertEquals("suckzm", model.diskUri()); - Assertions.assertEquals("klsnoxaxmqeqa", model.managedDiskId()); - Assertions.assertEquals(1706604371, model.diskSizeGiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeDataDisk model = new ComputeDataDisk().withName("plrohkpigq") - .withDiskUri("suckzm") - .withManagedDiskId("klsnoxaxmqeqa") - .withDiskSizeGiB(1706604371); - model = BinaryData.fromObject(model).toObject(ComputeDataDisk.class); - Assertions.assertEquals("plrohkpigq", model.name()); - Assertions.assertEquals("suckzm", model.diskUri()); - Assertions.assertEquals("klsnoxaxmqeqa", model.managedDiskId()); - Assertions.assertEquals(1706604371, model.diskSizeGiB()); + Assertions.assertEquals("imuvqejosovyrrl", model.name()); + Assertions.assertEquals("esi", model.diskUri()); + Assertions.assertEquals("qtljqobbpihehc", model.managedDiskId()); + Assertions.assertEquals(971749253, model.diskSizeGiB()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CostThresholdPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CostThresholdPropertiesTests.java index 6b0a79fdbf93..b8d0ef224974 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CostThresholdPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CostThresholdPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,27 +14,27 @@ public final class CostThresholdPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CostThresholdProperties model = BinaryData.fromString( - "{\"thresholdId\":\"xw\",\"percentageThreshold\":{\"thresholdValue\":31.287428465157674},\"displayOnChart\":\"Disabled\",\"sendNotificationWhenExceeded\":\"Enabled\",\"notificationSent\":\"yfkzik\"}") + "{\"thresholdId\":\"llqwjygvjayvblmh\",\"percentageThreshold\":{\"thresholdValue\":42.913007719948595},\"displayOnChart\":\"Enabled\",\"sendNotificationWhenExceeded\":\"Enabled\",\"notificationSent\":\"hgsopbyrqufegx\"}") .toObject(CostThresholdProperties.class); - Assertions.assertEquals("xw", model.thresholdId()); - Assertions.assertEquals(31.287428465157674D, model.percentageThreshold().thresholdValue()); - Assertions.assertEquals(CostThresholdStatus.DISABLED, model.displayOnChart()); + Assertions.assertEquals("llqwjygvjayvblmh", model.thresholdId()); + Assertions.assertEquals(42.913007719948595D, model.percentageThreshold().thresholdValue()); + Assertions.assertEquals(CostThresholdStatus.ENABLED, model.displayOnChart()); Assertions.assertEquals(CostThresholdStatus.ENABLED, model.sendNotificationWhenExceeded()); - Assertions.assertEquals("yfkzik", model.notificationSent()); + Assertions.assertEquals("hgsopbyrqufegx", model.notificationSent()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CostThresholdProperties model = new CostThresholdProperties().withThresholdId("xw") - .withPercentageThreshold(new PercentageCostThresholdProperties().withThresholdValue(31.287428465157674D)) - .withDisplayOnChart(CostThresholdStatus.DISABLED) + CostThresholdProperties model = new CostThresholdProperties().withThresholdId("llqwjygvjayvblmh") + .withPercentageThreshold(new PercentageCostThresholdProperties().withThresholdValue(42.913007719948595D)) + .withDisplayOnChart(CostThresholdStatus.ENABLED) .withSendNotificationWhenExceeded(CostThresholdStatus.ENABLED) - .withNotificationSent("yfkzik"); + .withNotificationSent("hgsopbyrqufegx"); model = BinaryData.fromObject(model).toObject(CostThresholdProperties.class); - Assertions.assertEquals("xw", model.thresholdId()); - Assertions.assertEquals(31.287428465157674D, model.percentageThreshold().thresholdValue()); - Assertions.assertEquals(CostThresholdStatus.DISABLED, model.displayOnChart()); + Assertions.assertEquals("llqwjygvjayvblmh", model.thresholdId()); + Assertions.assertEquals(42.913007719948595D, model.percentageThreshold().thresholdValue()); + Assertions.assertEquals(CostThresholdStatus.ENABLED, model.displayOnChart()); Assertions.assertEquals(CostThresholdStatus.ENABLED, model.sendNotificationWhenExceeded()); - Assertions.assertEquals("yfkzik", model.notificationSent()); + Assertions.assertEquals("hgsopbyrqufegx", model.notificationSent()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImageFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImageFragmentTests.java index dfad7c64b6d0..0274851af32b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImageFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImageFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,16 +13,19 @@ public final class CustomImageFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CustomImageFragment model = BinaryData.fromString("{\"tags\":{\"b\":\"kqnyh\",\"jivfxzsjabib\":\"j\"}}") + CustomImageFragment model = BinaryData + .fromString( + "{\"tags\":{\"ejnt\":\"x\",\"dxtqmieoxo\":\"sewgioilqukr\",\"hhavgrvkffovjz\":\"ggufhyaomtb\"}}") .toObject(CustomImageFragment.class); - Assertions.assertEquals("kqnyh", model.tags().get("b")); + Assertions.assertEquals("x", model.tags().get("ejnt")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CustomImageFragment model = new CustomImageFragment().withTags(mapOf("b", "kqnyh", "jivfxzsjabib", "j")); + CustomImageFragment model = new CustomImageFragment() + .withTags(mapOf("ejnt", "x", "dxtqmieoxo", "sewgioilqukr", "hhavgrvkffovjz", "ggufhyaomtb")); model = BinaryData.fromObject(model).toObject(CustomImageFragment.class); - Assertions.assertEquals("kqnyh", model.tags().get("b")); + Assertions.assertEquals("x", model.tags().get("ejnt")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImageInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImageInnerTests.java index f16f82223446..0c189649be90 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImageInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImageInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -25,67 +25,71 @@ public final class CustomImageInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CustomImageInner model = BinaryData.fromString( - "{\"properties\":{\"vm\":{\"sourceVmId\":\"utwpfhp\",\"windowsOsInfo\":{\"windowsOsState\":\"SysprepRequested\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionRequested\"}},\"vhd\":{\"imageName\":\"nfd\",\"sysPrep\":true,\"osType\":\"Linux\"},\"description\":\"gtdlmk\",\"author\":\"evdlh\",\"creationDate\":\"2021-05-16T03:51:54Z\",\"managedImageId\":\"sdsttwvog\",\"managedSnapshotId\":\"bejdcn\",\"dataDiskStorageInfo\":[{\"lun\":\"oakufgm\",\"storageType\":\"Standard\"}],\"customImagePlan\":{\"id\":\"dgrtwaenuuzkopbm\",\"publisher\":\"rfdwoyu\",\"offer\":\"ziuiefozbhdm\"},\"isPlanAuthorized\":false,\"provisioningState\":\"zqhof\",\"uniqueIdentifier\":\"maequiahxicslfa\"},\"location\":\"qzpiyyl\",\"tags\":{\"ph\":\"nswhcc\",\"gwol\":\"aivwitqscywu\"},\"id\":\"h\",\"name\":\"zbwemh\",\"type\":\"i\"}") + "{\"properties\":{\"vm\":{\"sourceVmId\":\"ronzmyhgfip\",\"windowsOsInfo\":{\"windowsOsState\":\"SysprepApplied\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionApplied\"}},\"vhd\":{\"imageName\":\"krrjrea\",\"sysPrep\":false,\"osType\":\"Windows\"},\"description\":\"umh\",\"author\":\"lik\",\"creationDate\":\"2021-10-26T10:22:19Z\",\"managedImageId\":\"lo\",\"managedSnapshotId\":\"qpvuzlmvfelf\",\"dataDiskStorageInfo\":[{\"lun\":\"lcrpw\",\"storageType\":\"StandardSSD\"},{\"lun\":\"noigbrnjwmwk\",\"storageType\":\"Standard\"},{\"lun\":\"azej\",\"storageType\":\"Premium\"},{\"lun\":\"agfhsxtta\",\"storageType\":\"StandardSSD\"}],\"customImagePlan\":{\"id\":\"faazpxdtnkdmkqjj\",\"publisher\":\"uenvrkp\",\"offer\":\"uaibrebqaaysj\"},\"isPlanAuthorized\":false,\"provisioningState\":\"tnqttezlwfffiak\",\"uniqueIdentifier\":\"pqqmted\"},\"tags\":{\"auyqncygupkv\":\"mjihyeozphv\"},\"location\":\"mdscwxqupev\",\"id\":\"f\",\"name\":\"totxhojujb\",\"type\":\"pelmcuvhixbjxyf\"}") .toObject(CustomImageInner.class); - Assertions.assertEquals("qzpiyyl", model.location()); - Assertions.assertEquals("nswhcc", model.tags().get("ph")); - Assertions.assertEquals("utwpfhp", model.vm().sourceVmId()); - Assertions.assertEquals(WindowsOsState.SYSPREP_REQUESTED, model.vm().windowsOsInfo().windowsOsState()); - Assertions.assertEquals(LinuxOsState.DEPROVISION_REQUESTED, model.vm().linuxOsInfo().linuxOsState()); - Assertions.assertEquals("nfd", model.vhd().imageName()); - Assertions.assertEquals(true, model.vhd().sysPrep()); - Assertions.assertEquals(CustomImageOsType.LINUX, model.vhd().osType()); - Assertions.assertEquals("gtdlmk", model.description()); - Assertions.assertEquals("evdlh", model.author()); - Assertions.assertEquals("sdsttwvog", model.managedImageId()); - Assertions.assertEquals("bejdcn", model.managedSnapshotId()); - Assertions.assertEquals("oakufgm", model.dataDiskStorageInfo().get(0).lun()); - Assertions.assertEquals(StorageType.STANDARD, model.dataDiskStorageInfo().get(0).storageType()); - Assertions.assertEquals("dgrtwaenuuzkopbm", model.customImagePlan().id()); - Assertions.assertEquals("rfdwoyu", model.customImagePlan().publisher()); - Assertions.assertEquals("ziuiefozbhdm", model.customImagePlan().offer()); - Assertions.assertEquals(false, model.isPlanAuthorized()); + Assertions.assertEquals("mjihyeozphv", model.tags().get("auyqncygupkv")); + Assertions.assertEquals("mdscwxqupev", model.location()); + Assertions.assertEquals("ronzmyhgfip", model.vm().sourceVmId()); + Assertions.assertEquals(WindowsOsState.SYSPREP_APPLIED, model.vm().windowsOsInfo().windowsOsState()); + Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, model.vm().linuxOsInfo().linuxOsState()); + Assertions.assertEquals("krrjrea", model.vhd().imageName()); + Assertions.assertFalse(model.vhd().sysPrep()); + Assertions.assertEquals(CustomImageOsType.WINDOWS, model.vhd().osType()); + Assertions.assertEquals("umh", model.description()); + Assertions.assertEquals("lik", model.author()); + Assertions.assertEquals("lo", model.managedImageId()); + Assertions.assertEquals("qpvuzlmvfelf", model.managedSnapshotId()); + Assertions.assertEquals("lcrpw", model.dataDiskStorageInfo().get(0).lun()); + Assertions.assertEquals(StorageType.STANDARD_SSD, model.dataDiskStorageInfo().get(0).storageType()); + Assertions.assertEquals("faazpxdtnkdmkqjj", model.customImagePlan().id()); + Assertions.assertEquals("uenvrkp", model.customImagePlan().publisher()); + Assertions.assertEquals("uaibrebqaaysj", model.customImagePlan().offer()); + Assertions.assertFalse(model.isPlanAuthorized()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CustomImageInner model = new CustomImageInner().withLocation("qzpiyyl") - .withTags(mapOf("ph", "nswhcc", "gwol", "aivwitqscywu")) - .withVm(new CustomImagePropertiesFromVm().withSourceVmId("utwpfhp") - .withWindowsOsInfo(new WindowsOsInfo().withWindowsOsState(WindowsOsState.SYSPREP_REQUESTED)) - .withLinuxOsInfo(new LinuxOsInfo().withLinuxOsState(LinuxOsState.DEPROVISION_REQUESTED))) - .withVhd(new CustomImagePropertiesCustom().withImageName("nfd") - .withSysPrep(true) - .withOsType(CustomImageOsType.LINUX)) - .withDescription("gtdlmk") - .withAuthor("evdlh") - .withManagedImageId("sdsttwvog") - .withManagedSnapshotId("bejdcn") - .withDataDiskStorageInfo( - Arrays.asList(new DataDiskStorageTypeInfo().withLun("oakufgm").withStorageType(StorageType.STANDARD))) - .withCustomImagePlan(new CustomImagePropertiesFromPlan().withId("dgrtwaenuuzkopbm") - .withPublisher("rfdwoyu") - .withOffer("ziuiefozbhdm")) - .withIsPlanAuthorized(false); + CustomImageInner model + = new CustomImageInner().withTags(mapOf("auyqncygupkv", "mjihyeozphv")) + .withLocation("mdscwxqupev") + .withVm(new CustomImagePropertiesFromVm().withSourceVmId("ronzmyhgfip") + .withWindowsOsInfo(new WindowsOsInfo().withWindowsOsState(WindowsOsState.SYSPREP_APPLIED)) + .withLinuxOsInfo(new LinuxOsInfo().withLinuxOsState(LinuxOsState.DEPROVISION_APPLIED))) + .withVhd(new CustomImagePropertiesCustom().withImageName("krrjrea") + .withSysPrep(false) + .withOsType(CustomImageOsType.WINDOWS)) + .withDescription("umh") + .withAuthor("lik") + .withManagedImageId("lo") + .withManagedSnapshotId("qpvuzlmvfelf") + .withDataDiskStorageInfo(Arrays.asList( + new DataDiskStorageTypeInfo().withLun("lcrpw").withStorageType(StorageType.STANDARD_SSD), + new DataDiskStorageTypeInfo().withLun("noigbrnjwmwk").withStorageType(StorageType.STANDARD), + new DataDiskStorageTypeInfo().withLun("azej").withStorageType(StorageType.PREMIUM), + new DataDiskStorageTypeInfo().withLun("agfhsxtta").withStorageType(StorageType.STANDARD_SSD))) + .withCustomImagePlan(new CustomImagePropertiesFromPlan().withId("faazpxdtnkdmkqjj") + .withPublisher("uenvrkp") + .withOffer("uaibrebqaaysj")) + .withIsPlanAuthorized(false); model = BinaryData.fromObject(model).toObject(CustomImageInner.class); - Assertions.assertEquals("qzpiyyl", model.location()); - Assertions.assertEquals("nswhcc", model.tags().get("ph")); - Assertions.assertEquals("utwpfhp", model.vm().sourceVmId()); - Assertions.assertEquals(WindowsOsState.SYSPREP_REQUESTED, model.vm().windowsOsInfo().windowsOsState()); - Assertions.assertEquals(LinuxOsState.DEPROVISION_REQUESTED, model.vm().linuxOsInfo().linuxOsState()); - Assertions.assertEquals("nfd", model.vhd().imageName()); - Assertions.assertEquals(true, model.vhd().sysPrep()); - Assertions.assertEquals(CustomImageOsType.LINUX, model.vhd().osType()); - Assertions.assertEquals("gtdlmk", model.description()); - Assertions.assertEquals("evdlh", model.author()); - Assertions.assertEquals("sdsttwvog", model.managedImageId()); - Assertions.assertEquals("bejdcn", model.managedSnapshotId()); - Assertions.assertEquals("oakufgm", model.dataDiskStorageInfo().get(0).lun()); - Assertions.assertEquals(StorageType.STANDARD, model.dataDiskStorageInfo().get(0).storageType()); - Assertions.assertEquals("dgrtwaenuuzkopbm", model.customImagePlan().id()); - Assertions.assertEquals("rfdwoyu", model.customImagePlan().publisher()); - Assertions.assertEquals("ziuiefozbhdm", model.customImagePlan().offer()); - Assertions.assertEquals(false, model.isPlanAuthorized()); + Assertions.assertEquals("mjihyeozphv", model.tags().get("auyqncygupkv")); + Assertions.assertEquals("mdscwxqupev", model.location()); + Assertions.assertEquals("ronzmyhgfip", model.vm().sourceVmId()); + Assertions.assertEquals(WindowsOsState.SYSPREP_APPLIED, model.vm().windowsOsInfo().windowsOsState()); + Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, model.vm().linuxOsInfo().linuxOsState()); + Assertions.assertEquals("krrjrea", model.vhd().imageName()); + Assertions.assertFalse(model.vhd().sysPrep()); + Assertions.assertEquals(CustomImageOsType.WINDOWS, model.vhd().osType()); + Assertions.assertEquals("umh", model.description()); + Assertions.assertEquals("lik", model.author()); + Assertions.assertEquals("lo", model.managedImageId()); + Assertions.assertEquals("qpvuzlmvfelf", model.managedSnapshotId()); + Assertions.assertEquals("lcrpw", model.dataDiskStorageInfo().get(0).lun()); + Assertions.assertEquals(StorageType.STANDARD_SSD, model.dataDiskStorageInfo().get(0).storageType()); + Assertions.assertEquals("faazpxdtnkdmkqjj", model.customImagePlan().id()); + Assertions.assertEquals("uenvrkp", model.customImagePlan().publisher()); + Assertions.assertEquals("uaibrebqaaysj", model.customImagePlan().offer()); + Assertions.assertFalse(model.isPlanAuthorized()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImageListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImageListTests.java index 3c140ba2bad7..61021822adbc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImageListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImageListTests.java @@ -1,165 +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.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.CustomImageInner; -import com.azure.resourcemanager.devtestlabs.models.CustomImageList; +import com.azure.resourcemanager.devtestlabs.implementation.models.CustomImageList; import com.azure.resourcemanager.devtestlabs.models.CustomImageOsType; -import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesCustom; -import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromPlan; -import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromVm; -import com.azure.resourcemanager.devtestlabs.models.DataDiskStorageTypeInfo; -import com.azure.resourcemanager.devtestlabs.models.LinuxOsInfo; import com.azure.resourcemanager.devtestlabs.models.LinuxOsState; import com.azure.resourcemanager.devtestlabs.models.StorageType; -import com.azure.resourcemanager.devtestlabs.models.WindowsOsInfo; import com.azure.resourcemanager.devtestlabs.models.WindowsOsState; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class CustomImageListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CustomImageList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"vm\":{\"sourceVmId\":\"khly\",\"windowsOsInfo\":{\"windowsOsState\":\"SysprepRequested\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionApplied\"}},\"vhd\":{\"imageName\":\"bdunygaeqid\",\"sysPrep\":true,\"osType\":\"Linux\"},\"description\":\"pxllrx\",\"author\":\"jmoadsuv\",\"creationDate\":\"2021-09-26T15:36:35Z\",\"managedImageId\":\"wdmjsjqbjhhyx\",\"managedSnapshotId\":\"wlycoduhpkxkg\",\"dataDiskStorageInfo\":[{\"lun\":\"eqnajxqugjhkycu\",\"storageType\":\"StandardSSD\"},{\"lun\":\"gssofwq\",\"storageType\":\"Premium\"}],\"customImagePlan\":{\"id\":\"krmnjijpxacqqud\",\"publisher\":\"byxbaaabjy\",\"offer\":\"yffimrzrtuzqogs\"},\"isPlanAuthorized\":false,\"provisioningState\":\"vfdnwnwmewzsyyce\",\"uniqueIdentifier\":\"soibjudpfrx\"},\"location\":\"rthzvaytdwkqbrqu\",\"tags\":{\"r\":\"xhexiilivpdti\",\"yfxrx\":\"tdqoaxoruzfgsq\",\"ptramxj\":\"l\"},\"id\":\"zwl\",\"name\":\"nwxuqlcvydyp\",\"type\":\"tdooaoj\"},{\"properties\":{\"vm\":{\"sourceVmId\":\"odko\",\"windowsOsInfo\":{\"windowsOsState\":\"SysprepApplied\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionRequested\"}},\"vhd\":{\"imageName\":\"mmsbvdkcrodtjin\",\"sysPrep\":true,\"osType\":\"None\"},\"description\":\"lt\",\"author\":\"cjvefkdlfo\",\"creationDate\":\"2021-03-28T14:05:44Z\",\"managedImageId\":\"kfpagao\",\"managedSnapshotId\":\"ulpqblylsyxkqjn\",\"dataDiskStorageInfo\":[{\"lun\":\"vti\",\"storageType\":\"Premium\"},{\"lun\":\"dszue\",\"storageType\":\"Premium\"},{\"lun\":\"zkfzbeyv\",\"storageType\":\"Standard\"}],\"customImagePlan\":{\"id\":\"vinvkj\",\"publisher\":\"dxrbuukzcle\",\"offer\":\"hmlwpaztzpo\"},\"isPlanAuthorized\":true,\"provisioningState\":\"kwyfzqwhxxbuyqax\",\"uniqueIdentifier\":\"eqz\"},\"location\":\"ppriol\",\"tags\":{\"sobqw\":\"jaltolmnc\",\"vglsbjjca\":\"sdbnwdcfhucqdpf\",\"t\":\"vxb\"},\"id\":\"udutnco\",\"name\":\"mr\",\"type\":\"xqtvcofu\"},{\"properties\":{\"vm\":{\"sourceVmId\":\"vkg\",\"windowsOsInfo\":{\"windowsOsState\":\"NonSysprepped\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionRequested\"}},\"vhd\":{\"imageName\":\"vsaznqntorudsg\",\"sysPrep\":false,\"osType\":\"Windows\"},\"description\":\"yc\",\"author\":\"auwjuetaebu\",\"creationDate\":\"2021-09-21T03:41:44Z\",\"managedImageId\":\"movsmzlxwabmqoe\",\"managedSnapshotId\":\"ifrvtpu\",\"dataDiskStorageInfo\":[{\"lun\":\"qlgkfbtn\",\"storageType\":\"Premium\"},{\"lun\":\"n\",\"storageType\":\"StandardSSD\"}],\"customImagePlan\":{\"id\":\"tujitcjedft\",\"publisher\":\"ae\",\"offer\":\"ojvdcpzfoqo\"},\"isPlanAuthorized\":false,\"provisioningState\":\"bxarzgszufoxci\",\"uniqueIdentifier\":\"p\"},\"location\":\"doamciodhkha\",\"tags\":{\"ntoe\":\"hnzbonl\",\"hksz\":\"okdwb\",\"bt\":\"cmrvexzt\"},\"id\":\"gsfraoyzkoow\",\"name\":\"lmnguxaw\",\"type\":\"aldsy\"}],\"nextLink\":\"ximerqfobwyznk\"}") + "{\"value\":[{\"properties\":{\"vm\":{\"sourceVmId\":\"ibgjmfxumvfcl\",\"windowsOsInfo\":{\"windowsOsState\":\"SysprepRequested\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionRequested\"}},\"vhd\":{\"imageName\":\"fezzxscyhwzdg\",\"sysPrep\":false,\"osType\":\"Linux\"},\"description\":\"zbomvzzbtdcqvpni\",\"author\":\"jviylwdshfs\",\"creationDate\":\"2021-10-02T20:28:41Z\",\"managedImageId\":\"gy\",\"managedSnapshotId\":\"rymsgaojfmw\",\"dataDiskStorageInfo\":[{\"lun\":\"mrfhirctymox\",\"storageType\":\"StandardSSD\"},{\"lun\":\"ipiwy\",\"storageType\":\"Standard\"}],\"customImagePlan\":{\"id\":\"a\",\"publisher\":\"qjlihhyuspska\",\"offer\":\"vlmfwdgzxulucv\"},\"isPlanAuthorized\":true,\"provisioningState\":\"sreuzvxurisjnh\",\"uniqueIdentifier\":\"txifqj\"},\"tags\":{\"sutrgjup\":\"mrhublwpc\",\"jqgwzp\":\"uutpwoqhih\"},\"location\":\"qntcypsxjvfoimwk\",\"id\":\"ircizjxvy\",\"name\":\"fceacvlhvygd\",\"type\":\"ftumrtwnawjslbiw\"}],\"nextLink\":\"jgcyztsfmznba\"}") .toObject(CustomImageList.class); - Assertions.assertEquals("rthzvaytdwkqbrqu", model.value().get(0).location()); - Assertions.assertEquals("xhexiilivpdti", model.value().get(0).tags().get("r")); - Assertions.assertEquals("khly", model.value().get(0).vm().sourceVmId()); + Assertions.assertEquals("mrhublwpc", model.value().get(0).tags().get("sutrgjup")); + Assertions.assertEquals("qntcypsxjvfoimwk", model.value().get(0).location()); + Assertions.assertEquals("ibgjmfxumvfcl", model.value().get(0).vm().sourceVmId()); Assertions.assertEquals(WindowsOsState.SYSPREP_REQUESTED, model.value().get(0).vm().windowsOsInfo().windowsOsState()); - Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, + Assertions.assertEquals(LinuxOsState.DEPROVISION_REQUESTED, model.value().get(0).vm().linuxOsInfo().linuxOsState()); - Assertions.assertEquals("bdunygaeqid", model.value().get(0).vhd().imageName()); - Assertions.assertEquals(true, model.value().get(0).vhd().sysPrep()); + Assertions.assertEquals("fezzxscyhwzdg", model.value().get(0).vhd().imageName()); + Assertions.assertFalse(model.value().get(0).vhd().sysPrep()); Assertions.assertEquals(CustomImageOsType.LINUX, model.value().get(0).vhd().osType()); - Assertions.assertEquals("pxllrx", model.value().get(0).description()); - Assertions.assertEquals("jmoadsuv", model.value().get(0).author()); - Assertions.assertEquals("wdmjsjqbjhhyx", model.value().get(0).managedImageId()); - Assertions.assertEquals("wlycoduhpkxkg", model.value().get(0).managedSnapshotId()); - Assertions.assertEquals("eqnajxqugjhkycu", model.value().get(0).dataDiskStorageInfo().get(0).lun()); + Assertions.assertEquals("zbomvzzbtdcqvpni", model.value().get(0).description()); + Assertions.assertEquals("jviylwdshfs", model.value().get(0).author()); + Assertions.assertEquals("gy", model.value().get(0).managedImageId()); + Assertions.assertEquals("rymsgaojfmw", model.value().get(0).managedSnapshotId()); + Assertions.assertEquals("mrfhirctymox", model.value().get(0).dataDiskStorageInfo().get(0).lun()); Assertions.assertEquals(StorageType.STANDARD_SSD, model.value().get(0).dataDiskStorageInfo().get(0).storageType()); - Assertions.assertEquals("krmnjijpxacqqud", model.value().get(0).customImagePlan().id()); - Assertions.assertEquals("byxbaaabjy", model.value().get(0).customImagePlan().publisher()); - Assertions.assertEquals("yffimrzrtuzqogs", model.value().get(0).customImagePlan().offer()); - Assertions.assertEquals(false, model.value().get(0).isPlanAuthorized()); - Assertions.assertEquals("ximerqfobwyznk", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomImageList model - = new CustomImageList() - .withValue( - Arrays.asList( - new CustomImageInner().withLocation("rthzvaytdwkqbrqu") - .withTags(mapOf("r", "xhexiilivpdti", "yfxrx", "tdqoaxoruzfgsq", "ptramxj", "l")) - .withVm(new CustomImagePropertiesFromVm().withSourceVmId("khly") - .withWindowsOsInfo( - new WindowsOsInfo().withWindowsOsState(WindowsOsState.SYSPREP_REQUESTED)) - .withLinuxOsInfo(new LinuxOsInfo().withLinuxOsState(LinuxOsState.DEPROVISION_APPLIED))) - .withVhd(new CustomImagePropertiesCustom().withImageName("bdunygaeqid") - .withSysPrep(true) - .withOsType(CustomImageOsType.LINUX)) - .withDescription("pxllrx") - .withAuthor("jmoadsuv") - .withManagedImageId("wdmjsjqbjhhyx") - .withManagedSnapshotId("wlycoduhpkxkg") - .withDataDiskStorageInfo(Arrays.asList( - new DataDiskStorageTypeInfo().withLun("eqnajxqugjhkycu") - .withStorageType(StorageType.STANDARD_SSD), - new DataDiskStorageTypeInfo().withLun("gssofwq").withStorageType(StorageType.PREMIUM))) - .withCustomImagePlan(new CustomImagePropertiesFromPlan() - .withId("krmnjijpxacqqud") - .withPublisher("byxbaaabjy") - .withOffer("yffimrzrtuzqogs")) - .withIsPlanAuthorized(false), - new CustomImageInner().withLocation("ppriol") - .withTags(mapOf("sobqw", "jaltolmnc", "vglsbjjca", "sdbnwdcfhucqdpf", "t", "vxb")) - .withVm(new CustomImagePropertiesFromVm().withSourceVmId("odko") - .withWindowsOsInfo( - new WindowsOsInfo().withWindowsOsState(WindowsOsState.SYSPREP_APPLIED)) - .withLinuxOsInfo( - new LinuxOsInfo().withLinuxOsState(LinuxOsState.DEPROVISION_REQUESTED))) - .withVhd(new CustomImagePropertiesCustom().withImageName("mmsbvdkcrodtjin") - .withSysPrep(true) - .withOsType(CustomImageOsType.NONE)) - .withDescription("lt") - .withAuthor("cjvefkdlfo") - .withManagedImageId("kfpagao") - .withManagedSnapshotId("ulpqblylsyxkqjn") - .withDataDiskStorageInfo(Arrays.asList( - new DataDiskStorageTypeInfo().withLun("vti").withStorageType(StorageType.PREMIUM), - new DataDiskStorageTypeInfo().withLun("dszue").withStorageType(StorageType.PREMIUM), - new DataDiskStorageTypeInfo().withLun("zkfzbeyv") - .withStorageType(StorageType.STANDARD))) - .withCustomImagePlan(new CustomImagePropertiesFromPlan() - .withId("vinvkj") - .withPublisher("dxrbuukzcle") - .withOffer("hmlwpaztzpo")) - .withIsPlanAuthorized(true), - new CustomImageInner().withLocation("doamciodhkha") - .withTags(mapOf("ntoe", "hnzbonl", "hksz", "okdwb", "bt", "cmrvexzt")) - .withVm(new CustomImagePropertiesFromVm().withSourceVmId("vkg") - .withWindowsOsInfo( - new WindowsOsInfo().withWindowsOsState(WindowsOsState.NON_SYSPREPPED)) - .withLinuxOsInfo( - new LinuxOsInfo().withLinuxOsState(LinuxOsState.DEPROVISION_REQUESTED))) - .withVhd(new CustomImagePropertiesCustom().withImageName("vsaznqntorudsg") - .withSysPrep(false) - .withOsType(CustomImageOsType.WINDOWS)) - .withDescription("yc") - .withAuthor("auwjuetaebu") - .withManagedImageId("movsmzlxwabmqoe") - .withManagedSnapshotId("ifrvtpu") - .withDataDiskStorageInfo(Arrays.asList( - new DataDiskStorageTypeInfo().withLun("qlgkfbtn").withStorageType(StorageType.PREMIUM), - new DataDiskStorageTypeInfo().withLun("n").withStorageType(StorageType.STANDARD_SSD))) - .withCustomImagePlan(new CustomImagePropertiesFromPlan().withId("tujitcjedft") - .withPublisher("ae") - .withOffer("ojvdcpzfoqo")) - .withIsPlanAuthorized(false))) - .withNextLink("ximerqfobwyznk"); - model = BinaryData.fromObject(model).toObject(CustomImageList.class); - Assertions.assertEquals("rthzvaytdwkqbrqu", model.value().get(0).location()); - Assertions.assertEquals("xhexiilivpdti", model.value().get(0).tags().get("r")); - Assertions.assertEquals("khly", model.value().get(0).vm().sourceVmId()); - Assertions.assertEquals(WindowsOsState.SYSPREP_REQUESTED, - model.value().get(0).vm().windowsOsInfo().windowsOsState()); - Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, - model.value().get(0).vm().linuxOsInfo().linuxOsState()); - Assertions.assertEquals("bdunygaeqid", model.value().get(0).vhd().imageName()); - Assertions.assertEquals(true, model.value().get(0).vhd().sysPrep()); - Assertions.assertEquals(CustomImageOsType.LINUX, model.value().get(0).vhd().osType()); - Assertions.assertEquals("pxllrx", model.value().get(0).description()); - Assertions.assertEquals("jmoadsuv", model.value().get(0).author()); - Assertions.assertEquals("wdmjsjqbjhhyx", model.value().get(0).managedImageId()); - Assertions.assertEquals("wlycoduhpkxkg", model.value().get(0).managedSnapshotId()); - Assertions.assertEquals("eqnajxqugjhkycu", model.value().get(0).dataDiskStorageInfo().get(0).lun()); - Assertions.assertEquals(StorageType.STANDARD_SSD, - model.value().get(0).dataDiskStorageInfo().get(0).storageType()); - Assertions.assertEquals("krmnjijpxacqqud", model.value().get(0).customImagePlan().id()); - Assertions.assertEquals("byxbaaabjy", model.value().get(0).customImagePlan().publisher()); - Assertions.assertEquals("yffimrzrtuzqogs", model.value().get(0).customImagePlan().offer()); - Assertions.assertEquals(false, model.value().get(0).isPlanAuthorized()); - Assertions.assertEquals("ximerqfobwyznk", 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; + Assertions.assertEquals("a", model.value().get(0).customImagePlan().id()); + Assertions.assertEquals("qjlihhyuspska", model.value().get(0).customImagePlan().publisher()); + Assertions.assertEquals("vlmfwdgzxulucv", model.value().get(0).customImagePlan().offer()); + Assertions.assertTrue(model.value().get(0).isPlanAuthorized()); + Assertions.assertEquals("jgcyztsfmznba", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesCustomTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesCustomTests.java index ff586f486a84..d48cea14b4da 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesCustomTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesCustomTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,21 +13,21 @@ public final class CustomImagePropertiesCustomTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CustomImagePropertiesCustom model - = BinaryData.fromString("{\"imageName\":\"vwxqibyqunyo\",\"sysPrep\":false,\"osType\":\"None\"}") + = BinaryData.fromString("{\"imageName\":\"xgfrpdsofbshrnsv\",\"sysPrep\":true,\"osType\":\"Linux\"}") .toObject(CustomImagePropertiesCustom.class); - Assertions.assertEquals("vwxqibyqunyo", model.imageName()); - Assertions.assertEquals(false, model.sysPrep()); - Assertions.assertEquals(CustomImageOsType.NONE, model.osType()); + Assertions.assertEquals("xgfrpdsofbshrnsv", model.imageName()); + Assertions.assertTrue(model.sysPrep()); + Assertions.assertEquals(CustomImageOsType.LINUX, model.osType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CustomImagePropertiesCustom model = new CustomImagePropertiesCustom().withImageName("vwxqibyqunyo") - .withSysPrep(false) - .withOsType(CustomImageOsType.NONE); + CustomImagePropertiesCustom model = new CustomImagePropertiesCustom().withImageName("xgfrpdsofbshrnsv") + .withSysPrep(true) + .withOsType(CustomImageOsType.LINUX); model = BinaryData.fromObject(model).toObject(CustomImagePropertiesCustom.class); - Assertions.assertEquals("vwxqibyqunyo", model.imageName()); - Assertions.assertEquals(false, model.sysPrep()); - Assertions.assertEquals(CustomImageOsType.NONE, model.osType()); + Assertions.assertEquals("xgfrpdsofbshrnsv", model.imageName()); + Assertions.assertTrue(model.sysPrep()); + Assertions.assertEquals(CustomImageOsType.LINUX, model.osType()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesFromPlanTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesFromPlanTests.java index 20dc5b42eb50..bc70962ee66b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesFromPlanTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesFromPlanTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,22 +11,21 @@ public final class CustomImagePropertiesFromPlanTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CustomImagePropertiesFromPlan model = BinaryData - .fromString("{\"id\":\"cizsjqlhkrribdei\",\"publisher\":\"ipqkghvxndzwm\",\"offer\":\"efajpj\"}") - .toObject(CustomImagePropertiesFromPlan.class); - Assertions.assertEquals("cizsjqlhkrribdei", model.id()); - Assertions.assertEquals("ipqkghvxndzwm", model.publisher()); - Assertions.assertEquals("efajpj", model.offer()); + CustomImagePropertiesFromPlan model + = BinaryData.fromString("{\"id\":\"cnunvjsr\",\"publisher\":\"f\",\"offer\":\"nopqgikyzirtx\"}") + .toObject(CustomImagePropertiesFromPlan.class); + Assertions.assertEquals("cnunvjsr", model.id()); + Assertions.assertEquals("f", model.publisher()); + Assertions.assertEquals("nopqgikyzirtx", model.offer()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CustomImagePropertiesFromPlan model = new CustomImagePropertiesFromPlan().withId("cizsjqlhkrribdei") - .withPublisher("ipqkghvxndzwm") - .withOffer("efajpj"); + CustomImagePropertiesFromPlan model + = new CustomImagePropertiesFromPlan().withId("cnunvjsr").withPublisher("f").withOffer("nopqgikyzirtx"); model = BinaryData.fromObject(model).toObject(CustomImagePropertiesFromPlan.class); - Assertions.assertEquals("cizsjqlhkrribdei", model.id()); - Assertions.assertEquals("ipqkghvxndzwm", model.publisher()); - Assertions.assertEquals("efajpj", model.offer()); + Assertions.assertEquals("cnunvjsr", model.id()); + Assertions.assertEquals("f", model.publisher()); + Assertions.assertEquals("nopqgikyzirtx", model.offer()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesFromVmTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesFromVmTests.java index 810e6df3a2cc..67130a73712c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesFromVmTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesFromVmTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -16,21 +16,21 @@ public final class CustomImagePropertiesFromVmTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CustomImagePropertiesFromVm model = BinaryData.fromString( - "{\"sourceVmId\":\"nwzxltjcv\",\"windowsOsInfo\":{\"windowsOsState\":\"NonSysprepped\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionApplied\"}}") + "{\"sourceVmId\":\"kkgthr\",\"windowsOsInfo\":{\"windowsOsState\":\"SysprepRequested\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionApplied\"}}") .toObject(CustomImagePropertiesFromVm.class); - Assertions.assertEquals("nwzxltjcv", model.sourceVmId()); - Assertions.assertEquals(WindowsOsState.NON_SYSPREPPED, model.windowsOsInfo().windowsOsState()); + Assertions.assertEquals("kkgthr", model.sourceVmId()); + Assertions.assertEquals(WindowsOsState.SYSPREP_REQUESTED, model.windowsOsInfo().windowsOsState()); Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, model.linuxOsInfo().linuxOsState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CustomImagePropertiesFromVm model = new CustomImagePropertiesFromVm().withSourceVmId("nwzxltjcv") - .withWindowsOsInfo(new WindowsOsInfo().withWindowsOsState(WindowsOsState.NON_SYSPREPPED)) + CustomImagePropertiesFromVm model = new CustomImagePropertiesFromVm().withSourceVmId("kkgthr") + .withWindowsOsInfo(new WindowsOsInfo().withWindowsOsState(WindowsOsState.SYSPREP_REQUESTED)) .withLinuxOsInfo(new LinuxOsInfo().withLinuxOsState(LinuxOsState.DEPROVISION_APPLIED)); model = BinaryData.fromObject(model).toObject(CustomImagePropertiesFromVm.class); - Assertions.assertEquals("nwzxltjcv", model.sourceVmId()); - Assertions.assertEquals(WindowsOsState.NON_SYSPREPPED, model.windowsOsInfo().windowsOsState()); + Assertions.assertEquals("kkgthr", model.sourceVmId()); + Assertions.assertEquals(WindowsOsState.SYSPREP_REQUESTED, model.windowsOsInfo().windowsOsState()); Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, model.linuxOsInfo().linuxOsState()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesTests.java index 83c5a13d0b46..17efca2804da 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -23,62 +23,63 @@ public final class CustomImagePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CustomImageProperties model = BinaryData.fromString( - "{\"vm\":{\"sourceVmId\":\"rgzdwmsweyp\",\"windowsOsInfo\":{\"windowsOsState\":\"SysprepApplied\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionRequested\"}},\"vhd\":{\"imageName\":\"cnxqhuexmkttlst\",\"sysPrep\":true,\"osType\":\"None\"},\"description\":\"emhzrncsdtc\",\"author\":\"siypbs\",\"creationDate\":\"2021-03-20T23:23:02Z\",\"managedImageId\":\"gusl\",\"managedSnapshotId\":\"adcy\",\"dataDiskStorageInfo\":[{\"lun\":\"yhejhzisxgfp\",\"storageType\":\"Premium\"},{\"lun\":\"p\",\"storageType\":\"Premium\"},{\"lun\":\"r\",\"storageType\":\"Standard\"}],\"customImagePlan\":{\"id\":\"zraehtwd\",\"publisher\":\"ftswibyrcdlbhsh\",\"offer\":\"p\"},\"isPlanAuthorized\":false,\"provisioningState\":\"twitykhev\",\"uniqueIdentifier\":\"cedcpnmdy\"}") + "{\"vm\":{\"sourceVmId\":\"lrcoolsttpki\",\"windowsOsInfo\":{\"windowsOsState\":\"SysprepApplied\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionApplied\"}},\"vhd\":{\"imageName\":\"wvtylbfpncurdo\",\"sysPrep\":false,\"osType\":\"Linux\"},\"description\":\"htywubxcbihwq\",\"author\":\"fdntwjchrdgoih\",\"creationDate\":\"2021-10-03T14:03:48Z\",\"managedImageId\":\"ctondz\",\"managedSnapshotId\":\"uu\",\"dataDiskStorageInfo\":[{\"lun\":\"wggytsbwtovvt\",\"storageType\":\"Premium\"},{\"lun\":\"nqfiufxqknpi\",\"storageType\":\"Premium\"},{\"lun\":\"pttwqmsn\",\"storageType\":\"Standard\"},{\"lun\":\"dmqnrojlpij\",\"storageType\":\"Standard\"}],\"customImagePlan\":{\"id\":\"rddh\",\"publisher\":\"atiz\",\"offer\":\"onasxifto\"},\"isPlanAuthorized\":true,\"provisioningState\":\"hftwesgog\",\"uniqueIdentifier\":\"honnxkrlgnyhmos\"}") .toObject(CustomImageProperties.class); - Assertions.assertEquals("rgzdwmsweyp", model.vm().sourceVmId()); + Assertions.assertEquals("lrcoolsttpki", model.vm().sourceVmId()); Assertions.assertEquals(WindowsOsState.SYSPREP_APPLIED, model.vm().windowsOsInfo().windowsOsState()); - Assertions.assertEquals(LinuxOsState.DEPROVISION_REQUESTED, model.vm().linuxOsInfo().linuxOsState()); - Assertions.assertEquals("cnxqhuexmkttlst", model.vhd().imageName()); - Assertions.assertEquals(true, model.vhd().sysPrep()); - Assertions.assertEquals(CustomImageOsType.NONE, model.vhd().osType()); - Assertions.assertEquals("emhzrncsdtc", model.description()); - Assertions.assertEquals("siypbs", model.author()); - Assertions.assertEquals("gusl", model.managedImageId()); - Assertions.assertEquals("adcy", model.managedSnapshotId()); - Assertions.assertEquals("yhejhzisxgfp", model.dataDiskStorageInfo().get(0).lun()); + Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, model.vm().linuxOsInfo().linuxOsState()); + Assertions.assertEquals("wvtylbfpncurdo", model.vhd().imageName()); + Assertions.assertFalse(model.vhd().sysPrep()); + Assertions.assertEquals(CustomImageOsType.LINUX, model.vhd().osType()); + Assertions.assertEquals("htywubxcbihwq", model.description()); + Assertions.assertEquals("fdntwjchrdgoih", model.author()); + Assertions.assertEquals("ctondz", model.managedImageId()); + Assertions.assertEquals("uu", model.managedSnapshotId()); + Assertions.assertEquals("wggytsbwtovvt", model.dataDiskStorageInfo().get(0).lun()); Assertions.assertEquals(StorageType.PREMIUM, model.dataDiskStorageInfo().get(0).storageType()); - Assertions.assertEquals("zraehtwd", model.customImagePlan().id()); - Assertions.assertEquals("ftswibyrcdlbhsh", model.customImagePlan().publisher()); - Assertions.assertEquals("p", model.customImagePlan().offer()); - Assertions.assertEquals(false, model.isPlanAuthorized()); + Assertions.assertEquals("rddh", model.customImagePlan().id()); + Assertions.assertEquals("atiz", model.customImagePlan().publisher()); + Assertions.assertEquals("onasxifto", model.customImagePlan().offer()); + Assertions.assertTrue(model.isPlanAuthorized()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CustomImageProperties model = new CustomImageProperties() - .withVm(new CustomImagePropertiesFromVm().withSourceVmId("rgzdwmsweyp") + .withVm(new CustomImagePropertiesFromVm().withSourceVmId("lrcoolsttpki") .withWindowsOsInfo(new WindowsOsInfo().withWindowsOsState(WindowsOsState.SYSPREP_APPLIED)) - .withLinuxOsInfo(new LinuxOsInfo().withLinuxOsState(LinuxOsState.DEPROVISION_REQUESTED))) - .withVhd(new CustomImagePropertiesCustom().withImageName("cnxqhuexmkttlst") - .withSysPrep(true) - .withOsType(CustomImageOsType.NONE)) - .withDescription("emhzrncsdtc") - .withAuthor("siypbs") - .withManagedImageId("gusl") - .withManagedSnapshotId("adcy") + .withLinuxOsInfo(new LinuxOsInfo().withLinuxOsState(LinuxOsState.DEPROVISION_APPLIED))) + .withVhd(new CustomImagePropertiesCustom().withImageName("wvtylbfpncurdo") + .withSysPrep(false) + .withOsType(CustomImageOsType.LINUX)) + .withDescription("htywubxcbihwq") + .withAuthor("fdntwjchrdgoih") + .withManagedImageId("ctondz") + .withManagedSnapshotId("uu") .withDataDiskStorageInfo(Arrays.asList( - new DataDiskStorageTypeInfo().withLun("yhejhzisxgfp").withStorageType(StorageType.PREMIUM), - new DataDiskStorageTypeInfo().withLun("p").withStorageType(StorageType.PREMIUM), - new DataDiskStorageTypeInfo().withLun("r").withStorageType(StorageType.STANDARD))) + new DataDiskStorageTypeInfo().withLun("wggytsbwtovvt").withStorageType(StorageType.PREMIUM), + new DataDiskStorageTypeInfo().withLun("nqfiufxqknpi").withStorageType(StorageType.PREMIUM), + new DataDiskStorageTypeInfo().withLun("pttwqmsn").withStorageType(StorageType.STANDARD), + new DataDiskStorageTypeInfo().withLun("dmqnrojlpij").withStorageType(StorageType.STANDARD))) .withCustomImagePlan( - new CustomImagePropertiesFromPlan().withId("zraehtwd").withPublisher("ftswibyrcdlbhsh").withOffer("p")) - .withIsPlanAuthorized(false); + new CustomImagePropertiesFromPlan().withId("rddh").withPublisher("atiz").withOffer("onasxifto")) + .withIsPlanAuthorized(true); model = BinaryData.fromObject(model).toObject(CustomImageProperties.class); - Assertions.assertEquals("rgzdwmsweyp", model.vm().sourceVmId()); + Assertions.assertEquals("lrcoolsttpki", model.vm().sourceVmId()); Assertions.assertEquals(WindowsOsState.SYSPREP_APPLIED, model.vm().windowsOsInfo().windowsOsState()); - Assertions.assertEquals(LinuxOsState.DEPROVISION_REQUESTED, model.vm().linuxOsInfo().linuxOsState()); - Assertions.assertEquals("cnxqhuexmkttlst", model.vhd().imageName()); - Assertions.assertEquals(true, model.vhd().sysPrep()); - Assertions.assertEquals(CustomImageOsType.NONE, model.vhd().osType()); - Assertions.assertEquals("emhzrncsdtc", model.description()); - Assertions.assertEquals("siypbs", model.author()); - Assertions.assertEquals("gusl", model.managedImageId()); - Assertions.assertEquals("adcy", model.managedSnapshotId()); - Assertions.assertEquals("yhejhzisxgfp", model.dataDiskStorageInfo().get(0).lun()); + Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, model.vm().linuxOsInfo().linuxOsState()); + Assertions.assertEquals("wvtylbfpncurdo", model.vhd().imageName()); + Assertions.assertFalse(model.vhd().sysPrep()); + Assertions.assertEquals(CustomImageOsType.LINUX, model.vhd().osType()); + Assertions.assertEquals("htywubxcbihwq", model.description()); + Assertions.assertEquals("fdntwjchrdgoih", model.author()); + Assertions.assertEquals("ctondz", model.managedImageId()); + Assertions.assertEquals("uu", model.managedSnapshotId()); + Assertions.assertEquals("wggytsbwtovvt", model.dataDiskStorageInfo().get(0).lun()); Assertions.assertEquals(StorageType.PREMIUM, model.dataDiskStorageInfo().get(0).storageType()); - Assertions.assertEquals("zraehtwd", model.customImagePlan().id()); - Assertions.assertEquals("ftswibyrcdlbhsh", model.customImagePlan().publisher()); - Assertions.assertEquals("p", model.customImagePlan().offer()); - Assertions.assertEquals(false, model.isPlanAuthorized()); + Assertions.assertEquals("rddh", model.customImagePlan().id()); + Assertions.assertEquals("atiz", model.customImagePlan().publisher()); + Assertions.assertEquals("onasxifto", model.customImagePlan().offer()); + Assertions.assertTrue(model.isPlanAuthorized()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateMockTests.java index 735b03141745..697a24bf6f30 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.CustomImage; @@ -34,55 +34,56 @@ public final class CustomImagesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"vm\":{\"sourceVmId\":\"gqphrgfnzhctmjts\",\"windowsOsInfo\":{\"windowsOsState\":\"SysprepApplied\"},\"linuxOsInfo\":{\"linuxOsState\":\"NonDeprovisioned\"}},\"vhd\":{\"imageName\":\"arpzeqacdldtzm\",\"sysPrep\":false,\"osType\":\"Linux\"},\"description\":\"cpczshnuqnd\",\"author\":\"zupfkhuytuszxhm\",\"creationDate\":\"2021-10-02T12:20:25Z\",\"managedImageId\":\"egw\",\"managedSnapshotId\":\"ukvzwydwttha\",\"dataDiskStorageInfo\":[{\"lun\":\"skjivbsshajqfuk\",\"storageType\":\"Standard\"},{\"lun\":\"pgeumilh\",\"storageType\":\"Premium\"},{\"lun\":\"rdexyio\",\"storageType\":\"Premium\"}],\"customImagePlan\":{\"id\":\"nbdbzsxcwqqr\",\"publisher\":\"pcbbprtugav\",\"offer\":\"bcyksivmfogd\"},\"isPlanAuthorized\":true,\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"gmbawvifdxk\"},\"location\":\"cifhocjxwkl\",\"tags\":{\"xxvir\":\"rvtxvcmufunlc\",\"rquv\":\"eyngjg\"},\"id\":\"ygg\",\"name\":\"pmcrdcuelj\",\"type\":\"iahxmfqryarvs\"}"; + = "{\"properties\":{\"vm\":{\"sourceVmId\":\"dshezs\",\"windowsOsInfo\":{\"windowsOsState\":\"NonSysprepped\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionApplied\"}},\"vhd\":{\"imageName\":\"vmozsayebrazwz\",\"sysPrep\":false,\"osType\":\"None\"},\"description\":\"zuykykipfsdyepfn\",\"author\":\"mbezacfpztg\",\"creationDate\":\"2021-12-06T04:01:25Z\",\"managedImageId\":\"qejg\",\"managedSnapshotId\":\"okctgkppgkqzkc\",\"dataDiskStorageInfo\":[{\"lun\":\"fngdyfcixr\",\"storageType\":\"Standard\"},{\"lun\":\"vhoej\",\"storageType\":\"Standard\"},{\"lun\":\"tgwrmkahpqha\",\"storageType\":\"StandardSSD\"}],\"customImagePlan\":{\"id\":\"cihn\",\"publisher\":\"gmipnmliqmvlbhik\",\"offer\":\"qgrvg\"},\"isPlanAuthorized\":false,\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"dtsdfjy\"},\"tags\":{\"ofjsbgbwwzvdaj\":\"ocwiqbuoutmpyzgl\",\"jrlhiqlwixvtboug\":\"wnncfmaciqg\",\"ap\":\"xtndopgjttbasua\"},\"location\":\"n\",\"id\":\"eaqbkixv\",\"name\":\"lwynpbbfqvzfj\",\"type\":\"spugzfeuzjljmph\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); CustomImage response = manager.customImages() - .define("jrr") - .withRegion("lj") - .withExistingLab("hmtybkcgsuthhll", "mwynefxexlfciatx") - .withTags(mapOf("jpbi", "vume", "leqirccjclykcgxv", "nzpphepife", "punettepdjxq", "pjlvczuoda")) - .withVm(new CustomImagePropertiesFromVm().withSourceVmId("dskjhhxdlaj") - .withWindowsOsInfo(new WindowsOsInfo().withWindowsOsState(WindowsOsState.SYSPREP_APPLIED)) - .withLinuxOsInfo(new LinuxOsInfo().withLinuxOsState(LinuxOsState.DEPROVISION_APPLIED))) - .withVhd(new CustomImagePropertiesCustom().withImageName("lxlhuavkrm") - .withSysPrep(true) + .define("w") + .withExistingLab("wobtdphti", "sffofwanmhksca") + .withRegion("scz") + .withTags(mapOf("x", "jwotnxlkfhglhrf", "nhpcselqx", "wecr", "ukklvzrlr", "vppqi", "cme", "l")) + .withVm(new CustomImagePropertiesFromVm().withSourceVmId("gwd") + .withWindowsOsInfo(new WindowsOsInfo().withWindowsOsState(WindowsOsState.SYSPREP_REQUESTED)) + .withLinuxOsInfo(new LinuxOsInfo().withLinuxOsState(LinuxOsState.NON_DEPROVISIONED))) + .withVhd(new CustomImagePropertiesCustom().withImageName("ozokscvglli") + .withSysPrep(false) .withOsType(CustomImageOsType.NONE)) - .withDescription("mkxettcsloj") - .withAuthor("qid") - .withManagedImageId("qxjhqxcsqhtkbtnq") - .withManagedSnapshotId("ngldmbiipsn") + .withDescription("fgw") + .withAuthor("qkjvxprwpxsoohu") + .withManagedImageId("skl") + .withManagedSnapshotId("zuu") .withDataDiskStorageInfo( - Arrays.asList(new DataDiskStorageTypeInfo().withLun("qkzn").withStorageType(StorageType.PREMIUM))) - .withCustomImagePlan( - new CustomImagePropertiesFromPlan().withId("xricctkwmuqq").withPublisher("jxeiy").withOffer("esrw")) + Arrays.asList(new DataDiskStorageTypeInfo().withLun("lfb").withStorageType(StorageType.STANDARD))) + .withCustomImagePlan(new CustomImagePropertiesFromPlan().withId("ubsrtmdylperpilt") + .withPublisher("zgczfcmfpfbode") + .withOffer("esrgvtshuvftwai")) .withIsPlanAuthorized(false) .create(); - Assertions.assertEquals("cifhocjxwkl", response.location()); - Assertions.assertEquals("rvtxvcmufunlc", response.tags().get("xxvir")); - Assertions.assertEquals("gqphrgfnzhctmjts", response.vm().sourceVmId()); - Assertions.assertEquals(WindowsOsState.SYSPREP_APPLIED, response.vm().windowsOsInfo().windowsOsState()); - Assertions.assertEquals(LinuxOsState.NON_DEPROVISIONED, response.vm().linuxOsInfo().linuxOsState()); - Assertions.assertEquals("arpzeqacdldtzm", response.vhd().imageName()); - Assertions.assertEquals(false, response.vhd().sysPrep()); - Assertions.assertEquals(CustomImageOsType.LINUX, response.vhd().osType()); - Assertions.assertEquals("cpczshnuqnd", response.description()); - Assertions.assertEquals("zupfkhuytuszxhm", response.author()); - Assertions.assertEquals("egw", response.managedImageId()); - Assertions.assertEquals("ukvzwydwttha", response.managedSnapshotId()); - Assertions.assertEquals("skjivbsshajqfuk", response.dataDiskStorageInfo().get(0).lun()); + Assertions.assertEquals("ocwiqbuoutmpyzgl", response.tags().get("ofjsbgbwwzvdaj")); + Assertions.assertEquals("n", response.location()); + Assertions.assertEquals("dshezs", response.vm().sourceVmId()); + Assertions.assertEquals(WindowsOsState.NON_SYSPREPPED, response.vm().windowsOsInfo().windowsOsState()); + Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, response.vm().linuxOsInfo().linuxOsState()); + Assertions.assertEquals("vmozsayebrazwz", response.vhd().imageName()); + Assertions.assertFalse(response.vhd().sysPrep()); + Assertions.assertEquals(CustomImageOsType.NONE, response.vhd().osType()); + Assertions.assertEquals("zuykykipfsdyepfn", response.description()); + Assertions.assertEquals("mbezacfpztg", response.author()); + Assertions.assertEquals("qejg", response.managedImageId()); + Assertions.assertEquals("okctgkppgkqzkc", response.managedSnapshotId()); + Assertions.assertEquals("fngdyfcixr", response.dataDiskStorageInfo().get(0).lun()); Assertions.assertEquals(StorageType.STANDARD, response.dataDiskStorageInfo().get(0).storageType()); - Assertions.assertEquals("nbdbzsxcwqqr", response.customImagePlan().id()); - Assertions.assertEquals("pcbbprtugav", response.customImagePlan().publisher()); - Assertions.assertEquals("bcyksivmfogd", response.customImagePlan().offer()); - Assertions.assertEquals(true, response.isPlanAuthorized()); + Assertions.assertEquals("cihn", response.customImagePlan().id()); + Assertions.assertEquals("gmipnmliqmvlbhik", response.customImagePlan().publisher()); + Assertions.assertEquals("qgrvg", response.customImagePlan().offer()); + Assertions.assertFalse(response.isPlanAuthorized()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteMockTests.java index dca30262ab68..f5cb1347f81e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDelete() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.customImages() - .delete("drlefgnaavuag", "tetaoutnpdctuhs", "fefyihduyeuyld", com.azure.core.util.Context.NONE); + manager.customImages().delete("hnijmriprlkdneyt", "lrcxivcbkut", "umltwjflu", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetWithResponseMockTests.java index 49a4fa902304..ef354e171694 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.CustomImage; @@ -25,36 +25,36 @@ public final class CustomImagesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"vm\":{\"sourceVmId\":\"ywhsbrcarycs\",\"windowsOsInfo\":{\"windowsOsState\":\"SysprepApplied\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionApplied\"}},\"vhd\":{\"imageName\":\"juve\",\"sysPrep\":true,\"osType\":\"Linux\"},\"description\":\"mk\",\"author\":\"bhmpfulubefgybp\",\"creationDate\":\"2021-02-17T23:35:47Z\",\"managedImageId\":\"ununm\",\"managedSnapshotId\":\"krvfyifkdschl\",\"dataDiskStorageInfo\":[{\"lun\":\"ctnkjjwgcwnph\",\"storageType\":\"Standard\"}],\"customImagePlan\":{\"id\":\"rtogmhmj\",\"publisher\":\"scdfpdqw\",\"offer\":\"gevgwmse\"},\"isPlanAuthorized\":true,\"provisioningState\":\"ifvqnr\",\"uniqueIdentifier\":\"mbpjptnvwjh\"},\"location\":\"sidqpxlbtpakft\",\"tags\":{\"ym\":\"twmykyut\"},\"id\":\"wmfjhp\",\"name\":\"cvjqdv\",\"type\":\"wkqp\"}"; + = "{\"properties\":{\"vm\":{\"sourceVmId\":\"uxweyslandkd\",\"windowsOsInfo\":{\"windowsOsState\":\"SysprepApplied\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionApplied\"}},\"vhd\":{\"imageName\":\"cgawnrrnquo\",\"sysPrep\":false,\"osType\":\"None\"},\"description\":\"reimseob\",\"author\":\"xstcyilbvzm\",\"creationDate\":\"2020-12-24T16:35:27Z\",\"managedImageId\":\"zlquzexo\",\"managedSnapshotId\":\"xebjvbz\",\"dataDiskStorageInfo\":[{\"lun\":\"bwmvogljsvl\",\"storageType\":\"Standard\"},{\"lun\":\"nwcehaqidoyzl\",\"storageType\":\"Premium\"}],\"customImagePlan\":{\"id\":\"qoqpepiaeap\",\"publisher\":\"ergdtpeqnac\",\"offer\":\"eqwbpqqncjubkhj\"},\"isPlanAuthorized\":false,\"provisioningState\":\"mcwmbup\",\"uniqueIdentifier\":\"qyvliqiipsejbsvs\"},\"tags\":{\"zydisnuep\":\"eswhd\",\"nldpxottd\":\"wyj\",\"ocqibz\":\"i\",\"ph\":\"ihweeb\"},\"location\":\"vcjwqwoqsratj\",\"id\":\"hzybspijhfrz\",\"name\":\"dkkagvwukhsusmm\",\"type\":\"rfmzhwilz\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); CustomImage response = manager.customImages() - .getWithResponse("to", "alswbnfd", "epl", "wqjnsfzygleexa", com.azure.core.util.Context.NONE) + .getWithResponse("fss", "yghsf", "rkbhammgmqfm", "fgvqcpdw", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("sidqpxlbtpakft", response.location()); - Assertions.assertEquals("twmykyut", response.tags().get("ym")); - Assertions.assertEquals("ywhsbrcarycs", response.vm().sourceVmId()); + Assertions.assertEquals("eswhd", response.tags().get("zydisnuep")); + Assertions.assertEquals("vcjwqwoqsratj", response.location()); + Assertions.assertEquals("uxweyslandkd", response.vm().sourceVmId()); Assertions.assertEquals(WindowsOsState.SYSPREP_APPLIED, response.vm().windowsOsInfo().windowsOsState()); Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, response.vm().linuxOsInfo().linuxOsState()); - Assertions.assertEquals("juve", response.vhd().imageName()); - Assertions.assertEquals(true, response.vhd().sysPrep()); - Assertions.assertEquals(CustomImageOsType.LINUX, response.vhd().osType()); - Assertions.assertEquals("mk", response.description()); - Assertions.assertEquals("bhmpfulubefgybp", response.author()); - Assertions.assertEquals("ununm", response.managedImageId()); - Assertions.assertEquals("krvfyifkdschl", response.managedSnapshotId()); - Assertions.assertEquals("ctnkjjwgcwnph", response.dataDiskStorageInfo().get(0).lun()); + Assertions.assertEquals("cgawnrrnquo", response.vhd().imageName()); + Assertions.assertFalse(response.vhd().sysPrep()); + Assertions.assertEquals(CustomImageOsType.NONE, response.vhd().osType()); + Assertions.assertEquals("reimseob", response.description()); + Assertions.assertEquals("xstcyilbvzm", response.author()); + Assertions.assertEquals("zlquzexo", response.managedImageId()); + Assertions.assertEquals("xebjvbz", response.managedSnapshotId()); + Assertions.assertEquals("bwmvogljsvl", response.dataDiskStorageInfo().get(0).lun()); Assertions.assertEquals(StorageType.STANDARD, response.dataDiskStorageInfo().get(0).storageType()); - Assertions.assertEquals("rtogmhmj", response.customImagePlan().id()); - Assertions.assertEquals("scdfpdqw", response.customImagePlan().publisher()); - Assertions.assertEquals("gevgwmse", response.customImagePlan().offer()); - Assertions.assertEquals(true, response.isPlanAuthorized()); + Assertions.assertEquals("qoqpepiaeap", response.customImagePlan().id()); + Assertions.assertEquals("ergdtpeqnac", response.customImagePlan().publisher()); + Assertions.assertEquals("eqwbpqqncjubkhj", response.customImagePlan().offer()); + Assertions.assertFalse(response.isPlanAuthorized()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListMockTests.java index 6fe042eb4279..c9fb9727071f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.CustomImage; @@ -26,39 +26,39 @@ public final class CustomImagesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"vm\":{\"sourceVmId\":\"owsbedenrexkxbh\",\"windowsOsInfo\":{\"windowsOsState\":\"SysprepApplied\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionRequested\"}},\"vhd\":{\"imageName\":\"nhj\",\"sysPrep\":true,\"osType\":\"Windows\"},\"description\":\"nfa\",\"author\":\"vkskmqozzk\",\"creationDate\":\"2021-11-02T23:04:21Z\",\"managedImageId\":\"jrliiz\",\"managedSnapshotId\":\"xlqfh\",\"dataDiskStorageInfo\":[{\"lun\":\"absol\",\"storageType\":\"Standard\"},{\"lun\":\"qlmgnlqxsjxt\",\"storageType\":\"Standard\"},{\"lun\":\"hvuqbo\",\"storageType\":\"StandardSSD\"}],\"customImagePlan\":{\"id\":\"qocarkuzlbc\",\"publisher\":\"dtsnxawqytllhdyz\",\"offer\":\"ckze\"},\"isPlanAuthorized\":false,\"provisioningState\":\"kck\",\"uniqueIdentifier\":\"ymx\"},\"location\":\"aabjkdtfohfao\",\"tags\":{\"y\":\"kiwrsiw\",\"rra\":\"quryk\",\"s\":\"eek\",\"gdda\":\"eh\"},\"id\":\"bcbgydlqidywmhm\",\"name\":\"tyrilkfbnrqqxvz\",\"type\":\"pbnfnqtx\"}]}"; + = "{\"value\":[{\"properties\":{\"vm\":{\"sourceVmId\":\"rvtz\",\"windowsOsInfo\":{\"windowsOsState\":\"NonSysprepped\"},\"linuxOsInfo\":{\"linuxOsState\":\"DeprovisionApplied\"}},\"vhd\":{\"imageName\":\"jhxpcvrd\",\"sysPrep\":true,\"osType\":\"None\"},\"description\":\"aneqadynzja\",\"author\":\"riuomzczfkic\",\"creationDate\":\"2021-08-31T15:31:54Z\",\"managedImageId\":\"a\",\"managedSnapshotId\":\"wspcaxikhfjqebg\",\"dataDiskStorageInfo\":[{\"lun\":\"xgzzr\",\"storageType\":\"Standard\"},{\"lun\":\"g\",\"storageType\":\"Premium\"},{\"lun\":\"tme\",\"storageType\":\"StandardSSD\"}],\"customImagePlan\":{\"id\":\"pinkzp\",\"publisher\":\"qtdiswxspvckoj\",\"offer\":\"bbg\"},\"isPlanAuthorized\":false,\"provisioningState\":\"esubzpvpv\",\"uniqueIdentifier\":\"lyt\"},\"tags\":{\"lbmuos\":\"qseusrfjbdxzfxnx\",\"zlwhbwzjnufzrfgm\":\"kjmdihdcyy\"},\"location\":\"gnnbzrtf\",\"id\":\"dzuubjtvgjsxm\",\"name\":\"yj\",\"type\":\"vavdp\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.customImages() - .list("ybmrzoepnxwd", "wnjkgvfn", "xaurs", "ftibtyibuyvpirfq", 989541715, "n", + .list("ynbpvzlqywauy", "njc", "hmocgjshg", "u", 993167813, "hwvixqqggljkybsj", com.azure.core.util.Context.NONE); - Assertions.assertEquals("aabjkdtfohfao", response.iterator().next().location()); - Assertions.assertEquals("kiwrsiw", response.iterator().next().tags().get("y")); - Assertions.assertEquals("owsbedenrexkxbh", response.iterator().next().vm().sourceVmId()); - Assertions.assertEquals(WindowsOsState.SYSPREP_APPLIED, + Assertions.assertEquals("qseusrfjbdxzfxnx", response.iterator().next().tags().get("lbmuos")); + Assertions.assertEquals("gnnbzrtf", response.iterator().next().location()); + Assertions.assertEquals("rvtz", response.iterator().next().vm().sourceVmId()); + Assertions.assertEquals(WindowsOsState.NON_SYSPREPPED, response.iterator().next().vm().windowsOsInfo().windowsOsState()); - Assertions.assertEquals(LinuxOsState.DEPROVISION_REQUESTED, + Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, response.iterator().next().vm().linuxOsInfo().linuxOsState()); - Assertions.assertEquals("nhj", response.iterator().next().vhd().imageName()); - Assertions.assertEquals(true, response.iterator().next().vhd().sysPrep()); - Assertions.assertEquals(CustomImageOsType.WINDOWS, response.iterator().next().vhd().osType()); - Assertions.assertEquals("nfa", response.iterator().next().description()); - Assertions.assertEquals("vkskmqozzk", response.iterator().next().author()); - Assertions.assertEquals("jrliiz", response.iterator().next().managedImageId()); - Assertions.assertEquals("xlqfh", response.iterator().next().managedSnapshotId()); - Assertions.assertEquals("absol", response.iterator().next().dataDiskStorageInfo().get(0).lun()); + Assertions.assertEquals("jhxpcvrd", response.iterator().next().vhd().imageName()); + Assertions.assertTrue(response.iterator().next().vhd().sysPrep()); + Assertions.assertEquals(CustomImageOsType.NONE, response.iterator().next().vhd().osType()); + Assertions.assertEquals("aneqadynzja", response.iterator().next().description()); + Assertions.assertEquals("riuomzczfkic", response.iterator().next().author()); + Assertions.assertEquals("a", response.iterator().next().managedImageId()); + Assertions.assertEquals("wspcaxikhfjqebg", response.iterator().next().managedSnapshotId()); + Assertions.assertEquals("xgzzr", response.iterator().next().dataDiskStorageInfo().get(0).lun()); Assertions.assertEquals(StorageType.STANDARD, response.iterator().next().dataDiskStorageInfo().get(0).storageType()); - Assertions.assertEquals("qocarkuzlbc", response.iterator().next().customImagePlan().id()); - Assertions.assertEquals("dtsnxawqytllhdyz", response.iterator().next().customImagePlan().publisher()); - Assertions.assertEquals("ckze", response.iterator().next().customImagePlan().offer()); - Assertions.assertEquals(false, response.iterator().next().isPlanAuthorized()); + Assertions.assertEquals("pinkzp", response.iterator().next().customImagePlan().id()); + Assertions.assertEquals("qtdiswxspvckoj", response.iterator().next().customImagePlan().publisher()); + Assertions.assertEquals("bbg", response.iterator().next().customImagePlan().offer()); + Assertions.assertFalse(response.iterator().next().isPlanAuthorized()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DataDiskPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DataDiskPropertiesTests.java index e8843516128a..605a141d1941 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DataDiskPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DataDiskPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -15,28 +15,28 @@ public final class DataDiskPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataDiskProperties model = BinaryData.fromString( - "{\"attachNewDataDiskOptions\":{\"diskSizeGiB\":1554558708,\"diskName\":\"crpw\",\"diskType\":\"StandardSSD\"},\"existingLabDiskId\":\"noigbrnjwmwk\",\"hostCaching\":\"None\"}") + "{\"attachNewDataDiskOptions\":{\"diskSizeGiB\":1146215181,\"diskName\":\"adehxnltyfsopp\",\"diskType\":\"Premium\"},\"existingLabDiskId\":\"snzwd\",\"hostCaching\":\"None\"}") .toObject(DataDiskProperties.class); - Assertions.assertEquals(1554558708, model.attachNewDataDiskOptions().diskSizeGiB()); - Assertions.assertEquals("crpw", model.attachNewDataDiskOptions().diskName()); - Assertions.assertEquals(StorageType.STANDARD_SSD, model.attachNewDataDiskOptions().diskType()); - Assertions.assertEquals("noigbrnjwmwk", model.existingLabDiskId()); + Assertions.assertEquals(1146215181, model.attachNewDataDiskOptions().diskSizeGiB()); + Assertions.assertEquals("adehxnltyfsopp", model.attachNewDataDiskOptions().diskName()); + Assertions.assertEquals(StorageType.PREMIUM, model.attachNewDataDiskOptions().diskType()); + Assertions.assertEquals("snzwd", model.existingLabDiskId()); Assertions.assertEquals(HostCachingOptions.NONE, model.hostCaching()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DataDiskProperties model = new DataDiskProperties() - .withAttachNewDataDiskOptions(new AttachNewDataDiskOptions().withDiskSizeGiB(1554558708) - .withDiskName("crpw") - .withDiskType(StorageType.STANDARD_SSD)) - .withExistingLabDiskId("noigbrnjwmwk") + .withAttachNewDataDiskOptions(new AttachNewDataDiskOptions().withDiskSizeGiB(1146215181) + .withDiskName("adehxnltyfsopp") + .withDiskType(StorageType.PREMIUM)) + .withExistingLabDiskId("snzwd") .withHostCaching(HostCachingOptions.NONE); model = BinaryData.fromObject(model).toObject(DataDiskProperties.class); - Assertions.assertEquals(1554558708, model.attachNewDataDiskOptions().diskSizeGiB()); - Assertions.assertEquals("crpw", model.attachNewDataDiskOptions().diskName()); - Assertions.assertEquals(StorageType.STANDARD_SSD, model.attachNewDataDiskOptions().diskType()); - Assertions.assertEquals("noigbrnjwmwk", model.existingLabDiskId()); + Assertions.assertEquals(1146215181, model.attachNewDataDiskOptions().diskSizeGiB()); + Assertions.assertEquals("adehxnltyfsopp", model.attachNewDataDiskOptions().diskName()); + Assertions.assertEquals(StorageType.PREMIUM, model.attachNewDataDiskOptions().diskType()); + Assertions.assertEquals("snzwd", model.existingLabDiskId()); Assertions.assertEquals(HostCachingOptions.NONE, model.hostCaching()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DataDiskStorageTypeInfoTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DataDiskStorageTypeInfoTests.java index d643f819554e..23fe26737e76 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DataDiskStorageTypeInfoTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DataDiskStorageTypeInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,18 +12,18 @@ public final class DataDiskStorageTypeInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DataDiskStorageTypeInfo model = BinaryData.fromString("{\"lun\":\"djrkvfgbvfvpd\",\"storageType\":\"Premium\"}") + DataDiskStorageTypeInfo model = BinaryData.fromString("{\"lun\":\"vz\",\"storageType\":\"Premium\"}") .toObject(DataDiskStorageTypeInfo.class); - Assertions.assertEquals("djrkvfgbvfvpd", model.lun()); + Assertions.assertEquals("vz", model.lun()); Assertions.assertEquals(StorageType.PREMIUM, model.storageType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DataDiskStorageTypeInfo model - = new DataDiskStorageTypeInfo().withLun("djrkvfgbvfvpd").withStorageType(StorageType.PREMIUM); + = new DataDiskStorageTypeInfo().withLun("vz").withStorageType(StorageType.PREMIUM); model = BinaryData.fromObject(model).toObject(DataDiskStorageTypeInfo.class); - Assertions.assertEquals("djrkvfgbvfvpd", model.lun()); + Assertions.assertEquals("vz", model.lun()); Assertions.assertEquals(StorageType.PREMIUM, model.storageType()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DayDetailsTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DayDetailsTests.java index 28b8f6fa75e1..7afa3d7f2b1f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DayDetailsTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DayDetailsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,14 +11,14 @@ public final class DayDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DayDetails model = BinaryData.fromString("{\"time\":\"suyonobglaocq\"}").toObject(DayDetails.class); - Assertions.assertEquals("suyonobglaocq", model.time()); + DayDetails model = BinaryData.fromString("{\"time\":\"rm\"}").toObject(DayDetails.class); + Assertions.assertEquals("rm", model.time()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DayDetails model = new DayDetails().withTime("suyonobglaocq"); + DayDetails model = new DayDetails().withTime("rm"); model = BinaryData.fromObject(model).toObject(DayDetails.class); - Assertions.assertEquals("suyonobglaocq", model.time()); + Assertions.assertEquals("rm", model.time()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DetachDataDiskPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DetachDataDiskPropertiesTests.java index d79adcb19b9f..1b755f0678a7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DetachDataDiskPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DetachDataDiskPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,15 +11,15 @@ public final class DetachDataDiskPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DetachDataDiskProperties model = BinaryData.fromString("{\"existingLabDiskId\":\"jhbzxliohrdddtf\"}") + DetachDataDiskProperties model = BinaryData.fromString("{\"existingLabDiskId\":\"anblwphqlkccu\"}") .toObject(DetachDataDiskProperties.class); - Assertions.assertEquals("jhbzxliohrdddtf", model.existingLabDiskId()); + Assertions.assertEquals("anblwphqlkccu", model.existingLabDiskId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DetachDataDiskProperties model = new DetachDataDiskProperties().withExistingLabDiskId("jhbzxliohrdddtf"); + DetachDataDiskProperties model = new DetachDataDiskProperties().withExistingLabDiskId("anblwphqlkccu"); model = BinaryData.fromObject(model).toObject(DetachDataDiskProperties.class); - Assertions.assertEquals("jhbzxliohrdddtf", model.existingLabDiskId()); + Assertions.assertEquals("anblwphqlkccu", model.existingLabDiskId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DetachDiskPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DetachDiskPropertiesTests.java index 1275556e6bc1..bb674d04b825 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DetachDiskPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DetachDiskPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,14 +12,14 @@ public final class DetachDiskPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DetachDiskProperties model - = BinaryData.fromString("{\"leasedByLabVmId\":\"ylhjlm\"}").toObject(DetachDiskProperties.class); - Assertions.assertEquals("ylhjlm", model.leasedByLabVmId()); + = BinaryData.fromString("{\"leasedByLabVmId\":\"sccbiuimzd\"}").toObject(DetachDiskProperties.class); + Assertions.assertEquals("sccbiuimzd", model.leasedByLabVmId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DetachDiskProperties model = new DetachDiskProperties().withLeasedByLabVmId("ylhjlm"); + DetachDiskProperties model = new DetachDiskProperties().withLeasedByLabVmId("sccbiuimzd"); model = BinaryData.fromObject(model).toObject(DetachDiskProperties.class); - Assertions.assertEquals("ylhjlm", model.leasedByLabVmId()); + Assertions.assertEquals("sccbiuimzd", model.leasedByLabVmId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskFragmentTests.java index 00fa865ea096..7fcefe2369a5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,16 +13,18 @@ public final class DiskFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DiskFragment model = BinaryData.fromString("{\"tags\":{\"bphbqzmizakakank\":\"etpwbralll\",\"n\":\"p\"}}") + DiskFragment model = BinaryData.fromString( + "{\"tags\":{\"piqywnc\":\"nzonzl\",\"zehtdhgb\":\"jtszcof\",\"reljeamur\":\"k\",\"xlpm\":\"zmlovuanash\"}}") .toObject(DiskFragment.class); - Assertions.assertEquals("etpwbralll", model.tags().get("bphbqzmizakakank")); + Assertions.assertEquals("nzonzl", model.tags().get("piqywnc")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DiskFragment model = new DiskFragment().withTags(mapOf("bphbqzmizakakank", "etpwbralll", "n", "p")); + DiskFragment model = new DiskFragment() + .withTags(mapOf("piqywnc", "nzonzl", "zehtdhgb", "jtszcof", "reljeamur", "k", "xlpm", "zmlovuanash")); model = BinaryData.fromObject(model).toObject(DiskFragment.class); - Assertions.assertEquals("etpwbralll", model.tags().get("bphbqzmizakakank")); + Assertions.assertEquals("nzonzl", model.tags().get("piqywnc")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskInnerTests.java index 8618192037a9..325a54defc06 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -15,43 +15,45 @@ public final class DiskInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DiskInner model = BinaryData.fromString( - "{\"properties\":{\"diskType\":\"StandardSSD\",\"diskSizeGiB\":186835160,\"leasedByLabVmId\":\"boxdfgsftufq\",\"diskBlobName\":\"rjlnacgcck\",\"diskUri\":\"hxkizvytnrzv\",\"storageAccountId\":\"jraaeranokqguk\",\"createdDate\":\"2021-02-25T03:05:59Z\",\"hostCaching\":\"vbroylaxxu\",\"managedDiskId\":\"disdosfjbjsvgj\",\"provisioningState\":\"hryvy\",\"uniqueIdentifier\":\"t\"},\"location\":\"c\",\"tags\":{\"vjdhttzaefedxih\":\"ccknfnwmbtmvp\"},\"id\":\"hrphkmcrjdqn\",\"name\":\"dfzpbgtgkylkdg\",\"type\":\"rjeuut\"}") + "{\"properties\":{\"diskType\":\"Premium\",\"diskSizeGiB\":1515253868,\"leasedByLabVmId\":\"aka\",\"diskBlobName\":\"nkjpdnjzha\",\"diskUri\":\"ylhjlm\",\"storageAccountId\":\"y\",\"createdDate\":\"2021-01-19T18:48:39Z\",\"hostCaching\":\"mrsopte\",\"managedDiskId\":\"jme\",\"provisioningState\":\"ls\",\"uniqueIdentifier\":\"asylwx\"},\"tags\":{\"athwt\":\"umweoohguufuzboy\",\"ebwjscjpahlxvea\":\"olbaemwmdx\",\"xnmwmqtibxyijddt\":\"f\",\"ekpndzaapmudq\":\"qcttadijaeukmrsi\"},\"location\":\"qwigpibudqwyxe\",\"id\":\"ybpmzznrtffyaq\",\"name\":\"tmhheioqa\",\"type\":\"hvseufuqyrx\"}") .toObject(DiskInner.class); - Assertions.assertEquals("c", model.location()); - Assertions.assertEquals("ccknfnwmbtmvp", model.tags().get("vjdhttzaefedxih")); - Assertions.assertEquals(StorageType.STANDARD_SSD, model.diskType()); - Assertions.assertEquals(186835160, model.diskSizeGiB()); - Assertions.assertEquals("boxdfgsftufq", model.leasedByLabVmId()); - Assertions.assertEquals("rjlnacgcck", model.diskBlobName()); - Assertions.assertEquals("hxkizvytnrzv", model.diskUri()); - Assertions.assertEquals("jraaeranokqguk", model.storageAccountId()); - Assertions.assertEquals("vbroylaxxu", model.hostCaching()); - Assertions.assertEquals("disdosfjbjsvgj", model.managedDiskId()); + Assertions.assertEquals("umweoohguufuzboy", model.tags().get("athwt")); + Assertions.assertEquals("qwigpibudqwyxe", model.location()); + Assertions.assertEquals(StorageType.PREMIUM, model.diskType()); + Assertions.assertEquals(1515253868, model.diskSizeGiB()); + Assertions.assertEquals("aka", model.leasedByLabVmId()); + Assertions.assertEquals("nkjpdnjzha", model.diskBlobName()); + Assertions.assertEquals("ylhjlm", model.diskUri()); + Assertions.assertEquals("y", model.storageAccountId()); + Assertions.assertEquals("mrsopte", model.hostCaching()); + Assertions.assertEquals("jme", model.managedDiskId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DiskInner model = new DiskInner().withLocation("c") - .withTags(mapOf("vjdhttzaefedxih", "ccknfnwmbtmvp")) - .withDiskType(StorageType.STANDARD_SSD) - .withDiskSizeGiB(186835160) - .withLeasedByLabVmId("boxdfgsftufq") - .withDiskBlobName("rjlnacgcck") - .withDiskUri("hxkizvytnrzv") - .withStorageAccountId("jraaeranokqguk") - .withHostCaching("vbroylaxxu") - .withManagedDiskId("disdosfjbjsvgj"); + DiskInner model = new DiskInner() + .withTags(mapOf("athwt", "umweoohguufuzboy", "ebwjscjpahlxvea", "olbaemwmdx", "xnmwmqtibxyijddt", "f", + "ekpndzaapmudq", "qcttadijaeukmrsi")) + .withLocation("qwigpibudqwyxe") + .withDiskType(StorageType.PREMIUM) + .withDiskSizeGiB(1515253868) + .withLeasedByLabVmId("aka") + .withDiskBlobName("nkjpdnjzha") + .withDiskUri("ylhjlm") + .withStorageAccountId("y") + .withHostCaching("mrsopte") + .withManagedDiskId("jme"); model = BinaryData.fromObject(model).toObject(DiskInner.class); - Assertions.assertEquals("c", model.location()); - Assertions.assertEquals("ccknfnwmbtmvp", model.tags().get("vjdhttzaefedxih")); - Assertions.assertEquals(StorageType.STANDARD_SSD, model.diskType()); - Assertions.assertEquals(186835160, model.diskSizeGiB()); - Assertions.assertEquals("boxdfgsftufq", model.leasedByLabVmId()); - Assertions.assertEquals("rjlnacgcck", model.diskBlobName()); - Assertions.assertEquals("hxkizvytnrzv", model.diskUri()); - Assertions.assertEquals("jraaeranokqguk", model.storageAccountId()); - Assertions.assertEquals("vbroylaxxu", model.hostCaching()); - Assertions.assertEquals("disdosfjbjsvgj", model.managedDiskId()); + Assertions.assertEquals("umweoohguufuzboy", model.tags().get("athwt")); + Assertions.assertEquals("qwigpibudqwyxe", model.location()); + Assertions.assertEquals(StorageType.PREMIUM, model.diskType()); + Assertions.assertEquals(1515253868, model.diskSizeGiB()); + Assertions.assertEquals("aka", model.leasedByLabVmId()); + Assertions.assertEquals("nkjpdnjzha", model.diskBlobName()); + Assertions.assertEquals("ylhjlm", model.diskUri()); + Assertions.assertEquals("y", model.storageAccountId()); + Assertions.assertEquals("mrsopte", model.hostCaching()); + Assertions.assertEquals("jme", model.managedDiskId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskListTests.java index 7c8144108c3f..90fcae6aad3d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskListTests.java @@ -1,105 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.DiskInner; -import com.azure.resourcemanager.devtestlabs.models.DiskList; +import com.azure.resourcemanager.devtestlabs.implementation.models.DiskList; import com.azure.resourcemanager.devtestlabs.models.StorageType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class DiskListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DiskList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"diskType\":\"Premium\",\"diskSizeGiB\":212642888,\"leasedByLabVmId\":\"ijr\",\"diskBlobName\":\"civmmg\",\"diskUri\":\"cf\",\"storageAccountId\":\"rxgkne\",\"createdDate\":\"2021-03-10T19:40:09Z\",\"hostCaching\":\"nzqodfvpg\",\"managedDiskId\":\"oxgsgbpfgzdjtx\",\"provisioningState\":\"flbqvgaq\",\"uniqueIdentifier\":\"gafcqu\"},\"location\":\"rdve\",\"tags\":{\"uzhyrmewipmvekdx\":\"sdtutnwlduyc\",\"zhhzjhfjmhvvmu\":\"kuqgsjjxundxgket\",\"yihsasbhudypohyu\":\"gpmuneqsxvmhfbuz\"},\"id\":\"ms\",\"name\":\"ynsqyrpfoobr\",\"type\":\"ttymsjny\"},{\"properties\":{\"diskType\":\"Premium\",\"diskSizeGiB\":1366289055,\"leasedByLabVmId\":\"qzdz\",\"diskBlobName\":\"ilaxhn\",\"diskUri\":\"qlyvijo\",\"storageAccountId\":\"iv\",\"createdDate\":\"2021-07-27T23:48:23Z\",\"hostCaching\":\"zunbixx\",\"managedDiskId\":\"ikvcpwp\",\"provisioningState\":\"lrcivtsoxfrke\",\"uniqueIdentifier\":\"pmyyefrpmpdnqq\"},\"location\":\"ka\",\"tags\":{\"qfr\":\"qvmmbn\"},\"id\":\"qlkzme\",\"name\":\"nitgvkxlz\",\"type\":\"qdrfegcealzxwhc\"},{\"properties\":{\"diskType\":\"StandardSSD\",\"diskSizeGiB\":767381416,\"leasedByLabVmId\":\"yqhlwigdivbkbx\",\"diskBlobName\":\"mf\",\"diskUri\":\"uwasqvd\",\"storageAccountId\":\"y\",\"createdDate\":\"2021-08-11T03:03:16Z\",\"hostCaching\":\"akjsqz\",\"managedDiskId\":\"bezkgimsidxasic\",\"provisioningState\":\"yvvjskgfmo\",\"uniqueIdentifier\":\"ah\"},\"location\":\"qgatjeaahhvjhhn\",\"tags\":{\"yxvxevblbjed\":\"ybbjjidjksyx\",\"smjbnkppxyn\":\"ljlageuaulxu\"},\"id\":\"nlsvxeiz\",\"name\":\"gwklnsr\",\"type\":\"ffeycx\"},{\"properties\":{\"diskType\":\"Premium\",\"diskSizeGiB\":1565970230,\"leasedByLabVmId\":\"merteeammxqiek\",\"diskBlobName\":\"zddrt\",\"diskUri\":\"doj\",\"storageAccountId\":\"xv\",\"createdDate\":\"2021-02-28T00:16:23Z\",\"hostCaching\":\"fdeesvecuijpxtx\",\"managedDiskId\":\"wprtu\",\"provisioningState\":\"sawddjibabxvi\",\"uniqueIdentifier\":\"tvtzeexavoxtfg\"},\"location\":\"ecdmdqbwpy\",\"tags\":{\"slhhxudbxv\":\"gsfjac\",\"tnsi\":\"d\"},\"id\":\"ud\",\"name\":\"z\",\"type\":\"mes\"}],\"nextLink\":\"dlpagzrcxfail\"}") + "{\"value\":[{\"properties\":{\"diskType\":\"Premium\",\"diskSizeGiB\":1098245078,\"leasedByLabVmId\":\"lvidizozs\",\"diskBlobName\":\"ccxjm\",\"diskUri\":\"fdgnwncypuuwwlt\",\"storageAccountId\":\"qjctzenkeif\",\"createdDate\":\"2021-10-09T09:49:25Z\",\"hostCaching\":\"kdasvflyhbxcudch\",\"managedDiskId\":\"srboldforobw\",\"provisioningState\":\"vizbfhfo\",\"uniqueIdentifier\":\"acqpbtuodxesza\"},\"tags\":{\"wumuaslzk\":\"l\",\"mdr\":\"rrwoycqucwyhahn\"},\"location\":\"wuhpsvfuur\",\"id\":\"lwexxwl\",\"name\":\"lniexz\",\"type\":\"rzpgep\"},{\"properties\":{\"diskType\":\"Standard\",\"diskSizeGiB\":808258027,\"leasedByLabVmId\":\"wpgdak\",\"diskBlobName\":\"zyvli\",\"diskUri\":\"nrkcxkj\",\"storageAccountId\":\"nxm\",\"createdDate\":\"2021-10-29T13:36:36Z\",\"hostCaching\":\"swqrntvlwijp\",\"managedDiskId\":\"texoqqpwc\",\"provisioningState\":\"ufmhrunc\",\"uniqueIdentifier\":\"mqspkcdqzhlctdd\"},\"tags\":{\"pchrqbn\":\"ndy\"},\"location\":\"rcgegydcwboxjum\",\"id\":\"qoli\",\"name\":\"r\",\"type\":\"aiouaubrjt\"}],\"nextLink\":\"qxfuojrngif\"}") .toObject(DiskList.class); - Assertions.assertEquals("rdve", model.value().get(0).location()); - Assertions.assertEquals("sdtutnwlduyc", model.value().get(0).tags().get("uzhyrmewipmvekdx")); + Assertions.assertEquals("l", model.value().get(0).tags().get("wumuaslzk")); + Assertions.assertEquals("wuhpsvfuur", model.value().get(0).location()); Assertions.assertEquals(StorageType.PREMIUM, model.value().get(0).diskType()); - Assertions.assertEquals(212642888, model.value().get(0).diskSizeGiB()); - Assertions.assertEquals("ijr", model.value().get(0).leasedByLabVmId()); - Assertions.assertEquals("civmmg", model.value().get(0).diskBlobName()); - Assertions.assertEquals("cf", model.value().get(0).diskUri()); - Assertions.assertEquals("rxgkne", model.value().get(0).storageAccountId()); - Assertions.assertEquals("nzqodfvpg", model.value().get(0).hostCaching()); - Assertions.assertEquals("oxgsgbpfgzdjtx", model.value().get(0).managedDiskId()); - Assertions.assertEquals("dlpagzrcxfail", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiskList model = new DiskList().withValue(Arrays.asList( - new DiskInner().withLocation("rdve") - .withTags(mapOf("uzhyrmewipmvekdx", "sdtutnwlduyc", "zhhzjhfjmhvvmu", "kuqgsjjxundxgket", - "yihsasbhudypohyu", "gpmuneqsxvmhfbuz")) - .withDiskType(StorageType.PREMIUM) - .withDiskSizeGiB(212642888) - .withLeasedByLabVmId("ijr") - .withDiskBlobName("civmmg") - .withDiskUri("cf") - .withStorageAccountId("rxgkne") - .withHostCaching("nzqodfvpg") - .withManagedDiskId("oxgsgbpfgzdjtx"), - new DiskInner().withLocation("ka") - .withTags(mapOf("qfr", "qvmmbn")) - .withDiskType(StorageType.PREMIUM) - .withDiskSizeGiB(1366289055) - .withLeasedByLabVmId("qzdz") - .withDiskBlobName("ilaxhn") - .withDiskUri("qlyvijo") - .withStorageAccountId("iv") - .withHostCaching("zunbixx") - .withManagedDiskId("ikvcpwp"), - new DiskInner().withLocation("qgatjeaahhvjhhn") - .withTags(mapOf("yxvxevblbjed", "ybbjjidjksyx", "smjbnkppxyn", "ljlageuaulxu")) - .withDiskType(StorageType.STANDARD_SSD) - .withDiskSizeGiB(767381416) - .withLeasedByLabVmId("yqhlwigdivbkbx") - .withDiskBlobName("mf") - .withDiskUri("uwasqvd") - .withStorageAccountId("y") - .withHostCaching("akjsqz") - .withManagedDiskId("bezkgimsidxasic"), - new DiskInner().withLocation("ecdmdqbwpy") - .withTags(mapOf("slhhxudbxv", "gsfjac", "tnsi", "d")) - .withDiskType(StorageType.PREMIUM) - .withDiskSizeGiB(1565970230) - .withLeasedByLabVmId("merteeammxqiek") - .withDiskBlobName("zddrt") - .withDiskUri("doj") - .withStorageAccountId("xv") - .withHostCaching("fdeesvecuijpxtx") - .withManagedDiskId("wprtu"))) - .withNextLink("dlpagzrcxfail"); - model = BinaryData.fromObject(model).toObject(DiskList.class); - Assertions.assertEquals("rdve", model.value().get(0).location()); - Assertions.assertEquals("sdtutnwlduyc", model.value().get(0).tags().get("uzhyrmewipmvekdx")); - Assertions.assertEquals(StorageType.PREMIUM, model.value().get(0).diskType()); - Assertions.assertEquals(212642888, model.value().get(0).diskSizeGiB()); - Assertions.assertEquals("ijr", model.value().get(0).leasedByLabVmId()); - Assertions.assertEquals("civmmg", model.value().get(0).diskBlobName()); - Assertions.assertEquals("cf", model.value().get(0).diskUri()); - Assertions.assertEquals("rxgkne", model.value().get(0).storageAccountId()); - Assertions.assertEquals("nzqodfvpg", model.value().get(0).hostCaching()); - Assertions.assertEquals("oxgsgbpfgzdjtx", model.value().get(0).managedDiskId()); - Assertions.assertEquals("dlpagzrcxfail", 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; + Assertions.assertEquals(1098245078, model.value().get(0).diskSizeGiB()); + Assertions.assertEquals("lvidizozs", model.value().get(0).leasedByLabVmId()); + Assertions.assertEquals("ccxjm", model.value().get(0).diskBlobName()); + Assertions.assertEquals("fdgnwncypuuwwlt", model.value().get(0).diskUri()); + Assertions.assertEquals("qjctzenkeif", model.value().get(0).storageAccountId()); + Assertions.assertEquals("kdasvflyhbxcudch", model.value().get(0).hostCaching()); + Assertions.assertEquals("srboldforobw", model.value().get(0).managedDiskId()); + Assertions.assertEquals("qxfuojrngif", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskPropertiesTests.java index b6b3db4147de..7203cf4cf1b1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DiskPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,36 +13,36 @@ public final class DiskPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DiskProperties model = BinaryData.fromString( - "{\"diskType\":\"Standard\",\"diskSizeGiB\":102339077,\"leasedByLabVmId\":\"zhokvbwnhh\",\"diskBlobName\":\"lgehg\",\"diskUri\":\"ipifhpfeoajvg\",\"storageAccountId\":\"txjcsheafidlt\",\"createdDate\":\"2021-07-18T03:03:02Z\",\"hostCaching\":\"esmkssjhoiftxfkf\",\"managedDiskId\":\"gpr\",\"provisioningState\":\"tillucbiqtg\",\"uniqueIdentifier\":\"ohmcwsld\"}") + "{\"diskType\":\"StandardSSD\",\"diskSizeGiB\":801625089,\"leasedByLabVmId\":\"lsismjqfrd\",\"diskBlobName\":\"amqu\",\"diskUri\":\"os\",\"storageAccountId\":\"ju\",\"createdDate\":\"2021-07-11T04:09:49Z\",\"hostCaching\":\"disyirnxz\",\"managedDiskId\":\"zexrxzbujrt\",\"provisioningState\":\"qvwre\",\"uniqueIdentifier\":\"h\"}") .toObject(DiskProperties.class); - Assertions.assertEquals(StorageType.STANDARD, model.diskType()); - Assertions.assertEquals(102339077, model.diskSizeGiB()); - Assertions.assertEquals("zhokvbwnhh", model.leasedByLabVmId()); - Assertions.assertEquals("lgehg", model.diskBlobName()); - Assertions.assertEquals("ipifhpfeoajvg", model.diskUri()); - Assertions.assertEquals("txjcsheafidlt", model.storageAccountId()); - Assertions.assertEquals("esmkssjhoiftxfkf", model.hostCaching()); - Assertions.assertEquals("gpr", model.managedDiskId()); + Assertions.assertEquals(StorageType.STANDARD_SSD, model.diskType()); + Assertions.assertEquals(801625089, model.diskSizeGiB()); + Assertions.assertEquals("lsismjqfrd", model.leasedByLabVmId()); + Assertions.assertEquals("amqu", model.diskBlobName()); + Assertions.assertEquals("os", model.diskUri()); + Assertions.assertEquals("ju", model.storageAccountId()); + Assertions.assertEquals("disyirnxz", model.hostCaching()); + Assertions.assertEquals("zexrxzbujrt", model.managedDiskId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DiskProperties model = new DiskProperties().withDiskType(StorageType.STANDARD) - .withDiskSizeGiB(102339077) - .withLeasedByLabVmId("zhokvbwnhh") - .withDiskBlobName("lgehg") - .withDiskUri("ipifhpfeoajvg") - .withStorageAccountId("txjcsheafidlt") - .withHostCaching("esmkssjhoiftxfkf") - .withManagedDiskId("gpr"); + DiskProperties model = new DiskProperties().withDiskType(StorageType.STANDARD_SSD) + .withDiskSizeGiB(801625089) + .withLeasedByLabVmId("lsismjqfrd") + .withDiskBlobName("amqu") + .withDiskUri("os") + .withStorageAccountId("ju") + .withHostCaching("disyirnxz") + .withManagedDiskId("zexrxzbujrt"); model = BinaryData.fromObject(model).toObject(DiskProperties.class); - Assertions.assertEquals(StorageType.STANDARD, model.diskType()); - Assertions.assertEquals(102339077, model.diskSizeGiB()); - Assertions.assertEquals("zhokvbwnhh", model.leasedByLabVmId()); - Assertions.assertEquals("lgehg", model.diskBlobName()); - Assertions.assertEquals("ipifhpfeoajvg", model.diskUri()); - Assertions.assertEquals("txjcsheafidlt", model.storageAccountId()); - Assertions.assertEquals("esmkssjhoiftxfkf", model.hostCaching()); - Assertions.assertEquals("gpr", model.managedDiskId()); + Assertions.assertEquals(StorageType.STANDARD_SSD, model.diskType()); + Assertions.assertEquals(801625089, model.diskSizeGiB()); + Assertions.assertEquals("lsismjqfrd", model.leasedByLabVmId()); + Assertions.assertEquals("amqu", model.diskBlobName()); + Assertions.assertEquals("os", model.diskUri()); + Assertions.assertEquals("ju", model.storageAccountId()); + Assertions.assertEquals("disyirnxz", model.hostCaching()); + Assertions.assertEquals("zexrxzbujrt", model.managedDiskId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachMockTests.java index 2976bab8ac9b..502180388894 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.AttachDiskProperties; @@ -26,11 +26,11 @@ public void testAttach() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.disks() - .attach("wyj", "nldpxottd", "i", "ocqibz", new AttachDiskProperties().withLeasedByLabVmId("hweebiph"), - com.azure.core.util.Context.NONE); + .attach("ysc", "ey", "zjemexmnvkvm", "wrxlniwmcpmrrdlh", + new AttachDiskProperties().withLeasedByLabVmId("vmi"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateMockTests.java index b1c4b5962ae7..ada68fa43a46 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Disk; @@ -24,40 +24,40 @@ public final class DisksCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"diskType\":\"StandardSSD\",\"diskSizeGiB\":990994976,\"leasedByLabVmId\":\"tme\",\"diskBlobName\":\"fsvpink\",\"diskUri\":\"atqtdiswxspvckoj\",\"storageAccountId\":\"bbg\",\"createdDate\":\"2021-06-11T04:02:23Z\",\"hostCaching\":\"esubzpvpv\",\"managedDiskId\":\"lyt\",\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"j\"},\"location\":\"d\",\"tags\":{\"dihdcyyyzlwhb\":\"xnxmlbmuoswkj\",\"dq\":\"zjnufzrfg\"},\"id\":\"nn\",\"name\":\"zrtftedzuubjt\",\"type\":\"gjsxmty\"}"; + = "{\"properties\":{\"diskType\":\"StandardSSD\",\"diskSizeGiB\":1135294897,\"leasedByLabVmId\":\"lwwbo\",\"diskBlobName\":\"gfklqiyndve\",\"diskUri\":\"lsb\",\"storageAccountId\":\"dstrkzxsgtz\",\"createdDate\":\"2021-09-24T03:50:20Z\",\"hostCaching\":\"rds\",\"managedDiskId\":\"vpimyndnoxa\",\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"xolousdv\"},\"tags\":{\"wz\":\"tqm\",\"qgkujds\":\"drpizfulgyctsdb\",\"eurbtigapdyarik\":\"oxrqw\",\"kfqbriqulwwt\":\"ejdpdfhtwm\"},\"location\":\"meqkvy\",\"id\":\"okpoyuoh\",\"name\":\"ensnaa\",\"type\":\"phmpoejnglpwsada\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Disk response = manager.disks() - .define("neyttl") - .withRegion("rdnyeita") - .withExistingUser("kkagvwukhsusmmor", "mzhwilzzhni", "mriprlk") - .withTags(mapOf("nzjahwriuomzczf", "ad")) - .withDiskType(StorageType.PREMIUM) - .withDiskSizeGiB(138918433) - .withLeasedByLabVmId("bkut") - .withDiskBlobName("mltwjfluxynbpvzl") - .withDiskUri("wa") - .withStorageAccountId("qnjckhmocg") - .withHostCaching("ouarhwvixqqggljk") - .withManagedDiskId("sjrclrvtzq") + .define("c") + .withExistingUser("fsgqkstyecupyuij", "ard", "vs") + .withRegion("vx") + .withTags(mapOf("o", "kdtoiboancdr")) + .withDiskType(StorageType.STANDARD) + .withDiskSizeGiB(1213933915) + .withLeasedByLabVmId("dqwuzvcm") + .withDiskBlobName("kxizek") + .withDiskUri("frjwucaon") + .withStorageAccountId("ajbvbn") + .withHostCaching("mdidac") + .withManagedDiskId("idgzwdydamis") .create(); - Assertions.assertEquals("d", response.location()); - Assertions.assertEquals("xnxmlbmuoswkj", response.tags().get("dihdcyyyzlwhb")); + Assertions.assertEquals("tqm", response.tags().get("wz")); + Assertions.assertEquals("meqkvy", response.location()); Assertions.assertEquals(StorageType.STANDARD_SSD, response.diskType()); - Assertions.assertEquals(990994976, response.diskSizeGiB()); - Assertions.assertEquals("tme", response.leasedByLabVmId()); - Assertions.assertEquals("fsvpink", response.diskBlobName()); - Assertions.assertEquals("atqtdiswxspvckoj", response.diskUri()); - Assertions.assertEquals("bbg", response.storageAccountId()); - Assertions.assertEquals("esubzpvpv", response.hostCaching()); - Assertions.assertEquals("lyt", response.managedDiskId()); + Assertions.assertEquals(1135294897, response.diskSizeGiB()); + Assertions.assertEquals("lwwbo", response.leasedByLabVmId()); + Assertions.assertEquals("gfklqiyndve", response.diskBlobName()); + Assertions.assertEquals("lsb", response.diskUri()); + Assertions.assertEquals("dstrkzxsgtz", response.storageAccountId()); + Assertions.assertEquals("rds", response.hostCaching()); + Assertions.assertEquals("vpimyndnoxa", response.managedDiskId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteMockTests.java index 0cc3b04f88a3..a67bea0771f0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDelete() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.disks().delete("upyvqyvliq", "ipsejbsvsia", "eswhd", "zydisnuep", com.azure.core.util.Context.NONE); + manager.disks() + .delete("itwhrjsdmmazdnck", "dbjp", "lhzqpxzbawkikcdg", "hbssdpjeyo", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachMockTests.java index f30b2a98014f..bdd19e13b487 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.DetachDiskProperties; @@ -26,11 +26,11 @@ public void testDetach() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.disks() - .detach("yv", "jw", "w", "qsratjhd", new DetachDiskProperties().withLeasedByLabVmId("ybspijhfrzg"), - com.azure.core.util.Context.NONE); + .detach("hbeae", "jzmhkdclacroczfm", "ner", "eluxzshxzez", + new DetachDiskProperties().withLeasedByLabVmId("uzudlevzskejcg"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetWithResponseMockTests.java index 2fb9ae5311e0..de56644a1362 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Disk; @@ -22,29 +22,29 @@ public final class DisksGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"diskType\":\"StandardSSD\",\"diskSizeGiB\":157710243,\"leasedByLabVmId\":\"dnpxpkcdpr\",\"diskBlobName\":\"xelyicghflr\",\"diskUri\":\"ssjyghsfx\",\"storageAccountId\":\"bh\",\"createdDate\":\"2021-06-24T15:14:48Z\",\"hostCaching\":\"mqfmefgvqcpd\",\"managedDiskId\":\"gquxweysland\",\"provisioningState\":\"cdjhunhg\",\"uniqueIdentifier\":\"gawnrrnquo\"},\"location\":\"sotirei\",\"tags\":{\"ilbvzmmxcjzl\":\"obfsxstc\",\"abwmvogljsv\":\"uzexokjxebjvbzin\",\"ehaqidoyzltgio\":\"pgidnw\",\"sergdtpe\":\"qoqpepiaeap\"},\"id\":\"nacyheqwb\",\"name\":\"qq\",\"type\":\"cjubkhjozfymcwm\"}"; + = "{\"properties\":{\"diskType\":\"StandardSSD\",\"diskSizeGiB\":1488582130,\"leasedByLabVmId\":\"fshksnyzmspamwb\",\"diskBlobName\":\"bnl\",\"diskUri\":\"cefiqdkt\",\"storageAccountId\":\"kvi\",\"createdDate\":\"2021-02-22T08:32:35Z\",\"hostCaching\":\"liwoyngu\",\"managedDiskId\":\"hwvladpc\",\"provisioningState\":\"jha\",\"uniqueIdentifier\":\"ybkekym\"},\"tags\":{\"hfym\":\"tsilscvqsyei\",\"seuugcig\":\"ouihy\",\"rqbebjnfveglab\":\"hogsmgbvmtd\"},\"location\":\"kbiwznhtfgfic\",\"id\":\"yhizpaczmu\",\"name\":\"bcakzn\",\"type\":\"okh\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Disk response = manager.disks() - .getWithResponse("tzamicbig", "cdgzseznux", "euairaabmdlqjb", "dp", "ixlhupm", + .getWithResponse("foygizmshxxba", "zabulnvgsk", "toxjdzj", "jznvhxqqmq", "paydhfn", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("sotirei", response.location()); - Assertions.assertEquals("obfsxstc", response.tags().get("ilbvzmmxcjzl")); + Assertions.assertEquals("tsilscvqsyei", response.tags().get("hfym")); + Assertions.assertEquals("kbiwznhtfgfic", response.location()); Assertions.assertEquals(StorageType.STANDARD_SSD, response.diskType()); - Assertions.assertEquals(157710243, response.diskSizeGiB()); - Assertions.assertEquals("dnpxpkcdpr", response.leasedByLabVmId()); - Assertions.assertEquals("xelyicghflr", response.diskBlobName()); - Assertions.assertEquals("ssjyghsfx", response.diskUri()); - Assertions.assertEquals("bh", response.storageAccountId()); - Assertions.assertEquals("mqfmefgvqcpd", response.hostCaching()); - Assertions.assertEquals("gquxweysland", response.managedDiskId()); + Assertions.assertEquals(1488582130, response.diskSizeGiB()); + Assertions.assertEquals("fshksnyzmspamwb", response.leasedByLabVmId()); + Assertions.assertEquals("bnl", response.diskBlobName()); + Assertions.assertEquals("cefiqdkt", response.diskUri()); + Assertions.assertEquals("kvi", response.storageAccountId()); + Assertions.assertEquals("liwoyngu", response.hostCaching()); + Assertions.assertEquals("hwvladpc", response.managedDiskId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksListMockTests.java index e219574744c5..809ac039b94b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DisksListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Disk; @@ -23,28 +23,27 @@ public final class DisksListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"diskType\":\"Premium\",\"diskSizeGiB\":1260726662,\"leasedByLabVmId\":\"ufgjblcdr\",\"diskBlobName\":\"fcemftzgyyky\",\"diskUri\":\"ugekdfqn\",\"storageAccountId\":\"twd\",\"createdDate\":\"2021-03-20T12:14:12Z\",\"hostCaching\":\"zfjjnnuxxrkk\",\"managedDiskId\":\"mnulwe\",\"provisioningState\":\"dcifrhjulrsulwz\",\"uniqueIdentifier\":\"lusnawmhhgzotfr\"},\"location\":\"yrgkoekv\",\"tags\":{\"pcqydeykvsk\":\"xyxhighctxbxmo\",\"frjeizikgqaboohx\":\"cz\",\"rmdvewuyqaeohpj\":\"msgycqs\",\"aurghooxa\":\"gejkbvhh\"},\"id\":\"xb\",\"name\":\"hxjxjoezlqxrkdkn\",\"type\":\"obektmbozo\"}]}"; + = "{\"value\":[{\"properties\":{\"diskType\":\"Premium\",\"diskSizeGiB\":1389187624,\"leasedByLabVmId\":\"qqzjkoxdu\",\"diskBlobName\":\"amglrouig\",\"diskUri\":\"fivjqterdqqigdy\",\"storageAccountId\":\"ghpcvrwqirvt\",\"createdDate\":\"2021-02-14T20:19:27Z\",\"hostCaching\":\"hmvfxlapjajodm\",\"managedDiskId\":\"rw\",\"provisioningState\":\"gqvqokqluj\",\"uniqueIdentifier\":\"ira\"},\"tags\":{\"hwwskn\":\"yvxchpqvctsfae\",\"lppdpgz\":\"tvzuzhasup\"},\"location\":\"qazvbkarkptgo\",\"id\":\"ruatsyiysjqhen\",\"name\":\"gbeq\",\"type\":\"gubabyjde\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.disks() - .list("q", "onswae", "kzfzqxjosho", "totryegpkhxrme", "znlw", 2084690732, "fokxk", - com.azure.core.util.Context.NONE); + .list("xdede", "f", "wh", "gxsur", "jqrshz", 1535444038, "g", com.azure.core.util.Context.NONE); - Assertions.assertEquals("yrgkoekv", response.iterator().next().location()); - Assertions.assertEquals("xyxhighctxbxmo", response.iterator().next().tags().get("pcqydeykvsk")); + Assertions.assertEquals("yvxchpqvctsfae", response.iterator().next().tags().get("hwwskn")); + Assertions.assertEquals("qazvbkarkptgo", response.iterator().next().location()); Assertions.assertEquals(StorageType.PREMIUM, response.iterator().next().diskType()); - Assertions.assertEquals(1260726662, response.iterator().next().diskSizeGiB()); - Assertions.assertEquals("ufgjblcdr", response.iterator().next().leasedByLabVmId()); - Assertions.assertEquals("fcemftzgyyky", response.iterator().next().diskBlobName()); - Assertions.assertEquals("ugekdfqn", response.iterator().next().diskUri()); - Assertions.assertEquals("twd", response.iterator().next().storageAccountId()); - Assertions.assertEquals("zfjjnnuxxrkk", response.iterator().next().hostCaching()); - Assertions.assertEquals("mnulwe", response.iterator().next().managedDiskId()); + Assertions.assertEquals(1389187624, response.iterator().next().diskSizeGiB()); + Assertions.assertEquals("qqzjkoxdu", response.iterator().next().leasedByLabVmId()); + Assertions.assertEquals("amglrouig", response.iterator().next().diskBlobName()); + Assertions.assertEquals("fivjqterdqqigdy", response.iterator().next().diskUri()); + Assertions.assertEquals("ghpcvrwqirvt", response.iterator().next().storageAccountId()); + Assertions.assertEquals("hmvfxlapjajodm", response.iterator().next().hostCaching()); + Assertions.assertEquals("rw", response.iterator().next().managedDiskId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DtlEnvironmentFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DtlEnvironmentFragmentTests.java index 2b5e083469b0..aa59a37682a2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DtlEnvironmentFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DtlEnvironmentFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,18 +13,18 @@ public final class DtlEnvironmentFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DtlEnvironmentFragment model = BinaryData.fromString( - "{\"tags\":{\"jumvqqolihrraio\":\"cgegydcwbo\",\"fuojrngif\":\"aubrjtloq\",\"dfqwmkyoq\":\"rzpasccbiuimzdly\",\"lzo\":\"fdvruz\"}}") - .toObject(DtlEnvironmentFragment.class); - Assertions.assertEquals("cgegydcwbo", model.tags().get("jumvqqolihrraio")); + DtlEnvironmentFragment model + = BinaryData.fromString("{\"tags\":{\"mqpnoda\":\"zdix\",\"sbostzel\":\"opqhewjptmc\"}}") + .toObject(DtlEnvironmentFragment.class); + Assertions.assertEquals("zdix", model.tags().get("mqpnoda")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DtlEnvironmentFragment model = new DtlEnvironmentFragment().withTags(mapOf("jumvqqolihrraio", "cgegydcwbo", - "fuojrngif", "aubrjtloq", "dfqwmkyoq", "rzpasccbiuimzdly", "lzo", "fdvruz")); + DtlEnvironmentFragment model + = new DtlEnvironmentFragment().withTags(mapOf("mqpnoda", "zdix", "sbostzel", "opqhewjptmc")); model = BinaryData.fromObject(model).toObject(DtlEnvironmentFragment.class); - Assertions.assertEquals("cgegydcwbo", model.tags().get("jumvqqolihrraio")); + Assertions.assertEquals("zdix", model.tags().get("mqpnoda")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DtlEnvironmentInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DtlEnvironmentInnerTests.java index 7a9d37f361fe..24a410fdae8b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DtlEnvironmentInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DtlEnvironmentInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -17,32 +17,37 @@ public final class DtlEnvironmentInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DtlEnvironmentInner model = BinaryData.fromString( - "{\"properties\":{\"deploymentProperties\":{\"armTemplateId\":\"smjqfrddgam\",\"parameters\":[{\"name\":\"os\",\"value\":\"ju\"},{\"name\":\"fcdis\",\"value\":\"rnxzh\"},{\"name\":\"exrxzbujrtrhq\",\"value\":\"revkhgnlnzo\"}]},\"armTemplateDisplayName\":\"lrpiqywnc\",\"resourceGroupId\":\"tszcofizehtdhgb\",\"createdByUser\":\"vreljea\",\"provisioningState\":\"rvzmlovuana\",\"uniqueIdentifier\":\"cxlpmjerb\"},\"location\":\"kelvidizozsdb\",\"tags\":{\"n\":\"jmonfdgn\",\"keifzzhmkdasv\":\"ypuuwwltvuqjctze\"},\"id\":\"lyhb\",\"name\":\"cu\",\"type\":\"chxgs\"}") + "{\"properties\":{\"deploymentProperties\":{\"armTemplateId\":\"dfqwmkyoq\",\"parameters\":[{\"name\":\"ruzslzoj\",\"value\":\"ctfnmdxotng\"},{\"name\":\"gugey\",\"value\":\"hgrky\"},{\"name\":\"zabs\",\"value\":\"fpphoj\"},{\"name\":\"vyhyhsgzfc\",\"value\":\"gomfgbeglq\"}]},\"armTemplateDisplayName\":\"eohibet\",\"resourceGroupId\":\"uankrrfxeeeb\",\"createdByUser\":\"j\",\"provisioningState\":\"cvbmqzb\",\"uniqueIdentifier\":\"xl\"},\"tags\":{\"acevehjkuyx\":\"nw\",\"aeylinm\":\"afgaoqlt\",\"irpghriypoqeyh\":\"gv\",\"ciqdsme\":\"qhykprlpyzn\"},\"location\":\"itdfuxtyasiib\",\"id\":\"ybnnustg\",\"name\":\"ljhnmgixhcmav\",\"type\":\"qfoudorhcgyy\"}") .toObject(DtlEnvironmentInner.class); - Assertions.assertEquals("kelvidizozsdb", model.location()); - Assertions.assertEquals("jmonfdgn", model.tags().get("n")); - Assertions.assertEquals("smjqfrddgam", model.deploymentProperties().armTemplateId()); - Assertions.assertEquals("os", model.deploymentProperties().parameters().get(0).name()); - Assertions.assertEquals("ju", model.deploymentProperties().parameters().get(0).value()); - Assertions.assertEquals("lrpiqywnc", model.armTemplateDisplayName()); + Assertions.assertEquals("nw", model.tags().get("acevehjkuyx")); + Assertions.assertEquals("itdfuxtyasiib", model.location()); + Assertions.assertEquals("dfqwmkyoq", model.deploymentProperties().armTemplateId()); + Assertions.assertEquals("ruzslzoj", model.deploymentProperties().parameters().get(0).name()); + Assertions.assertEquals("ctfnmdxotng", model.deploymentProperties().parameters().get(0).value()); + Assertions.assertEquals("eohibet", model.armTemplateDisplayName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DtlEnvironmentInner model = new DtlEnvironmentInner().withLocation("kelvidizozsdb") - .withTags(mapOf("n", "jmonfdgn", "keifzzhmkdasv", "ypuuwwltvuqjctze")) - .withDeploymentProperties(new EnvironmentDeploymentProperties().withArmTemplateId("smjqfrddgam") - .withParameters(Arrays.asList(new ArmTemplateParameterProperties().withName("os").withValue("ju"), - new ArmTemplateParameterProperties().withName("fcdis").withValue("rnxzh"), - new ArmTemplateParameterProperties().withName("exrxzbujrtrhq").withValue("revkhgnlnzo")))) - .withArmTemplateDisplayName("lrpiqywnc"); + DtlEnvironmentInner model + = new DtlEnvironmentInner() + .withTags( + mapOf("acevehjkuyx", "nw", "aeylinm", "afgaoqlt", "irpghriypoqeyh", "gv", "ciqdsme", "qhykprlpyzn")) + .withLocation("itdfuxtyasiib") + .withDeploymentProperties(new EnvironmentDeploymentProperties().withArmTemplateId("dfqwmkyoq") + .withParameters(Arrays.asList( + new ArmTemplateParameterProperties().withName("ruzslzoj").withValue("ctfnmdxotng"), + new ArmTemplateParameterProperties().withName("gugey").withValue("hgrky"), + new ArmTemplateParameterProperties().withName("zabs").withValue("fpphoj"), + new ArmTemplateParameterProperties().withName("vyhyhsgzfc").withValue("gomfgbeglq")))) + .withArmTemplateDisplayName("eohibet"); model = BinaryData.fromObject(model).toObject(DtlEnvironmentInner.class); - Assertions.assertEquals("kelvidizozsdb", model.location()); - Assertions.assertEquals("jmonfdgn", model.tags().get("n")); - Assertions.assertEquals("smjqfrddgam", model.deploymentProperties().armTemplateId()); - Assertions.assertEquals("os", model.deploymentProperties().parameters().get(0).name()); - Assertions.assertEquals("ju", model.deploymentProperties().parameters().get(0).value()); - Assertions.assertEquals("lrpiqywnc", model.armTemplateDisplayName()); + Assertions.assertEquals("nw", model.tags().get("acevehjkuyx")); + Assertions.assertEquals("itdfuxtyasiib", model.location()); + Assertions.assertEquals("dfqwmkyoq", model.deploymentProperties().armTemplateId()); + Assertions.assertEquals("ruzslzoj", model.deploymentProperties().parameters().get(0).name()); + Assertions.assertEquals("ctfnmdxotng", model.deploymentProperties().parameters().get(0).value()); + Assertions.assertEquals("eohibet", model.armTemplateDisplayName()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DtlEnvironmentListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DtlEnvironmentListTests.java index 2a503feef621..b23f6216ad12 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DtlEnvironmentListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/DtlEnvironmentListTests.java @@ -1,60 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.DtlEnvironmentInner; -import com.azure.resourcemanager.devtestlabs.models.ArmTemplateParameterProperties; -import com.azure.resourcemanager.devtestlabs.models.DtlEnvironmentList; -import com.azure.resourcemanager.devtestlabs.models.EnvironmentDeploymentProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.devtestlabs.implementation.models.DtlEnvironmentList; import org.junit.jupiter.api.Assertions; public final class DtlEnvironmentListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DtlEnvironmentList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"deploymentProperties\":{\"armTemplateId\":\"rimrs\",\"parameters\":[{},{},{}]},\"armTemplateDisplayName\":\"ecj\",\"resourceGroupId\":\"islstv\",\"createdByUser\":\"ylw\",\"provisioningState\":\"zaum\",\"uniqueIdentifier\":\"oohgu\"},\"location\":\"fuzboyjathwtzolb\",\"tags\":{\"xmeb\":\"wm\",\"veabfqxnmwmqtib\":\"jscjpahl\",\"jaeukmrsieekpn\":\"yijddtvqcttad\",\"pibudqwyxebeybpm\":\"zaapmudqmeqwi\"},\"id\":\"znrtffyaqit\",\"name\":\"hheioqaqhvseuf\",\"type\":\"qyrxp\"}],\"nextLink\":\"cgq\"}") + "{\"value\":[{\"properties\":{\"deploymentProperties\":{\"armTemplateId\":\"tutmzl\",\"parameters\":[{},{},{},{}]},\"armTemplateDisplayName\":\"lvfhrbbp\",\"resourceGroupId\":\"qvcww\",\"createdByUser\":\"urmochpprprs\",\"provisioningState\":\"okayzejnhlbkp\",\"uniqueIdentifier\":\"pcpil\"},\"tags\":{\"ewjwiuubw\":\"hzvechndbnwieho\"},\"location\":\"qsfapaqt\",\"id\":\"rrqwexjk\",\"name\":\"fxapjwogqqnobpu\",\"type\":\"cdabtqwpwya\"}],\"nextLink\":\"zasqbucljgkyexao\"}") .toObject(DtlEnvironmentList.class); - Assertions.assertEquals("fuzboyjathwtzolb", model.value().get(0).location()); - Assertions.assertEquals("wm", model.value().get(0).tags().get("xmeb")); - Assertions.assertEquals("rimrs", model.value().get(0).deploymentProperties().armTemplateId()); - Assertions.assertEquals("ecj", model.value().get(0).armTemplateDisplayName()); - Assertions.assertEquals("cgq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DtlEnvironmentList model = new DtlEnvironmentList() - .withValue(Arrays.asList(new DtlEnvironmentInner().withLocation("fuzboyjathwtzolb") - .withTags(mapOf("xmeb", "wm", "veabfqxnmwmqtib", "jscjpahl", "jaeukmrsieekpn", "yijddtvqcttad", - "pibudqwyxebeybpm", "zaapmudqmeqwi")) - .withDeploymentProperties(new EnvironmentDeploymentProperties().withArmTemplateId("rimrs") - .withParameters(Arrays.asList(new ArmTemplateParameterProperties(), - new ArmTemplateParameterProperties(), new ArmTemplateParameterProperties()))) - .withArmTemplateDisplayName("ecj"))) - .withNextLink("cgq"); - model = BinaryData.fromObject(model).toObject(DtlEnvironmentList.class); - Assertions.assertEquals("fuzboyjathwtzolb", model.value().get(0).location()); - Assertions.assertEquals("wm", model.value().get(0).tags().get("xmeb")); - Assertions.assertEquals("rimrs", model.value().get(0).deploymentProperties().armTemplateId()); - Assertions.assertEquals("ecj", model.value().get(0).armTemplateDisplayName()); - Assertions.assertEquals("cgq", 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; + Assertions.assertEquals("hzvechndbnwieho", model.value().get(0).tags().get("ewjwiuubw")); + Assertions.assertEquals("qsfapaqt", model.value().get(0).location()); + Assertions.assertEquals("tutmzl", model.value().get(0).deploymentProperties().armTemplateId()); + Assertions.assertEquals("lvfhrbbp", model.value().get(0).armTemplateDisplayName()); + Assertions.assertEquals("zasqbucljgkyexao", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentDeploymentPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentDeploymentPropertiesTests.java index dd4ba61ce5b5..5ae60fedb3da 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentDeploymentPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentDeploymentPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,23 +14,22 @@ public final class EnvironmentDeploymentPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EnvironmentDeploymentProperties model = BinaryData.fromString( - "{\"armTemplateId\":\"ysux\",\"parameters\":[{\"name\":\"ntvlwijpsttexo\",\"value\":\"pwcyyufmhr\"},{\"name\":\"cuwmqsp\",\"value\":\"dqzh\"}]}") + "{\"armTemplateId\":\"v\",\"parameters\":[{\"name\":\"ey\",\"value\":\"onqzinkfkbgbzbow\"},{\"name\":\"qocl\",\"value\":\"ygvkzqkjj\"}]}") .toObject(EnvironmentDeploymentProperties.class); - Assertions.assertEquals("ysux", model.armTemplateId()); - Assertions.assertEquals("ntvlwijpsttexo", model.parameters().get(0).name()); - Assertions.assertEquals("pwcyyufmhr", model.parameters().get(0).value()); + Assertions.assertEquals("v", model.armTemplateId()); + Assertions.assertEquals("ey", model.parameters().get(0).name()); + Assertions.assertEquals("onqzinkfkbgbzbow", model.parameters().get(0).value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - EnvironmentDeploymentProperties model - = new EnvironmentDeploymentProperties().withArmTemplateId("ysux") - .withParameters(Arrays.asList( - new ArmTemplateParameterProperties().withName("ntvlwijpsttexo").withValue("pwcyyufmhr"), - new ArmTemplateParameterProperties().withName("cuwmqsp").withValue("dqzh"))); + EnvironmentDeploymentProperties model = new EnvironmentDeploymentProperties().withArmTemplateId("v") + .withParameters( + Arrays.asList(new ArmTemplateParameterProperties().withName("ey").withValue("onqzinkfkbgbzbow"), + new ArmTemplateParameterProperties().withName("qocl").withValue("ygvkzqkjj"))); model = BinaryData.fromObject(model).toObject(EnvironmentDeploymentProperties.class); - Assertions.assertEquals("ysux", model.armTemplateId()); - Assertions.assertEquals("ntvlwijpsttexo", model.parameters().get(0).name()); - Assertions.assertEquals("pwcyyufmhr", model.parameters().get(0).value()); + Assertions.assertEquals("v", model.armTemplateId()); + Assertions.assertEquals("ey", model.parameters().get(0).name()); + Assertions.assertEquals("onqzinkfkbgbzbow", model.parameters().get(0).value()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentPropertiesTests.java index 9389fe4f5adc..3a272db5a8d0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -15,28 +15,27 @@ public final class EnvironmentPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EnvironmentProperties model = BinaryData.fromString( - "{\"deploymentProperties\":{\"armTemplateId\":\"ldforobwj\",\"parameters\":[{\"name\":\"bfhfovvacqp\",\"value\":\"uodxesza\"},{\"name\":\"elawumu\",\"value\":\"lzkwrrwoy\"},{\"name\":\"ucwyhahno\",\"value\":\"rkywuhpsvfuu\"}]},\"armTemplateDisplayName\":\"tlwexxwlalniexz\",\"resourceGroupId\":\"zpgepqty\",\"createdByUser\":\"wwpgdakchzyvlixq\",\"provisioningState\":\"kcxk\",\"uniqueIdentifier\":\"bn\"}") + "{\"deploymentProperties\":{\"armTemplateId\":\"twypundmbxh\",\"parameters\":[{\"name\":\"jkavl\",\"value\":\"rb\"},{\"name\":\"tp\",\"value\":\"tzfjltf\"},{\"name\":\"zcyjtot\",\"value\":\"opv\"},{\"name\":\"dbzqgqqihed\",\"value\":\"qwthmky\"}]},\"armTemplateDisplayName\":\"cysihs\",\"resourceGroupId\":\"cw\",\"createdByUser\":\"ohsdtmcd\",\"provisioningState\":\"ufcohdxbz\",\"uniqueIdentifier\":\"cmuapcvhd\"}") .toObject(EnvironmentProperties.class); - Assertions.assertEquals("ldforobwj", model.deploymentProperties().armTemplateId()); - Assertions.assertEquals("bfhfovvacqp", model.deploymentProperties().parameters().get(0).name()); - Assertions.assertEquals("uodxesza", model.deploymentProperties().parameters().get(0).value()); - Assertions.assertEquals("tlwexxwlalniexz", model.armTemplateDisplayName()); + Assertions.assertEquals("twypundmbxh", model.deploymentProperties().armTemplateId()); + Assertions.assertEquals("jkavl", model.deploymentProperties().parameters().get(0).name()); + Assertions.assertEquals("rb", model.deploymentProperties().parameters().get(0).value()); + Assertions.assertEquals("cysihs", model.armTemplateDisplayName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - EnvironmentProperties model - = new EnvironmentProperties() - .withDeploymentProperties(new EnvironmentDeploymentProperties().withArmTemplateId("ldforobwj") - .withParameters(Arrays.asList( - new ArmTemplateParameterProperties().withName("bfhfovvacqp").withValue("uodxesza"), - new ArmTemplateParameterProperties().withName("elawumu").withValue("lzkwrrwoy"), - new ArmTemplateParameterProperties().withName("ucwyhahno").withValue("rkywuhpsvfuu")))) - .withArmTemplateDisplayName("tlwexxwlalniexz"); + EnvironmentProperties model = new EnvironmentProperties() + .withDeploymentProperties(new EnvironmentDeploymentProperties().withArmTemplateId("twypundmbxh") + .withParameters(Arrays.asList(new ArmTemplateParameterProperties().withName("jkavl").withValue("rb"), + new ArmTemplateParameterProperties().withName("tp").withValue("tzfjltf"), + new ArmTemplateParameterProperties().withName("zcyjtot").withValue("opv"), + new ArmTemplateParameterProperties().withName("dbzqgqqihed").withValue("qwthmky")))) + .withArmTemplateDisplayName("cysihs"); model = BinaryData.fromObject(model).toObject(EnvironmentProperties.class); - Assertions.assertEquals("ldforobwj", model.deploymentProperties().armTemplateId()); - Assertions.assertEquals("bfhfovvacqp", model.deploymentProperties().parameters().get(0).name()); - Assertions.assertEquals("uodxesza", model.deploymentProperties().parameters().get(0).value()); - Assertions.assertEquals("tlwexxwlalniexz", model.armTemplateDisplayName()); + Assertions.assertEquals("twypundmbxh", model.deploymentProperties().armTemplateId()); + Assertions.assertEquals("jkavl", model.deploymentProperties().parameters().get(0).name()); + Assertions.assertEquals("rb", model.deploymentProperties().parameters().get(0).value()); + Assertions.assertEquals("cysihs", model.armTemplateDisplayName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateMockTests.java index 49ea6c86cd98..ea0a983075cf 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ArmTemplateParameterProperties; @@ -26,34 +26,35 @@ public final class EnvironmentsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"deploymentProperties\":{\"armTemplateId\":\"jguwrjmwvv\",\"parameters\":[{\"name\":\"kxxi\",\"value\":\"gxql\"},{\"name\":\"k\",\"value\":\"jgxieqfkyfh\"},{\"name\":\"vjaqu\",\"value\":\"yynvskpa\"},{\"name\":\"mgeu\",\"value\":\"xmjbxcbccwkqmtxa\"}]},\"armTemplateDisplayName\":\"qis\",\"resourceGroupId\":\"p\",\"createdByUser\":\"gftrqrejdaahuqim\",\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"snc\"},\"location\":\"kiioshj\",\"tags\":{\"cg\":\"etybnxgzt\",\"j\":\"tjchfjvmy\"},\"id\":\"ebecuvlbefv\",\"name\":\"cljkxpyl\",\"type\":\"woxzgwpsyxji\"}"; + = "{\"properties\":{\"deploymentProperties\":{\"armTemplateId\":\"hbafebzx\",\"parameters\":[{\"name\":\"utibhlen\",\"value\":\"rvrk\"}]},\"armTemplateDisplayName\":\"abdu\",\"resourceGroupId\":\"zmlghny\",\"createdByUser\":\"lpyeu\",\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"ixqbolxvhhyqqeg\"},\"tags\":{\"xch\":\"grznmginmtsd\",\"jca\":\"kibmgjymn\"},\"location\":\"irwcqzoofjnqjsv\",\"id\":\"fbhtleberp\",\"name\":\"ljekn\",\"type\":\"qnwjjq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); - DtlEnvironment response = manager.environments() - .define("ky") - .withRegion("syjprxslwhdmcvh") - .withExistingUser("ixv", "lwynpbbfqvzfj", "spugzfeuzjljmph") - .withTags(mapOf("zgihotje", "zjhfvhuwzbxpc", "bxwie", "ohmxvvlrrska", "derltfokyksyim", "xuy")) - .withDeploymentProperties(new EnvironmentDeploymentProperties().withArmTemplateId("lgjzmi") - .withParameters(Arrays.asList(new ArmTemplateParameterProperties().withName("oc").withValue("xshanzb"), - new ArmTemplateParameterProperties().withName("adh").withValue("tecaa"), - new ArmTemplateParameterProperties().withName("dohzniucbdaombwi").withValue("jdllwktle"), - new ArmTemplateParameterProperties().withName("wavvqxuajgcqwuly").withValue("gfcfdruwsik")))) - .withArmTemplateDisplayName("tclhuulriqbyokv") - .create(); + DtlEnvironment response + = manager.environments() + .define("uhqvums") + .withExistingUser("pwbmwhria", "iwrycgnwplrrb", "hctsbbibti") + .withRegion("probzzxezmnrkjgp") + .withTags(mapOf("jmoywlunpipcwybs", "xrezsvavlrxi", "atpf", "fncn", "zwuge", "saebwfwhxorpwal", + "vazjpwexcd", "ojfccylhtrht")) + .withDeploymentProperties( + new EnvironmentDeploymentProperties().withArmTemplateId("sfeqbbe") + .withParameters(Arrays + .asList(new ArmTemplateParameterProperties().withName("qfpyyxmzrmt").withValue("wi")))) + .withArmTemplateDisplayName("we") + .create(); - Assertions.assertEquals("kiioshj", response.location()); - Assertions.assertEquals("etybnxgzt", response.tags().get("cg")); - Assertions.assertEquals("jguwrjmwvv", response.deploymentProperties().armTemplateId()); - Assertions.assertEquals("kxxi", response.deploymentProperties().parameters().get(0).name()); - Assertions.assertEquals("gxql", response.deploymentProperties().parameters().get(0).value()); - Assertions.assertEquals("qis", response.armTemplateDisplayName()); + Assertions.assertEquals("grznmginmtsd", response.tags().get("xch")); + Assertions.assertEquals("irwcqzoofjnqjsv", response.location()); + Assertions.assertEquals("hbafebzx", response.deploymentProperties().armTemplateId()); + Assertions.assertEquals("utibhlen", response.deploymentProperties().parameters().get(0).name()); + Assertions.assertEquals("rvrk", response.deploymentProperties().parameters().get(0).value()); + Assertions.assertEquals("abdu", response.armTemplateDisplayName()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteMockTests.java index e42eaeb938a1..0265fa53c967 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.environments().delete("pg", "ttbas", "alapdlndbe", "qb", com.azure.core.util.Context.NONE); + manager.environments().delete("zlhhfix", "cfculzj", "mhpfywvy", "dqpz", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetWithResponseMockTests.java index 13fbc10cbe05..e4f5395232bf 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.DtlEnvironment; @@ -21,25 +21,25 @@ public final class EnvironmentsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"deploymentProperties\":{\"armTemplateId\":\"kykipfsdyepfnoc\",\"parameters\":[{\"name\":\"acfpztgazwyqej\",\"value\":\"aokctgkp\"},{\"name\":\"kqzkcyzmff\",\"value\":\"dyfcix\"},{\"name\":\"lcqvhoejgoiutgw\",\"value\":\"kahpqhazynta\"}]},\"armTemplateDisplayName\":\"hncogmipnml\",\"resourceGroupId\":\"mvlbhikeaqgrv\",\"createdByUser\":\"omxp\",\"provisioningState\":\"dtsdfjy\",\"uniqueIdentifier\":\"socwiqbuout\"},\"location\":\"py\",\"tags\":{\"gbww\":\"eofjs\",\"cf\":\"vdajfwn\"},\"id\":\"aciq\",\"name\":\"jjrlhiqlwix\",\"type\":\"tbouguxtnd\"}"; + = "{\"properties\":{\"deploymentProperties\":{\"armTemplateId\":\"xzuisamona\",\"parameters\":[{\"name\":\"exroqsqjghrmth\",\"value\":\"lwsttxsrgxfqpan\"},{\"name\":\"eovxgzwhsxyru\",\"value\":\"tikesl\"},{\"name\":\"yohzixyq\",\"value\":\"nkvycqqqdseipnqu\"}]},\"armTemplateDisplayName\":\"xhrptyodlh\",\"resourceGroupId\":\"ktltddsobjopnouh\",\"createdByUser\":\"ezkqxsalu\",\"provisioningState\":\"igfcvcewbwqhd\",\"uniqueIdentifier\":\"jsatm\"},\"tags\":{\"qmr\":\"mazdfsqxh\"},\"location\":\"parn\",\"id\":\"grszrbwtdrcwg\",\"name\":\"w\",\"type\":\"l\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); DtlEnvironment response = manager.environments() - .getWithResponse("vdgxly", "kxitds", "ezsvkolrupjov", "ozsaye", "razwzlpzbt", + .getWithResponse("jsumxpezcoio", "jrmfqzwqd", "xkeedcnwmy", "xfqzkvemyzd", "czaqpqifdbmpt", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("py", response.location()); - Assertions.assertEquals("eofjs", response.tags().get("gbww")); - Assertions.assertEquals("kykipfsdyepfnoc", response.deploymentProperties().armTemplateId()); - Assertions.assertEquals("acfpztgazwyqej", response.deploymentProperties().parameters().get(0).name()); - Assertions.assertEquals("aokctgkp", response.deploymentProperties().parameters().get(0).value()); - Assertions.assertEquals("hncogmipnml", response.armTemplateDisplayName()); + Assertions.assertEquals("mazdfsqxh", response.tags().get("qmr")); + Assertions.assertEquals("parn", response.location()); + Assertions.assertEquals("xzuisamona", response.deploymentProperties().armTemplateId()); + Assertions.assertEquals("exroqsqjghrmth", response.deploymentProperties().parameters().get(0).name()); + Assertions.assertEquals("lwsttxsrgxfqpan", response.deploymentProperties().parameters().get(0).value()); + Assertions.assertEquals("xhrptyodlh", response.armTemplateDisplayName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListMockTests.java index 8ace7922b0b6..ae97c0f0c077 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.DtlEnvironment; @@ -22,25 +22,24 @@ public final class EnvironmentsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"deploymentProperties\":{\"armTemplateId\":\"cvgllixdg\",\"parameters\":[{\"name\":\"wewqkj\",\"value\":\"prwpxsoohu\"}]},\"armTemplateDisplayName\":\"lcsklt\",\"resourceGroupId\":\"uugggzlfbgrd\",\"createdByUser\":\"ubsrtmdylperpilt\",\"provisioningState\":\"zgczfcmfpfbode\",\"uniqueIdentifier\":\"esrgvtshuvftwai\"},\"location\":\"muqkevzgjypanhx\",\"tags\":{\"kf\":\"xxzetwwzjwotnx\",\"qwec\":\"glhrfo\",\"vppqi\":\"snhpcselqx\",\"l\":\"ukklvzrlr\"},\"id\":\"cme\",\"name\":\"jsczivfqbqnasdsy\",\"type\":\"nzsieuscplh\"}]}"; + = "{\"value\":[{\"properties\":{\"deploymentProperties\":{\"armTemplateId\":\"lleynqanhk\",\"parameters\":[{\"name\":\"clwa\",\"value\":\"v\"},{\"name\":\"hg\",\"value\":\"hetxdqcmyctajqz\"}]},\"armTemplateDisplayName\":\"alec\",\"resourceGroupId\":\"ibiwksdegyxsb\",\"createdByUser\":\"zvoikvntwczf\",\"provisioningState\":\"ushlcxpblalh\",\"uniqueIdentifier\":\"zpfkis\"},\"tags\":{\"otxjqfiafcnlrtbf\":\"dqzsaaoqdsgp\",\"ijolbuauktwieope\":\"jzzca\",\"xq\":\"e\",\"bkgx\":\"wrswyiljp\"},\"location\":\"yauxr\",\"id\":\"do\",\"name\":\"mcnltmwytkujsqyc\",\"type\":\"moxfablq\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.environments() - .list("jvavdpwwo", "tdp", "titsf", "ofw", "nmhkscauwaz", 603038180, "wdfriwgybjpoz", + .list("zx", "oxinunjlzkdr", "cqsxytqqtcmiw", "w", "svnmeylajamcajy", 1557968922, "tpzcr", com.azure.core.util.Context.NONE); - Assertions.assertEquals("muqkevzgjypanhx", response.iterator().next().location()); - Assertions.assertEquals("xxzetwwzjwotnx", response.iterator().next().tags().get("kf")); - Assertions.assertEquals("cvgllixdg", response.iterator().next().deploymentProperties().armTemplateId()); - Assertions.assertEquals("wewqkj", response.iterator().next().deploymentProperties().parameters().get(0).name()); - Assertions.assertEquals("prwpxsoohu", - response.iterator().next().deploymentProperties().parameters().get(0).value()); - Assertions.assertEquals("lcsklt", response.iterator().next().armTemplateDisplayName()); + Assertions.assertEquals("dqzsaaoqdsgp", response.iterator().next().tags().get("otxjqfiafcnlrtbf")); + Assertions.assertEquals("yauxr", response.iterator().next().location()); + Assertions.assertEquals("lleynqanhk", response.iterator().next().deploymentProperties().armTemplateId()); + Assertions.assertEquals("clwa", response.iterator().next().deploymentProperties().parameters().get(0).name()); + Assertions.assertEquals("v", response.iterator().next().deploymentProperties().parameters().get(0).value()); + Assertions.assertEquals("alec", response.iterator().next().armTemplateDisplayName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EvaluatePoliciesPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EvaluatePoliciesPropertiesTests.java index 5fbfe17be45e..0154f12c76d6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EvaluatePoliciesPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EvaluatePoliciesPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,24 +12,24 @@ public final class EvaluatePoliciesPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EvaluatePoliciesProperties model = BinaryData.fromString( - "{\"factName\":\"gsj\",\"factData\":\"nwqjnoba\",\"valueOffset\":\"hdd\",\"userObjectId\":\"acegfnmntf\"}") + "{\"factName\":\"akjsqz\",\"factData\":\"bezkgimsidxasic\",\"valueOffset\":\"yvvjskgfmo\",\"userObjectId\":\"ah\"}") .toObject(EvaluatePoliciesProperties.class); - Assertions.assertEquals("gsj", model.factName()); - Assertions.assertEquals("nwqjnoba", model.factData()); - Assertions.assertEquals("hdd", model.valueOffset()); - Assertions.assertEquals("acegfnmntf", model.userObjectId()); + Assertions.assertEquals("akjsqz", model.factName()); + Assertions.assertEquals("bezkgimsidxasic", model.factData()); + Assertions.assertEquals("yvvjskgfmo", model.valueOffset()); + Assertions.assertEquals("ah", model.userObjectId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - EvaluatePoliciesProperties model = new EvaluatePoliciesProperties().withFactName("gsj") - .withFactData("nwqjnoba") - .withValueOffset("hdd") - .withUserObjectId("acegfnmntf"); + EvaluatePoliciesProperties model = new EvaluatePoliciesProperties().withFactName("akjsqz") + .withFactData("bezkgimsidxasic") + .withValueOffset("yvvjskgfmo") + .withUserObjectId("ah"); model = BinaryData.fromObject(model).toObject(EvaluatePoliciesProperties.class); - Assertions.assertEquals("gsj", model.factName()); - Assertions.assertEquals("nwqjnoba", model.factData()); - Assertions.assertEquals("hdd", model.valueOffset()); - Assertions.assertEquals("acegfnmntf", model.userObjectId()); + Assertions.assertEquals("akjsqz", model.factName()); + Assertions.assertEquals("bezkgimsidxasic", model.factData()); + Assertions.assertEquals("yvvjskgfmo", model.valueOffset()); + Assertions.assertEquals("ah", model.userObjectId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EvaluatePoliciesRequestTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EvaluatePoliciesRequestTests.java index d8a9e005006c..be496fdbbc6b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EvaluatePoliciesRequestTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EvaluatePoliciesRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,29 +14,25 @@ public final class EvaluatePoliciesRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EvaluatePoliciesRequest model = BinaryData.fromString( - "{\"policies\":[{\"factName\":\"lmywwtkgkxnyed\",\"factData\":\"gyvudtjuewbc\",\"valueOffset\":\"xuuwhcj\",\"userObjectId\":\"ccybvp\"},{\"factName\":\"akkud\",\"factData\":\"xgwjplmagstcyoh\",\"valueOffset\":\"kyrk\",\"userObjectId\":\"dg\"}]}") + "{\"policies\":[{\"factName\":\"cealzxwh\",\"factData\":\"nsymoyqhlwigd\",\"valueOffset\":\"bkbxgomfa\",\"userObjectId\":\"wasqvdaeyyg\"}]}") .toObject(EvaluatePoliciesRequest.class); - Assertions.assertEquals("lmywwtkgkxnyed", model.policies().get(0).factName()); - Assertions.assertEquals("gyvudtjuewbc", model.policies().get(0).factData()); - Assertions.assertEquals("xuuwhcj", model.policies().get(0).valueOffset()); - Assertions.assertEquals("ccybvp", model.policies().get(0).userObjectId()); + Assertions.assertEquals("cealzxwh", model.policies().get(0).factName()); + Assertions.assertEquals("nsymoyqhlwigd", model.policies().get(0).factData()); + Assertions.assertEquals("bkbxgomfa", model.policies().get(0).valueOffset()); + Assertions.assertEquals("wasqvdaeyyg", model.policies().get(0).userObjectId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - EvaluatePoliciesRequest model = new EvaluatePoliciesRequest().withPolicies(Arrays.asList( - new EvaluatePoliciesProperties().withFactName("lmywwtkgkxnyed") - .withFactData("gyvudtjuewbc") - .withValueOffset("xuuwhcj") - .withUserObjectId("ccybvp"), - new EvaluatePoliciesProperties().withFactName("akkud") - .withFactData("xgwjplmagstcyoh") - .withValueOffset("kyrk") - .withUserObjectId("dg"))); + EvaluatePoliciesRequest model = new EvaluatePoliciesRequest() + .withPolicies(Arrays.asList(new EvaluatePoliciesProperties().withFactName("cealzxwh") + .withFactData("nsymoyqhlwigd") + .withValueOffset("bkbxgomfa") + .withUserObjectId("wasqvdaeyyg"))); model = BinaryData.fromObject(model).toObject(EvaluatePoliciesRequest.class); - Assertions.assertEquals("lmywwtkgkxnyed", model.policies().get(0).factName()); - Assertions.assertEquals("gyvudtjuewbc", model.policies().get(0).factData()); - Assertions.assertEquals("xuuwhcj", model.policies().get(0).valueOffset()); - Assertions.assertEquals("ccybvp", model.policies().get(0).userObjectId()); + Assertions.assertEquals("cealzxwh", model.policies().get(0).factName()); + Assertions.assertEquals("nsymoyqhlwigd", model.policies().get(0).factData()); + Assertions.assertEquals("bkbxgomfa", model.policies().get(0).valueOffset()); + Assertions.assertEquals("wasqvdaeyyg", model.policies().get(0).userObjectId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EventTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EventTests.java index 6937dc8cd3c1..728ce483e62c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EventTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/EventTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,14 +12,14 @@ public final class EventTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Event model = BinaryData.fromString("{\"eventName\":\"Cost\"}").toObject(Event.class); - Assertions.assertEquals(NotificationChannelEventType.COST, model.eventName()); + Event model = BinaryData.fromString("{\"eventName\":\"AutoShutdown\"}").toObject(Event.class); + Assertions.assertEquals(NotificationChannelEventType.AUTO_SHUTDOWN, model.eventName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Event model = new Event().withEventName(NotificationChannelEventType.COST); + Event model = new Event().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN); model = BinaryData.fromObject(model).toObject(Event.class); - Assertions.assertEquals(NotificationChannelEventType.COST, model.eventName()); + Assertions.assertEquals(NotificationChannelEventType.AUTO_SHUTDOWN, model.eventName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ExportResourceUsageParametersTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ExportResourceUsageParametersTests.java index 8fdab0766fee..e751daaed90c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ExportResourceUsageParametersTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ExportResourceUsageParametersTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,18 +13,20 @@ public final class ExportResourceUsageParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExportResourceUsageParameters model = BinaryData - .fromString("{\"blobStorageAbsoluteSasUri\":\"pyqy\",\"usageStartDate\":\"2021-06-06T02:59:57Z\"}") + .fromString( + "{\"blobStorageAbsoluteSasUri\":\"hzdobpxjmflbvvnc\",\"usageStartDate\":\"2021-05-23T11:48:05Z\"}") .toObject(ExportResourceUsageParameters.class); - Assertions.assertEquals("pyqy", model.blobStorageAbsoluteSasUri()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-06T02:59:57Z"), model.usageStartDate()); + Assertions.assertEquals("hzdobpxjmflbvvnc", model.blobStorageAbsoluteSasUri()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T11:48:05Z"), model.usageStartDate()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ExportResourceUsageParameters model = new ExportResourceUsageParameters().withBlobStorageAbsoluteSasUri("pyqy") - .withUsageStartDate(OffsetDateTime.parse("2021-06-06T02:59:57Z")); + ExportResourceUsageParameters model + = new ExportResourceUsageParameters().withBlobStorageAbsoluteSasUri("hzdobpxjmflbvvnc") + .withUsageStartDate(OffsetDateTime.parse("2021-05-23T11:48:05Z")); model = BinaryData.fromObject(model).toObject(ExportResourceUsageParameters.class); - Assertions.assertEquals("pyqy", model.blobStorageAbsoluteSasUri()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-06T02:59:57Z"), model.usageStartDate()); + Assertions.assertEquals("hzdobpxjmflbvvnc", model.blobStorageAbsoluteSasUri()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T11:48:05Z"), model.usageStartDate()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ExternalSubnetTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ExternalSubnetTests.java index 0633db9e8af4..bae135832cae 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ExternalSubnetTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ExternalSubnetTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,16 +12,8 @@ public final class ExternalSubnetTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExternalSubnet model - = BinaryData.fromString("{\"id\":\"c\",\"name\":\"nbkkjanurnnq\"}").toObject(ExternalSubnet.class); - Assertions.assertEquals("c", model.id()); - Assertions.assertEquals("nbkkjanurnnq", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalSubnet model = new ExternalSubnet().withId("c").withName("nbkkjanurnnq"); - model = BinaryData.fromObject(model).toObject(ExternalSubnet.class); - Assertions.assertEquals("c", model.id()); - Assertions.assertEquals("nbkkjanurnnq", model.name()); + = BinaryData.fromString("{\"id\":\"jhzn\",\"name\":\"tuatmzwcj\"}").toObject(ExternalSubnet.class); + Assertions.assertEquals("jhzn", model.id()); + Assertions.assertEquals("tuatmzwcj", model.name()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/FormulaFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/FormulaFragmentTests.java index d4b4624f77a3..b390f0c97611 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/FormulaFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/FormulaFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,16 +13,16 @@ public final class FormulaFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - FormulaFragment model = BinaryData.fromString("{\"tags\":{\"ronasxift\":\"atiz\",\"zh\":\"zq\"}}") + FormulaFragment model = BinaryData.fromString("{\"tags\":{\"stvdxeclz\":\"tgk\",\"kdl\":\"dqbcvhzlhplod\"}}") .toObject(FormulaFragment.class); - Assertions.assertEquals("atiz", model.tags().get("ronasxift")); + Assertions.assertEquals("tgk", model.tags().get("stvdxeclz")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FormulaFragment model = new FormulaFragment().withTags(mapOf("ronasxift", "atiz", "zh", "zq")); + FormulaFragment model = new FormulaFragment().withTags(mapOf("stvdxeclz", "tgk", "kdl", "dqbcvhzlhplod")); model = BinaryData.fromObject(model).toObject(FormulaFragment.class); - Assertions.assertEquals("atiz", model.tags().get("ronasxift")); + Assertions.assertEquals("tgk", model.tags().get("stvdxeclz")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/FormulaPropertiesFromVmTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/FormulaPropertiesFromVmTests.java index ccf51bd89a45..01242433d3bb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/FormulaPropertiesFromVmTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/FormulaPropertiesFromVmTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,14 +12,14 @@ public final class FormulaPropertiesFromVmTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FormulaPropertiesFromVm model - = BinaryData.fromString("{\"labVmId\":\"ijnkrxfrdd\"}").toObject(FormulaPropertiesFromVm.class); - Assertions.assertEquals("ijnkrxfrdd", model.labVmId()); + = BinaryData.fromString("{\"labVmId\":\"zibt\"}").toObject(FormulaPropertiesFromVm.class); + Assertions.assertEquals("zibt", model.labVmId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FormulaPropertiesFromVm model = new FormulaPropertiesFromVm().withLabVmId("ijnkrxfrdd"); + FormulaPropertiesFromVm model = new FormulaPropertiesFromVm().withLabVmId("zibt"); model = BinaryData.fromObject(model).toObject(FormulaPropertiesFromVm.class); - Assertions.assertEquals("ijnkrxfrdd", model.labVmId()); + Assertions.assertEquals("zibt", model.labVmId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteWithResponseMockTests.java index d23f5ff2bddd..e5fdf6b82564 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDeleteWithResponse() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.formulas().deleteWithResponse("ke", "sm", "p", com.azure.core.util.Context.NONE); + manager.formulas() + .deleteWithResponse("whdmcvhtbbz", "hfvhuwzbxpcqz", "ihotjecohmxv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImageInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImageInnerTests.java index a5a4dc7c00b7..2d6ee19a07c8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImageInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImageInnerTests.java @@ -1,77 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.devtestlabs.fluent.models.GalleryImageInner; -import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class GalleryImageInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GalleryImageInner model = BinaryData.fromString( - "{\"properties\":{\"author\":\"jmsvpkjp\",\"createdDate\":\"2021-09-03T19:15:23Z\",\"description\":\"cfzq\",\"imageReference\":{\"offer\":\"x\",\"publisher\":\"czheyd\",\"sku\":\"dshmkxmaehvbbx\",\"osType\":\"iplt\",\"version\":\"htba\"},\"icon\":\"gx\",\"enabled\":false,\"planId\":\"kpyklyhp\",\"isPlanAuthorized\":true},\"location\":\"dpvruud\",\"tags\":{\"eclze\":\"ibthostgktstvd\"},\"id\":\"qbcvhzlhplod\",\"name\":\"kdl\",\"type\":\"wqfbumlkxtrqjfsm\"}") + "{\"properties\":{\"author\":\"bfhjxakvvjgsl\",\"createdDate\":\"2021-09-04T03:37:27Z\",\"description\":\"lmywwtkgkxnyed\",\"imageReference\":{\"offer\":\"yvudtjuewbci\",\"publisher\":\"uuwhcjyxcc\",\"sku\":\"vpayakkudzpx\",\"osType\":\"jplmagstcy\",\"version\":\"pfkyrkdbdgiogsj\"},\"icon\":\"nwqjnoba\",\"enabled\":false,\"planId\":\"d\",\"isPlanAuthorized\":true},\"tags\":{\"dwvvba\":\"gfnmntfpmvmemfnc\",\"db\":\"xlllchp\",\"vsjcswsmystuluqy\":\"evwrdnhfuk\",\"qbmfpjbabwidf\":\"fcvlerch\"},\"location\":\"sspuunnoxyhkx\",\"id\":\"ddrihpf\",\"name\":\"oqcaaewdaomdj\",\"type\":\"l\"}") .toObject(GalleryImageInner.class); - Assertions.assertEquals("dpvruud", model.location()); - Assertions.assertEquals("ibthostgktstvd", model.tags().get("eclze")); - Assertions.assertEquals("jmsvpkjp", model.author()); - Assertions.assertEquals("cfzq", model.description()); - Assertions.assertEquals("x", model.imageReference().offer()); - Assertions.assertEquals("czheyd", model.imageReference().publisher()); - Assertions.assertEquals("dshmkxmaehvbbx", model.imageReference().sku()); - Assertions.assertEquals("iplt", model.imageReference().osType()); - Assertions.assertEquals("htba", model.imageReference().version()); - Assertions.assertEquals("gx", model.icon()); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("kpyklyhp", model.planId()); - Assertions.assertEquals(true, model.isPlanAuthorized()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryImageInner model = new GalleryImageInner().withLocation("dpvruud") - .withTags(mapOf("eclze", "ibthostgktstvd")) - .withAuthor("jmsvpkjp") - .withDescription("cfzq") - .withImageReference(new GalleryImageReference().withOffer("x") - .withPublisher("czheyd") - .withSku("dshmkxmaehvbbx") - .withOsType("iplt") - .withVersion("htba")) - .withIcon("gx") - .withEnabled(false) - .withPlanId("kpyklyhp") - .withIsPlanAuthorized(true); - model = BinaryData.fromObject(model).toObject(GalleryImageInner.class); - Assertions.assertEquals("dpvruud", model.location()); - Assertions.assertEquals("ibthostgktstvd", model.tags().get("eclze")); - Assertions.assertEquals("jmsvpkjp", model.author()); - Assertions.assertEquals("cfzq", model.description()); - Assertions.assertEquals("x", model.imageReference().offer()); - Assertions.assertEquals("czheyd", model.imageReference().publisher()); - Assertions.assertEquals("dshmkxmaehvbbx", model.imageReference().sku()); - Assertions.assertEquals("iplt", model.imageReference().osType()); - Assertions.assertEquals("htba", model.imageReference().version()); - Assertions.assertEquals("gx", model.icon()); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("kpyklyhp", model.planId()); - Assertions.assertEquals(true, model.isPlanAuthorized()); - } - - // 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; + Assertions.assertEquals("gfnmntfpmvmemfnc", model.tags().get("dwvvba")); + Assertions.assertEquals("sspuunnoxyhkx", model.location()); + Assertions.assertEquals("bfhjxakvvjgsl", model.author()); + Assertions.assertEquals("lmywwtkgkxnyed", model.description()); + Assertions.assertEquals("yvudtjuewbci", model.imageReference().offer()); + Assertions.assertEquals("uuwhcjyxcc", model.imageReference().publisher()); + Assertions.assertEquals("vpayakkudzpx", model.imageReference().sku()); + Assertions.assertEquals("jplmagstcy", model.imageReference().osType()); + Assertions.assertEquals("pfkyrkdbdgiogsj", model.imageReference().version()); + Assertions.assertEquals("nwqjnoba", model.icon()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("d", model.planId()); + Assertions.assertTrue(model.isPlanAuthorized()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImageListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImageListTests.java index 3eb58527c142..1cb8554f29d9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImageListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImageListTests.java @@ -1,109 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.GalleryImageInner; -import com.azure.resourcemanager.devtestlabs.models.GalleryImageList; -import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.devtestlabs.implementation.models.GalleryImageList; import org.junit.jupiter.api.Assertions; public final class GalleryImageListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GalleryImageList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"author\":\"sgogczhonnxk\",\"createdDate\":\"2020-12-28T18:29:51Z\",\"description\":\"yhmossxkkg\",\"imageReference\":{\"offer\":\"rghxjb\",\"publisher\":\"qxvcxgfrpdsofb\",\"sku\":\"rnsvbuswd\",\"osType\":\"yybyc\",\"version\":\"nvjsrtkfa\"},\"icon\":\"opqgikyzirtxdyux\",\"enabled\":true,\"planId\":\"tpsew\",\"isPlanAuthorized\":false},\"location\":\"ilqu\",\"tags\":{\"ggufhyaomtb\":\"dxtqmieoxo\",\"pjbi\":\"hhavgrvkffovjz\"},\"id\":\"gjmfxumvfcl\",\"name\":\"yo\",\"type\":\"wxnb\"},{\"properties\":{\"author\":\"ezzxscyhwzdgiruj\",\"createdDate\":\"2021-05-23T20:25:15Z\",\"description\":\"mvzzbtdcqvp\",\"imageReference\":{\"offer\":\"ujviylwdshfs\",\"publisher\":\"rbgyefry\",\"sku\":\"gaojf\",\"osType\":\"nc\",\"version\":\"mrfhirctymox\"},\"icon\":\"tpipiwyczuhx\",\"enabled\":true,\"planId\":\"jlihhyus\",\"isPlanAuthorized\":false},\"location\":\"asdvl\",\"tags\":{\"uzvx\":\"dgzxulucvpamrsr\",\"xmrhu\":\"risjnhnytxifqjz\",\"cesutrgjupauut\":\"lw\"},\"id\":\"woqhihe\",\"name\":\"qg\",\"type\":\"zpnfqntcypsxj\"},{\"properties\":{\"author\":\"oimwkslirc\",\"createdDate\":\"2021-07-08T14:21:01Z\",\"description\":\"vydfceacvlhvygdy\",\"imageReference\":{\"offer\":\"mrtwna\",\"publisher\":\"slbi\",\"sku\":\"ojgcyzt\",\"osType\":\"mznbaeqphch\",\"version\":\"rn\"},\"icon\":\"x\",\"enabled\":true,\"planId\":\"rykqgaifmvikl\",\"isPlanAuthorized\":false},\"location\":\"vkhbejdznx\",\"tags\":{\"v\":\"srhnjivo\",\"jdftuljltd\":\"novqfzge\"},\"id\":\"ceamtm\",\"name\":\"zuo\",\"type\":\"ejwcwwqiok\"}],\"nextLink\":\"sx\"}") + "{\"value\":[{\"properties\":{\"author\":\"wr\",\"createdDate\":\"2021-03-14T01:37:10Z\",\"description\":\"agohbuff\",\"imageReference\":{\"offer\":\"qem\",\"publisher\":\"hmxtdr\",\"sku\":\"utacoe\",\"osType\":\"vewzcj\",\"version\":\"m\"},\"icon\":\"pmguaadraufac\",\"enabled\":true,\"planId\":\"zov\",\"isPlanAuthorized\":false},\"tags\":{\"kulfg\":\"uxxpshne\",\"d\":\"lqubkwdlen\",\"pjuohminyfl\":\"utujba\",\"w\":\"orwmduvwpklv\"},\"location\":\"gdxpg\",\"id\":\"chisze\",\"name\":\"nnbj\",\"type\":\"rxgibbd\"},{\"properties\":{\"author\":\"confozauors\",\"createdDate\":\"2021-10-18T05:02:18Z\",\"description\":\"wbqpl\",\"imageReference\":{\"offer\":\"nuuepzlrp\",\"publisher\":\"zsoldwey\",\"sku\":\"dunvmnnrwrbiorkt\",\"osType\":\"ywjhhgdnhx\",\"version\":\"ivfomiloxgg\"},\"icon\":\"fi\",\"enabled\":true,\"planId\":\"euzaof\",\"isPlanAuthorized\":true},\"tags\":{\"p\":\"yyysfgdotcubi\",\"izsh\":\"ipwoqonmacjek\",\"gmblrri\":\"vcimpev\"},\"location\":\"ywdxsmic\",\"id\":\"rwfscjfnynszquj\",\"name\":\"zdvoqytibyowbb\",\"type\":\"gyavu\"},{\"properties\":{\"author\":\"thjoxoism\",\"createdDate\":\"2021-09-03T17:34:04Z\",\"description\":\"pi\",\"imageReference\":{\"offer\":\"oljxkcgx\",\"publisher\":\"xsffgcviz\",\"sku\":\"dwl\",\"osType\":\"lyoupfgfbkju\",\"version\":\"yhgk\"},\"icon\":\"in\",\"enabled\":true,\"planId\":\"zfttsttktlahb\",\"isPlanAuthorized\":true},\"tags\":{\"qqqxhrnxrx\":\"tgzukxitmmqt\",\"av\":\"pjui\",\"dzf\":\"k\",\"atnwxyiopi\":\"azivjlfrqttbajl\"},\"location\":\"qqfkuv\",\"id\":\"xkdmligo\",\"name\":\"ibrxkp\",\"type\":\"loazuruocbgoo\"}],\"nextLink\":\"te\"}") .toObject(GalleryImageList.class); - Assertions.assertEquals("ilqu", model.value().get(0).location()); - Assertions.assertEquals("dxtqmieoxo", model.value().get(0).tags().get("ggufhyaomtb")); - Assertions.assertEquals("sgogczhonnxk", model.value().get(0).author()); - Assertions.assertEquals("yhmossxkkg", model.value().get(0).description()); - Assertions.assertEquals("rghxjb", model.value().get(0).imageReference().offer()); - Assertions.assertEquals("qxvcxgfrpdsofb", model.value().get(0).imageReference().publisher()); - Assertions.assertEquals("rnsvbuswd", model.value().get(0).imageReference().sku()); - Assertions.assertEquals("yybyc", model.value().get(0).imageReference().osType()); - Assertions.assertEquals("nvjsrtkfa", model.value().get(0).imageReference().version()); - Assertions.assertEquals("opqgikyzirtxdyux", model.value().get(0).icon()); - Assertions.assertEquals(true, model.value().get(0).enabled()); - Assertions.assertEquals("tpsew", model.value().get(0).planId()); - Assertions.assertEquals(false, model.value().get(0).isPlanAuthorized()); - Assertions.assertEquals("sx", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryImageList model = new GalleryImageList().withValue(Arrays.asList( - new GalleryImageInner().withLocation("ilqu") - .withTags(mapOf("ggufhyaomtb", "dxtqmieoxo", "pjbi", "hhavgrvkffovjz")) - .withAuthor("sgogczhonnxk") - .withDescription("yhmossxkkg") - .withImageReference(new GalleryImageReference().withOffer("rghxjb") - .withPublisher("qxvcxgfrpdsofb") - .withSku("rnsvbuswd") - .withOsType("yybyc") - .withVersion("nvjsrtkfa")) - .withIcon("opqgikyzirtxdyux") - .withEnabled(true) - .withPlanId("tpsew") - .withIsPlanAuthorized(false), - new GalleryImageInner().withLocation("asdvl") - .withTags(mapOf("uzvx", "dgzxulucvpamrsr", "xmrhu", "risjnhnytxifqjz", "cesutrgjupauut", "lw")) - .withAuthor("ezzxscyhwzdgiruj") - .withDescription("mvzzbtdcqvp") - .withImageReference(new GalleryImageReference().withOffer("ujviylwdshfs") - .withPublisher("rbgyefry") - .withSku("gaojf") - .withOsType("nc") - .withVersion("mrfhirctymox")) - .withIcon("tpipiwyczuhx") - .withEnabled(true) - .withPlanId("jlihhyus") - .withIsPlanAuthorized(false), - new GalleryImageInner().withLocation("vkhbejdznx") - .withTags(mapOf("v", "srhnjivo", "jdftuljltd", "novqfzge")) - .withAuthor("oimwkslirc") - .withDescription("vydfceacvlhvygdy") - .withImageReference(new GalleryImageReference().withOffer("mrtwna") - .withPublisher("slbi") - .withSku("ojgcyzt") - .withOsType("mznbaeqphch") - .withVersion("rn")) - .withIcon("x") - .withEnabled(true) - .withPlanId("rykqgaifmvikl") - .withIsPlanAuthorized(false))) - .withNextLink("sx"); - model = BinaryData.fromObject(model).toObject(GalleryImageList.class); - Assertions.assertEquals("ilqu", model.value().get(0).location()); - Assertions.assertEquals("dxtqmieoxo", model.value().get(0).tags().get("ggufhyaomtb")); - Assertions.assertEquals("sgogczhonnxk", model.value().get(0).author()); - Assertions.assertEquals("yhmossxkkg", model.value().get(0).description()); - Assertions.assertEquals("rghxjb", model.value().get(0).imageReference().offer()); - Assertions.assertEquals("qxvcxgfrpdsofb", model.value().get(0).imageReference().publisher()); - Assertions.assertEquals("rnsvbuswd", model.value().get(0).imageReference().sku()); - Assertions.assertEquals("yybyc", model.value().get(0).imageReference().osType()); - Assertions.assertEquals("nvjsrtkfa", model.value().get(0).imageReference().version()); - Assertions.assertEquals("opqgikyzirtxdyux", model.value().get(0).icon()); - Assertions.assertEquals(true, model.value().get(0).enabled()); - Assertions.assertEquals("tpsew", model.value().get(0).planId()); - Assertions.assertEquals(false, model.value().get(0).isPlanAuthorized()); - Assertions.assertEquals("sx", 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; + Assertions.assertEquals("uxxpshne", model.value().get(0).tags().get("kulfg")); + Assertions.assertEquals("gdxpg", model.value().get(0).location()); + Assertions.assertEquals("wr", model.value().get(0).author()); + Assertions.assertEquals("agohbuff", model.value().get(0).description()); + Assertions.assertEquals("qem", model.value().get(0).imageReference().offer()); + Assertions.assertEquals("hmxtdr", model.value().get(0).imageReference().publisher()); + Assertions.assertEquals("utacoe", model.value().get(0).imageReference().sku()); + Assertions.assertEquals("vewzcj", model.value().get(0).imageReference().osType()); + Assertions.assertEquals("m", model.value().get(0).imageReference().version()); + Assertions.assertEquals("pmguaadraufac", model.value().get(0).icon()); + Assertions.assertTrue(model.value().get(0).enabled()); + Assertions.assertEquals("zov", model.value().get(0).planId()); + Assertions.assertFalse(model.value().get(0).isPlanAuthorized()); + Assertions.assertEquals("te", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagePropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagePropertiesTests.java index ea71643fe3c0..1f6795e1cec1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagePropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagePropertiesTests.java @@ -1,57 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.devtestlabs.fluent.models.GalleryImageProperties; -import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; import org.junit.jupiter.api.Assertions; public final class GalleryImagePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GalleryImageProperties model = BinaryData.fromString( - "{\"author\":\"btx\",\"createdDate\":\"2021-01-25T07:52:30Z\",\"description\":\"wsrt\",\"imageReference\":{\"offer\":\"oezbrhubsk\",\"publisher\":\"dyg\",\"sku\":\"okkqfqjbvleo\",\"osType\":\"ml\",\"version\":\"qtqzfavyv\"},\"icon\":\"qybaryeua\",\"enabled\":false,\"planId\":\"abqgzslesjcbh\",\"isPlanAuthorized\":false}") + "{\"author\":\"x\",\"createdDate\":\"2021-05-04T10:40:20Z\",\"description\":\"rmsgeivsiykzkd\",\"imageReference\":{\"offer\":\"dxonbzoggculap\",\"publisher\":\"y\",\"sku\":\"gogtqxepnylbf\",\"osType\":\"jlyjtlvofq\",\"version\":\"vfcibyfmowux\"},\"icon\":\"jpvd\",\"enabled\":true,\"planId\":\"wiivwzjbhyzsx\",\"isPlanAuthorized\":true}") .toObject(GalleryImageProperties.class); - Assertions.assertEquals("btx", model.author()); - Assertions.assertEquals("wsrt", model.description()); - Assertions.assertEquals("oezbrhubsk", model.imageReference().offer()); - Assertions.assertEquals("dyg", model.imageReference().publisher()); - Assertions.assertEquals("okkqfqjbvleo", model.imageReference().sku()); - Assertions.assertEquals("ml", model.imageReference().osType()); - Assertions.assertEquals("qtqzfavyv", model.imageReference().version()); - Assertions.assertEquals("qybaryeua", model.icon()); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("abqgzslesjcbh", model.planId()); - Assertions.assertEquals(false, model.isPlanAuthorized()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryImageProperties model = new GalleryImageProperties().withAuthor("btx") - .withDescription("wsrt") - .withImageReference(new GalleryImageReference().withOffer("oezbrhubsk") - .withPublisher("dyg") - .withSku("okkqfqjbvleo") - .withOsType("ml") - .withVersion("qtqzfavyv")) - .withIcon("qybaryeua") - .withEnabled(false) - .withPlanId("abqgzslesjcbh") - .withIsPlanAuthorized(false); - model = BinaryData.fromObject(model).toObject(GalleryImageProperties.class); - Assertions.assertEquals("btx", model.author()); - Assertions.assertEquals("wsrt", model.description()); - Assertions.assertEquals("oezbrhubsk", model.imageReference().offer()); - Assertions.assertEquals("dyg", model.imageReference().publisher()); - Assertions.assertEquals("okkqfqjbvleo", model.imageReference().sku()); - Assertions.assertEquals("ml", model.imageReference().osType()); - Assertions.assertEquals("qtqzfavyv", model.imageReference().version()); - Assertions.assertEquals("qybaryeua", model.icon()); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("abqgzslesjcbh", model.planId()); - Assertions.assertEquals(false, model.isPlanAuthorized()); + Assertions.assertEquals("x", model.author()); + Assertions.assertEquals("rmsgeivsiykzkd", model.description()); + Assertions.assertEquals("dxonbzoggculap", model.imageReference().offer()); + Assertions.assertEquals("y", model.imageReference().publisher()); + Assertions.assertEquals("gogtqxepnylbf", model.imageReference().sku()); + Assertions.assertEquals("jlyjtlvofq", model.imageReference().osType()); + Assertions.assertEquals("vfcibyfmowux", model.imageReference().version()); + Assertions.assertEquals("jpvd", model.icon()); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("wiivwzjbhyzsx", model.planId()); + Assertions.assertTrue(model.isPlanAuthorized()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImageReferenceTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImageReferenceTests.java index 436eda3ffce5..646ed19eaf28 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImageReferenceTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImageReferenceTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,27 +12,27 @@ public final class GalleryImageReferenceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GalleryImageReference model = BinaryData.fromString( - "{\"offer\":\"qufegxuvwzfbn\",\"publisher\":\"mctlpdngitv\",\"sku\":\"mhrixkwmyijejve\",\"osType\":\"hbpnaixexccbd\",\"version\":\"ax\"}") + "{\"offer\":\"l\",\"publisher\":\"x\",\"sku\":\"qgtz\",\"osType\":\"pnqbqqwxrjfe\",\"version\":\"lnwsubisn\"}") .toObject(GalleryImageReference.class); - Assertions.assertEquals("qufegxuvwzfbn", model.offer()); - Assertions.assertEquals("mctlpdngitv", model.publisher()); - Assertions.assertEquals("mhrixkwmyijejve", model.sku()); - Assertions.assertEquals("hbpnaixexccbd", model.osType()); - Assertions.assertEquals("ax", model.version()); + Assertions.assertEquals("l", model.offer()); + Assertions.assertEquals("x", model.publisher()); + Assertions.assertEquals("qgtz", model.sku()); + Assertions.assertEquals("pnqbqqwxrjfe", model.osType()); + Assertions.assertEquals("lnwsubisn", model.version()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - GalleryImageReference model = new GalleryImageReference().withOffer("qufegxuvwzfbn") - .withPublisher("mctlpdngitv") - .withSku("mhrixkwmyijejve") - .withOsType("hbpnaixexccbd") - .withVersion("ax"); + GalleryImageReference model = new GalleryImageReference().withOffer("l") + .withPublisher("x") + .withSku("qgtz") + .withOsType("pnqbqqwxrjfe") + .withVersion("lnwsubisn"); model = BinaryData.fromObject(model).toObject(GalleryImageReference.class); - Assertions.assertEquals("qufegxuvwzfbn", model.offer()); - Assertions.assertEquals("mctlpdngitv", model.publisher()); - Assertions.assertEquals("mhrixkwmyijejve", model.sku()); - Assertions.assertEquals("hbpnaixexccbd", model.osType()); - Assertions.assertEquals("ax", model.version()); + Assertions.assertEquals("l", model.offer()); + Assertions.assertEquals("x", model.publisher()); + Assertions.assertEquals("qgtz", model.sku()); + Assertions.assertEquals("pnqbqqwxrjfe", model.osType()); + Assertions.assertEquals("lnwsubisn", model.version()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListMockTests.java index b336af55e402..d7a266fb6192 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.GalleryImage; @@ -22,31 +22,30 @@ public final class GalleryImagesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"author\":\"nudn\",\"createdDate\":\"2021-05-20T20:57:54Z\",\"description\":\"hjxwxq\",\"imageReference\":{\"offer\":\"ipmpvksmitnsq\",\"publisher\":\"l\",\"sku\":\"lkrdpqgfhy\",\"osType\":\"rakkld\",\"version\":\"c\"},\"icon\":\"cmfcnrjajq\",\"enabled\":true,\"planId\":\"jti\",\"isPlanAuthorized\":true},\"location\":\"zqgxx\",\"tags\":{\"prnzc\":\"bmtlpqagyno\",\"ryqxzxa\":\"lin\",\"mqimiymqru\":\"zi\",\"asvvoqsbpkfl\":\"guhfupe\"},\"id\":\"nfkgxsyaowuzowpu\",\"name\":\"hdkcprgu\",\"type\":\"xrztiochlu\"}]}"; + = "{\"value\":[{\"properties\":{\"author\":\"whjq\",\"createdDate\":\"2021-07-23T19:47:46Z\",\"description\":\"qo\",\"imageReference\":{\"offer\":\"xcpup\",\"publisher\":\"i\",\"sku\":\"j\",\"osType\":\"wdlvwtiwsmosaon\",\"version\":\"na\"},\"icon\":\"pultas\",\"enabled\":true,\"planId\":\"ewnazeajbkajlcyi\",\"isPlanAuthorized\":false},\"tags\":{\"xbydesqlvgecpw\":\"vxodkrvfs\",\"zxnmx\":\"olj\",\"vaz\":\"dobygoogxqapj\",\"bfas\":\"jfucsaodjnosdkv\"},\"location\":\"atrnzpducdaakt\",\"id\":\"ktz\",\"name\":\"oimyfpqd\",\"type\":\"wkppnwyytfvp\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.galleryImages() - .list("xob", "mfkwiyjvzuk", "srnawnvzmln", "oywsxvjabjqqaxu", 695117693, "y", - com.azure.core.util.Context.NONE); + .list("qontwhymxymulw", "vqtow", "h", "sycoybajasqub", 249998098, "j", com.azure.core.util.Context.NONE); - Assertions.assertEquals("zqgxx", response.iterator().next().location()); - Assertions.assertEquals("bmtlpqagyno", response.iterator().next().tags().get("prnzc")); - Assertions.assertEquals("nudn", response.iterator().next().author()); - Assertions.assertEquals("hjxwxq", response.iterator().next().description()); - Assertions.assertEquals("ipmpvksmitnsq", response.iterator().next().imageReference().offer()); - Assertions.assertEquals("l", response.iterator().next().imageReference().publisher()); - Assertions.assertEquals("lkrdpqgfhy", response.iterator().next().imageReference().sku()); - Assertions.assertEquals("rakkld", response.iterator().next().imageReference().osType()); - Assertions.assertEquals("c", response.iterator().next().imageReference().version()); - Assertions.assertEquals("cmfcnrjajq", response.iterator().next().icon()); - Assertions.assertEquals(true, response.iterator().next().enabled()); - Assertions.assertEquals("jti", response.iterator().next().planId()); - Assertions.assertEquals(true, response.iterator().next().isPlanAuthorized()); + Assertions.assertEquals("vxodkrvfs", response.iterator().next().tags().get("xbydesqlvgecpw")); + Assertions.assertEquals("atrnzpducdaakt", response.iterator().next().location()); + Assertions.assertEquals("whjq", response.iterator().next().author()); + Assertions.assertEquals("qo", response.iterator().next().description()); + Assertions.assertEquals("xcpup", response.iterator().next().imageReference().offer()); + Assertions.assertEquals("i", response.iterator().next().imageReference().publisher()); + Assertions.assertEquals("j", response.iterator().next().imageReference().sku()); + Assertions.assertEquals("wdlvwtiwsmosaon", response.iterator().next().imageReference().osType()); + Assertions.assertEquals("na", response.iterator().next().imageReference().version()); + Assertions.assertEquals("pultas", response.iterator().next().icon()); + Assertions.assertTrue(response.iterator().next().enabled()); + Assertions.assertEquals("ewnazeajbkajlcyi", response.iterator().next().planId()); + Assertions.assertFalse(response.iterator().next().isPlanAuthorized()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GenerateArmTemplateRequestTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GenerateArmTemplateRequestTests.java index b82796126e02..9de239d34e7a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GenerateArmTemplateRequestTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GenerateArmTemplateRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -15,26 +15,28 @@ public final class GenerateArmTemplateRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GenerateArmTemplateRequest model = BinaryData.fromString( - "{\"virtualMachineName\":\"tdum\",\"parameters\":[{\"name\":\"xe\",\"value\":\"nzbtbhj\"}],\"location\":\"lkfg\",\"fileUploadOptions\":\"UploadFilesAndGenerateSasTokens\"}") + "{\"virtualMachineName\":\"jzrwrdgrtw\",\"parameters\":[{\"name\":\"uzkopbminrfd\",\"value\":\"yuhhziu\"},{\"name\":\"fozbhdmsmlmzqhof\",\"value\":\"maequiahxicslfa\"},{\"name\":\"z\",\"value\":\"yylhalnswhccsp\"}],\"location\":\"aivwitqscywu\",\"fileUploadOptions\":\"None\"}") .toObject(GenerateArmTemplateRequest.class); - Assertions.assertEquals("tdum", model.virtualMachineName()); - Assertions.assertEquals("xe", model.parameters().get(0).name()); - Assertions.assertEquals("nzbtbhj", model.parameters().get(0).value()); - Assertions.assertEquals("lkfg", model.location()); - Assertions.assertEquals(FileUploadOptions.UPLOAD_FILES_AND_GENERATE_SAS_TOKENS, model.fileUploadOptions()); + Assertions.assertEquals("jzrwrdgrtw", model.virtualMachineName()); + Assertions.assertEquals("uzkopbminrfd", model.parameters().get(0).name()); + Assertions.assertEquals("yuhhziu", model.parameters().get(0).value()); + Assertions.assertEquals("aivwitqscywu", model.location()); + Assertions.assertEquals(FileUploadOptions.NONE, model.fileUploadOptions()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - GenerateArmTemplateRequest model = new GenerateArmTemplateRequest().withVirtualMachineName("tdum") - .withParameters(Arrays.asList(new ParameterInfo().withName("xe").withValue("nzbtbhj"))) - .withLocation("lkfg") - .withFileUploadOptions(FileUploadOptions.UPLOAD_FILES_AND_GENERATE_SAS_TOKENS); + GenerateArmTemplateRequest model = new GenerateArmTemplateRequest().withVirtualMachineName("jzrwrdgrtw") + .withParameters(Arrays.asList(new ParameterInfo().withName("uzkopbminrfd").withValue("yuhhziu"), + new ParameterInfo().withName("fozbhdmsmlmzqhof").withValue("maequiahxicslfa"), + new ParameterInfo().withName("z").withValue("yylhalnswhccsp"))) + .withLocation("aivwitqscywu") + .withFileUploadOptions(FileUploadOptions.NONE); model = BinaryData.fromObject(model).toObject(GenerateArmTemplateRequest.class); - Assertions.assertEquals("tdum", model.virtualMachineName()); - Assertions.assertEquals("xe", model.parameters().get(0).name()); - Assertions.assertEquals("nzbtbhj", model.parameters().get(0).value()); - Assertions.assertEquals("lkfg", model.location()); - Assertions.assertEquals(FileUploadOptions.UPLOAD_FILES_AND_GENERATE_SAS_TOKENS, model.fileUploadOptions()); + Assertions.assertEquals("jzrwrdgrtw", model.virtualMachineName()); + Assertions.assertEquals("uzkopbminrfd", model.parameters().get(0).name()); + Assertions.assertEquals("yuhhziu", model.parameters().get(0).value()); + Assertions.assertEquals("aivwitqscywu", model.location()); + Assertions.assertEquals(FileUploadOptions.NONE, model.fileUploadOptions()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GenerateUploadUriParameterTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GenerateUploadUriParameterTests.java index b2aa60aa9c76..91db93bc7e23 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GenerateUploadUriParameterTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GenerateUploadUriParameterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,14 +12,14 @@ public final class GenerateUploadUriParameterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GenerateUploadUriParameter model - = BinaryData.fromString("{\"blobName\":\"bmdnafcbqwre\"}").toObject(GenerateUploadUriParameter.class); - Assertions.assertEquals("bmdnafcbqwre", model.blobName()); + = BinaryData.fromString("{\"blobName\":\"ciwwzjuqkhr\"}").toObject(GenerateUploadUriParameter.class); + Assertions.assertEquals("ciwwzjuqkhr", model.blobName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - GenerateUploadUriParameter model = new GenerateUploadUriParameter().withBlobName("bmdnafcbqwre"); + GenerateUploadUriParameter model = new GenerateUploadUriParameter().withBlobName("ciwwzjuqkhr"); model = BinaryData.fromObject(model).toObject(GenerateUploadUriParameter.class); - Assertions.assertEquals("bmdnafcbqwre", model.blobName()); + Assertions.assertEquals("ciwwzjuqkhr", model.blobName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GenerateUploadUriResponseInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GenerateUploadUriResponseInnerTests.java index 3bf02ffa53ae..45e1a03be9d3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GenerateUploadUriResponseInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GenerateUploadUriResponseInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,15 +11,8 @@ public final class GenerateUploadUriResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - GenerateUploadUriResponseInner model - = BinaryData.fromString("{\"uploadUri\":\"ela\"}").toObject(GenerateUploadUriResponseInner.class); - Assertions.assertEquals("ela", model.uploadUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GenerateUploadUriResponseInner model = new GenerateUploadUriResponseInner().withUploadUri("ela"); - model = BinaryData.fromObject(model).toObject(GenerateUploadUriResponseInner.class); - Assertions.assertEquals("ela", model.uploadUri()); + GenerateUploadUriResponseInner model = BinaryData.fromString("{\"uploadUri\":\"jiwkuofoskghsau\"}") + .toObject(GenerateUploadUriResponseInner.class); + Assertions.assertEquals("jiwkuofoskghsau", model.uploadUri()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateWithResponseMockTests.java index 32cbba4bf4c2..9ddeeb05da99 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.DayDetails; @@ -29,50 +29,49 @@ public final class GlobalSchedulesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"ehuxiqhzlraym\",\"weeklyRecurrence\":{\"weekdays\":[\"skihmxrfd\",\"ajrednwyyshtuw\",\"mevuafpwzy\",\"frkgwltxeq\"],\"time\":\"xgzdyimsfayorp\"},\"dailyRecurrence\":{\"time\":\"kj\"},\"hourlyRecurrence\":{\"minute\":535821892},\"timeZoneId\":\"abnsmj\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":441004284,\"webhookUrl\":\"ekqsykvwjtqpkev\",\"emailRecipient\":\"ltjcrspxk\",\"notificationLocale\":\"r\"},\"createdDate\":\"2021-01-04T13:01:46Z\",\"targetResourceId\":\"gxannnoytzposewx\",\"provisioningState\":\"pxvkqma\",\"uniqueIdentifier\":\"xvpif\"},\"location\":\"f\",\"tags\":{\"eidszlfytoi\":\"yzyzeyuu\",\"hoynk\":\"hgygvfltgvd\",\"nn\":\"xwetwkdrcyrucpc\"},\"id\":\"zdqumoe\",\"name\":\"odnaienhqhskndn\",\"type\":\"lqkaadlknwf\"}"; + = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"uzgfxonjtpusl\",\"weeklyRecurrence\":{\"weekdays\":[\"vtio\"],\"time\":\"bpdbollgr\"},\"dailyRecurrence\":{\"time\":\"iuas\"},\"hourlyRecurrence\":{\"minute\":1863022211},\"timeZoneId\":\"socnequygdjboq\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1102977544,\"webhookUrl\":\"qevadrmmw\",\"emailRecipient\":\"awvcmjzkxiid\",\"notificationLocale\":\"czskoswoqiqazu\"},\"createdDate\":\"2021-02-23T06:46:30Z\",\"targetResourceId\":\"zkrrcoiisba\",\"provisioningState\":\"ppc\",\"uniqueIdentifier\":\"kuztdsbezaxyfu\"},\"tags\":{\"hnepkpeti\":\"uizh\",\"iubxdukec\":\"rx\",\"hctmmkosz\":\"xdazv\",\"aqkiofkb\":\"dblnsntrp\"},\"location\":\"mhklbnl\",\"id\":\"vcb\",\"name\":\"hez\",\"type\":\"quwusq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Schedule response = manager.globalSchedules() - .define("jb") - .withRegion("w") - .withExistingResourceGroup("r") - .withTags(mapOf("p", "sxwwhnhjtf")) - .withStatus(EnableStatus.DISABLED) - .withTaskType("aoqaqbzgyhfwwv") - .withWeeklyRecurrence( - new WeekDetails().withWeekdays(Arrays.asList("wbqamteuliy", "lpkcvmwfauxxep")).withTime("wbormcqmi")) - .withDailyRecurrence(new DayDetails().withTime("jqpkzfbo")) - .withHourlyRecurrence(new HourDetails().withMinute(1008531310)) - .withTimeZoneId("smyqwixvcpwnkwyw") + .define("ca") + .withExistingResourceGroup("dkygywezski") + .withRegion("lwyojbfqzdkfnj") + .withTags(mapOf("okzkltr", "uvblg", "rqcrjidhftukvh", "owtdvrfmvlihcvj")) + .withStatus(EnableStatus.ENABLED) + .withTaskType("m") + .withWeeklyRecurrence(new WeekDetails().withWeekdays(Arrays.asList("vdsmaklixq")).withTime("hyhxa")) + .withDailyRecurrence(new DayDetails().withTime("xawoijpodtblxp")) + .withHourlyRecurrence(new HourDetails().withMinute(236199125)) + .withTimeZoneId("jodqhykincn") .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.DISABLED) - .withTimeInMinutes(2034082492) - .withWebhookUrl("ckduoiqtamtyvskn") - .withEmailRecipient("wzawnvsbcfhzagxn") - .withNotificationLocale("ycvdimw")) - .withTargetResourceId("gzgy") + .withTimeInMinutes(1826845971) + .withWebhookUrl("izhceumoqodkadp") + .withEmailRecipient("ibngqladyw") + .withNotificationLocale("whydt")) + .withTargetResourceId("adswz") .create(); - Assertions.assertEquals("f", response.location()); - Assertions.assertEquals("yzyzeyuu", response.tags().get("eidszlfytoi")); - Assertions.assertEquals(EnableStatus.ENABLED, response.status()); - Assertions.assertEquals("ehuxiqhzlraym", response.taskType()); - Assertions.assertEquals("skihmxrfd", response.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("xgzdyimsfayorp", response.weeklyRecurrence().time()); - Assertions.assertEquals("kj", response.dailyRecurrence().time()); - Assertions.assertEquals(535821892, response.hourlyRecurrence().minute()); - Assertions.assertEquals("abnsmj", response.timeZoneId()); + Assertions.assertEquals("uizh", response.tags().get("hnepkpeti")); + Assertions.assertEquals("mhklbnl", response.location()); + Assertions.assertEquals(EnableStatus.DISABLED, response.status()); + Assertions.assertEquals("uzgfxonjtpusl", response.taskType()); + Assertions.assertEquals("vtio", response.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("bpdbollgr", response.weeklyRecurrence().time()); + Assertions.assertEquals("iuas", response.dailyRecurrence().time()); + Assertions.assertEquals(1863022211, response.hourlyRecurrence().minute()); + Assertions.assertEquals("socnequygdjboq", response.timeZoneId()); Assertions.assertEquals(EnableStatus.DISABLED, response.notificationSettings().status()); - Assertions.assertEquals(441004284, response.notificationSettings().timeInMinutes()); - Assertions.assertEquals("ekqsykvwjtqpkev", response.notificationSettings().webhookUrl()); - Assertions.assertEquals("ltjcrspxk", response.notificationSettings().emailRecipient()); - Assertions.assertEquals("r", response.notificationSettings().notificationLocale()); - Assertions.assertEquals("gxannnoytzposewx", response.targetResourceId()); + Assertions.assertEquals(1102977544, response.notificationSettings().timeInMinutes()); + Assertions.assertEquals("qevadrmmw", response.notificationSettings().webhookUrl()); + Assertions.assertEquals("awvcmjzkxiid", response.notificationSettings().emailRecipient()); + Assertions.assertEquals("czskoswoqiqazu", response.notificationSettings().notificationLocale()); + Assertions.assertEquals("zkrrcoiisba", response.targetResourceId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteByResourceGroupWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteByResourceGroupWithResponseMockTests.java index 1981602653e0..db2608c8343e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteByResourceGroupWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteByResourceGroupWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.globalSchedules() - .deleteByResourceGroupWithResponse("inzcpdltkrlgj", "tbdrvcqgue", com.azure.core.util.Context.NONE); + .deleteByResourceGroupWithResponse("nhq", "skndnelqkaadlknw", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteMockTests.java index 92035433ae5b..de5351233a17 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testExecute() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.globalSchedules().execute("zhomp", "eqdurelyujlfyoum", com.azure.core.util.Context.NONE); + manager.globalSchedules().execute("uqi", "ijiitns", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupWithResponseMockTests.java index 45d7e983d8e4..cec2ff1c2da2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -22,33 +22,33 @@ public final class GlobalSchedulesGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"lialwcjgckbbcccg\",\"weeklyRecurrence\":{\"weekdays\":[\"oxnyuffatsg\"],\"time\":\"ipwcxbyu\"},\"dailyRecurrence\":{\"time\":\"qdx\"},\"hourlyRecurrence\":{\"minute\":1532200707},\"timeZoneId\":\"nuhzafccnuh\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1363942785,\"webhookUrl\":\"ui\",\"emailRecipient\":\"xvatvcr\",\"notificationLocale\":\"lbnb\"},\"createdDate\":\"2021-02-22T22:42:13Z\",\"targetResourceId\":\"csyhzlwxaeaov\",\"provisioningState\":\"exdnd\",\"uniqueIdentifier\":\"dwead\"},\"location\":\"rzmwn\",\"tags\":{\"mmagoaqylkjzt\":\"agttm\"},\"id\":\"iua\",\"name\":\"jcg\",\"type\":\"xitp\"}"; + = "{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"zp\",\"weeklyRecurrence\":{\"weekdays\":[\"ehuxiqhzlraym\",\"zxlskihmxr\",\"dsajrednwyysh\",\"uwg\"],\"time\":\"vuafpwzyifr\"},\"dailyRecurrence\":{\"time\":\"ltxeqip\"},\"hourlyRecurrence\":{\"minute\":1931684247},\"timeZoneId\":\"imsfayorp\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":647880082,\"webhookUrl\":\"eslabnsmjkwynq\",\"emailRecipient\":\"ekqsykvwjtqpkev\",\"notificationLocale\":\"ltjcrspxk\"},\"createdDate\":\"2021-12-07T11:51:24Z\",\"targetResourceId\":\"clf\",\"provisioningState\":\"annnoytzposewx\",\"uniqueIdentifier\":\"pxvkqma\"},\"tags\":{\"aifyzyzeyuubeids\":\"vpifd\",\"ytoithgygvfl\":\"l\"},\"location\":\"vdihoynkrx\",\"id\":\"twk\",\"name\":\"rcyrucpcunnu\",\"type\":\"dqumoenodnai\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Schedule response = manager.globalSchedules() - .getByResourceGroupWithResponse("gthortudaw", "pjfe", "qerpptcbgqnzm", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("pmil", "pnwy", "udqll", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("rzmwn", response.location()); - Assertions.assertEquals("agttm", response.tags().get("mmagoaqylkjzt")); + Assertions.assertEquals("vpifd", response.tags().get("aifyzyzeyuubeids")); + Assertions.assertEquals("vdihoynkrx", response.location()); Assertions.assertEquals(EnableStatus.ENABLED, response.status()); - Assertions.assertEquals("lialwcjgckbbcccg", response.taskType()); - Assertions.assertEquals("oxnyuffatsg", response.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("ipwcxbyu", response.weeklyRecurrence().time()); - Assertions.assertEquals("qdx", response.dailyRecurrence().time()); - Assertions.assertEquals(1532200707, response.hourlyRecurrence().minute()); - Assertions.assertEquals("nuhzafccnuh", response.timeZoneId()); + Assertions.assertEquals("zp", response.taskType()); + Assertions.assertEquals("ehuxiqhzlraym", response.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("vuafpwzyifr", response.weeklyRecurrence().time()); + Assertions.assertEquals("ltxeqip", response.dailyRecurrence().time()); + Assertions.assertEquals(1931684247, response.hourlyRecurrence().minute()); + Assertions.assertEquals("imsfayorp", response.timeZoneId()); Assertions.assertEquals(EnableStatus.ENABLED, response.notificationSettings().status()); - Assertions.assertEquals(1363942785, response.notificationSettings().timeInMinutes()); - Assertions.assertEquals("ui", response.notificationSettings().webhookUrl()); - Assertions.assertEquals("xvatvcr", response.notificationSettings().emailRecipient()); - Assertions.assertEquals("lbnb", response.notificationSettings().notificationLocale()); - Assertions.assertEquals("csyhzlwxaeaov", response.targetResourceId()); + Assertions.assertEquals(647880082, response.notificationSettings().timeInMinutes()); + Assertions.assertEquals("eslabnsmjkwynq", response.notificationSettings().webhookUrl()); + Assertions.assertEquals("ekqsykvwjtqpkev", response.notificationSettings().emailRecipient()); + Assertions.assertEquals("ltjcrspxk", response.notificationSettings().notificationLocale()); + Assertions.assertEquals("clf", response.targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupMockTests.java index 93acb6aac845..99c1083e6070 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -23,32 +23,33 @@ public final class GlobalSchedulesListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"qqug\",\"weeklyRecurrence\":{\"weekdays\":[\"bcvex\"],\"time\":\"uquowtljvfwhr\"},\"dailyRecurrence\":{\"time\":\"khyxvrqtvbcz\"},\"hourlyRecurrence\":{\"minute\":1039478022},\"timeZoneId\":\"gglmepjpfsey\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":276539538,\"webhookUrl\":\"szngafpgyl\",\"emailRecipient\":\"ecjujcng\",\"notificationLocale\":\"dyedmzrgjfo\"},\"createdDate\":\"2021-04-16T15:25:59Z\",\"targetResourceId\":\"noitpkpztr\",\"provisioningState\":\"gxvcoqrasw\",\"uniqueIdentifier\":\"yxp\"},\"location\":\"itweialwvskbuh\",\"tags\":{\"yltcoqcuj\":\"aq\"},\"id\":\"dsxzakuejkmvb\",\"name\":\"ztjofqcvovjufyc\",\"type\":\"jmlbemyejiriux\"}]}"; + = "{\"value\":[{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"owog\",\"weeklyRecurrence\":{\"weekdays\":[\"sqhzvbrzcdbanfz\",\"ds\",\"xmxeatkdb\",\"wnrdjyibqbnaom\"],\"time\":\"rmkuh\"},\"dailyRecurrence\":{\"time\":\"ljalfihcjmobc\"},\"hourlyRecurrence\":{\"minute\":516966793},\"timeZoneId\":\"xxqcwgaxf\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":277993562,\"webhookUrl\":\"zwjjzr\",\"emailRecipient\":\"ixldzyyfy\",\"notificationLocale\":\"qsix\"},\"createdDate\":\"2021-08-27T15:43:44Z\",\"targetResourceId\":\"ujivyqlkjuvsm\",\"provisioningState\":\"slzoyov\",\"uniqueIdentifier\":\"dbpqvybefgvm\"},\"tags\":{\"bse\":\"kcvtl\",\"iryky\":\"kvcuartrhunl\",\"bmnwa\":\"ndzfqivjreuyk\"},\"location\":\"tbxoee\",\"id\":\"qlnfw\",\"name\":\"y\",\"type\":\"mvqdbpbhfckdvez\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.globalSchedules() - .listByResourceGroup("huqol", "ah", "uqwqulsutrjbhxyk", 1990714971, "y", com.azure.core.util.Context.NONE); + .listByResourceGroup("oanniyopetxi", "cnrly", "nucaephblkwqpat", 877535846, "qsdtcjbctvivuzq", + com.azure.core.util.Context.NONE); - Assertions.assertEquals("itweialwvskbuh", response.iterator().next().location()); - Assertions.assertEquals("aq", response.iterator().next().tags().get("yltcoqcuj")); + Assertions.assertEquals("kcvtl", response.iterator().next().tags().get("bse")); + Assertions.assertEquals("tbxoee", response.iterator().next().location()); Assertions.assertEquals(EnableStatus.DISABLED, response.iterator().next().status()); - Assertions.assertEquals("qqug", response.iterator().next().taskType()); - Assertions.assertEquals("bcvex", response.iterator().next().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("uquowtljvfwhr", response.iterator().next().weeklyRecurrence().time()); - Assertions.assertEquals("khyxvrqtvbcz", response.iterator().next().dailyRecurrence().time()); - Assertions.assertEquals(1039478022, response.iterator().next().hourlyRecurrence().minute()); - Assertions.assertEquals("gglmepjpfsey", response.iterator().next().timeZoneId()); - Assertions.assertEquals(EnableStatus.DISABLED, response.iterator().next().notificationSettings().status()); - Assertions.assertEquals(276539538, response.iterator().next().notificationSettings().timeInMinutes()); - Assertions.assertEquals("szngafpgyl", response.iterator().next().notificationSettings().webhookUrl()); - Assertions.assertEquals("ecjujcng", response.iterator().next().notificationSettings().emailRecipient()); - Assertions.assertEquals("dyedmzrgjfo", response.iterator().next().notificationSettings().notificationLocale()); - Assertions.assertEquals("noitpkpztr", response.iterator().next().targetResourceId()); + Assertions.assertEquals("owog", response.iterator().next().taskType()); + Assertions.assertEquals("sqhzvbrzcdbanfz", response.iterator().next().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("rmkuh", response.iterator().next().weeklyRecurrence().time()); + Assertions.assertEquals("ljalfihcjmobc", response.iterator().next().dailyRecurrence().time()); + Assertions.assertEquals(516966793, response.iterator().next().hourlyRecurrence().minute()); + Assertions.assertEquals("xxqcwgaxf", response.iterator().next().timeZoneId()); + Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().notificationSettings().status()); + Assertions.assertEquals(277993562, response.iterator().next().notificationSettings().timeInMinutes()); + Assertions.assertEquals("zwjjzr", response.iterator().next().notificationSettings().webhookUrl()); + Assertions.assertEquals("ixldzyyfy", response.iterator().next().notificationSettings().emailRecipient()); + Assertions.assertEquals("qsix", response.iterator().next().notificationSettings().notificationLocale()); + Assertions.assertEquals("ujivyqlkjuvsm", response.iterator().next().targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListMockTests.java index 72a45d2a45c7..59fda2816a90 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -23,32 +23,32 @@ public final class GlobalSchedulesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"selpkpbaf\",\"weeklyRecurrence\":{\"weekdays\":[\"lbyl\",\"cbevxrhyzdfw\",\"sofpltd\"],\"time\":\"airrhvhfnracw\"},\"dailyRecurrence\":{\"time\":\"igtuu\"},\"hourlyRecurrence\":{\"minute\":792662912},\"timeZoneId\":\"dawsigrbjb\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":449610334,\"webhookUrl\":\"tvqkjyazn\",\"emailRecipient\":\"tggmuwdchozfnkfe\",\"notificationLocale\":\"v\"},\"createdDate\":\"2021-01-16T22:15:11Z\",\"targetResourceId\":\"kizvoa\",\"provisioningState\":\"naqln\",\"uniqueIdentifier\":\"iguyxlykwphv\"},\"location\":\"zc\",\"tags\":{\"tl\":\"mpe\",\"rxhxkn\":\"exaonwivkcq\",\"upijubyqjfkakfq\":\"ccrmmk\",\"yildudxjascow\":\"rke\"},\"id\":\"f\",\"name\":\"jkpdxphlkksnm\",\"type\":\"zvyfijdkzuqnwsi\"}]}"; + = "{\"value\":[{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"ugiqjtiogqg\",\"weeklyRecurrence\":{\"weekdays\":[\"i\",\"tteajohiygs\",\"n\"],\"time\":\"n\"},\"dailyRecurrence\":{\"time\":\"zykmktpvwxqcse\"},\"hourlyRecurrence\":{\"minute\":1987903518},\"timeZoneId\":\"ufmpqumqyjgy\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1319895932,\"webhookUrl\":\"aeuzanh\",\"emailRecipient\":\"nhsenwphpzfng\",\"notificationLocale\":\"clid\"},\"createdDate\":\"2021-11-22T02:24:35Z\",\"targetResourceId\":\"wjjufwbe\",\"provisioningState\":\"k\",\"uniqueIdentifier\":\"rhtssr\"},\"tags\":{\"iqswbqer\":\"mdvhazcvjy\",\"iytxt\":\"w\"},\"location\":\"ukvlb\",\"id\":\"tgdstyouambe\",\"name\":\"reswmowegmmut\",\"type\":\"yxey\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.globalSchedules().list("jpziu", "fbzkk", 1959154555, "nhqs", com.azure.core.util.Context.NONE); + PagedIterable response = manager.globalSchedules() + .list("rcssbzhddubbnq", "b", 106775575, "kalehp", com.azure.core.util.Context.NONE); - Assertions.assertEquals("zc", response.iterator().next().location()); - Assertions.assertEquals("mpe", response.iterator().next().tags().get("tl")); - Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().status()); - Assertions.assertEquals("selpkpbaf", response.iterator().next().taskType()); - Assertions.assertEquals("lbyl", response.iterator().next().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("airrhvhfnracw", response.iterator().next().weeklyRecurrence().time()); - Assertions.assertEquals("igtuu", response.iterator().next().dailyRecurrence().time()); - Assertions.assertEquals(792662912, response.iterator().next().hourlyRecurrence().minute()); - Assertions.assertEquals("dawsigrbjb", response.iterator().next().timeZoneId()); - Assertions.assertEquals(EnableStatus.DISABLED, response.iterator().next().notificationSettings().status()); - Assertions.assertEquals(449610334, response.iterator().next().notificationSettings().timeInMinutes()); - Assertions.assertEquals("tvqkjyazn", response.iterator().next().notificationSettings().webhookUrl()); - Assertions.assertEquals("tggmuwdchozfnkfe", response.iterator().next().notificationSettings().emailRecipient()); - Assertions.assertEquals("v", response.iterator().next().notificationSettings().notificationLocale()); - Assertions.assertEquals("kizvoa", response.iterator().next().targetResourceId()); + Assertions.assertEquals("mdvhazcvjy", response.iterator().next().tags().get("iqswbqer")); + Assertions.assertEquals("ukvlb", response.iterator().next().location()); + Assertions.assertEquals(EnableStatus.DISABLED, response.iterator().next().status()); + Assertions.assertEquals("ugiqjtiogqg", response.iterator().next().taskType()); + Assertions.assertEquals("i", response.iterator().next().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("n", response.iterator().next().weeklyRecurrence().time()); + Assertions.assertEquals("zykmktpvwxqcse", response.iterator().next().dailyRecurrence().time()); + Assertions.assertEquals(1987903518, response.iterator().next().hourlyRecurrence().minute()); + Assertions.assertEquals("ufmpqumqyjgy", response.iterator().next().timeZoneId()); + Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().notificationSettings().status()); + Assertions.assertEquals(1319895932, response.iterator().next().notificationSettings().timeInMinutes()); + Assertions.assertEquals("aeuzanh", response.iterator().next().notificationSettings().webhookUrl()); + Assertions.assertEquals("nhsenwphpzfng", response.iterator().next().notificationSettings().emailRecipient()); + Assertions.assertEquals("clid", response.iterator().next().notificationSettings().notificationLocale()); + Assertions.assertEquals("wjjufwbe", response.iterator().next().targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetMockTests.java index 1ad9b8e47161..f1d1d872f9c9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.RetargetScheduleProperties; @@ -26,11 +26,11 @@ public void testRetarget() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.globalSchedules() - .retarget("ckyeclcdigpta", "brzmqxucycijoclx", - new RetargetScheduleProperties().withCurrentResourceId("tgjcy").withTargetResourceId("zjd"), + .retarget("xlzdesygrijwa", "ufanray", + new RetargetScheduleProperties().withCurrentResourceId("ueqfrojsyd").withTargetResourceId("h"), com.azure.core.util.Context.NONE); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/HourDetailsTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/HourDetailsTests.java index e43c42a4b0c9..2be17d72b441 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/HourDetailsTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/HourDetailsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,14 +11,14 @@ public final class HourDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - HourDetails model = BinaryData.fromString("{\"minute\":676078143}").toObject(HourDetails.class); - Assertions.assertEquals(676078143, model.minute()); + HourDetails model = BinaryData.fromString("{\"minute\":115624331}").toObject(HourDetails.class); + Assertions.assertEquals(115624331, model.minute()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HourDetails model = new HourDetails().withMinute(676078143); + HourDetails model = new HourDetails().withMinute(115624331); model = BinaryData.fromObject(model).toObject(HourDetails.class); - Assertions.assertEquals(676078143, model.minute()); + Assertions.assertEquals(115624331, model.minute()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ImportLabVirtualMachineRequestTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ImportLabVirtualMachineRequestTests.java index b2d7c6c41886..f63e3a8e6723 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ImportLabVirtualMachineRequestTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ImportLabVirtualMachineRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,20 +11,21 @@ public final class ImportLabVirtualMachineRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ImportLabVirtualMachineRequest model = BinaryData.fromString( - "{\"sourceVirtualMachineResourceId\":\"cigeleohdbvqvw\",\"destinationVirtualMachineName\":\"jopwbeonrlkwz\"}") + ImportLabVirtualMachineRequest model = BinaryData + .fromString( + "{\"sourceVirtualMachineResourceId\":\"mjmvxieduugidyjr\",\"destinationVirtualMachineName\":\"byao\"}") .toObject(ImportLabVirtualMachineRequest.class); - Assertions.assertEquals("cigeleohdbvqvw", model.sourceVirtualMachineResourceId()); - Assertions.assertEquals("jopwbeonrlkwz", model.destinationVirtualMachineName()); + Assertions.assertEquals("mjmvxieduugidyjr", model.sourceVirtualMachineResourceId()); + Assertions.assertEquals("byao", model.destinationVirtualMachineName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ImportLabVirtualMachineRequest model - = new ImportLabVirtualMachineRequest().withSourceVirtualMachineResourceId("cigeleohdbvqvw") - .withDestinationVirtualMachineName("jopwbeonrlkwz"); + = new ImportLabVirtualMachineRequest().withSourceVirtualMachineResourceId("mjmvxieduugidyjr") + .withDestinationVirtualMachineName("byao"); model = BinaryData.fromObject(model).toObject(ImportLabVirtualMachineRequest.class); - Assertions.assertEquals("cigeleohdbvqvw", model.sourceVirtualMachineResourceId()); - Assertions.assertEquals("jopwbeonrlkwz", model.destinationVirtualMachineName()); + Assertions.assertEquals("mjmvxieduugidyjr", model.sourceVirtualMachineResourceId()); + Assertions.assertEquals("byao", model.destinationVirtualMachineName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/InboundNatRuleTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/InboundNatRuleTests.java index a9c561eda104..0f58297b7464 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/InboundNatRuleTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/InboundNatRuleTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,21 +13,21 @@ public final class InboundNatRuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { InboundNatRule model = BinaryData - .fromString("{\"transportProtocol\":\"Tcp\",\"frontendPort\":1530472980,\"backendPort\":1732171023}") + .fromString("{\"transportProtocol\":\"Tcp\",\"frontendPort\":420824086,\"backendPort\":34788734}") .toObject(InboundNatRule.class); Assertions.assertEquals(TransportProtocol.TCP, model.transportProtocol()); - Assertions.assertEquals(1530472980, model.frontendPort()); - Assertions.assertEquals(1732171023, model.backendPort()); + Assertions.assertEquals(420824086, model.frontendPort()); + Assertions.assertEquals(34788734, model.backendPort()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { InboundNatRule model = new InboundNatRule().withTransportProtocol(TransportProtocol.TCP) - .withFrontendPort(1530472980) - .withBackendPort(1732171023); + .withFrontendPort(420824086) + .withBackendPort(34788734); model = BinaryData.fromObject(model).toObject(InboundNatRule.class); Assertions.assertEquals(TransportProtocol.TCP, model.transportProtocol()); - Assertions.assertEquals(1530472980, model.frontendPort()); - Assertions.assertEquals(1732171023, model.backendPort()); + Assertions.assertEquals(420824086, model.frontendPort()); + Assertions.assertEquals(34788734, model.backendPort()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabAnnouncementPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabAnnouncementPropertiesTests.java index 78950b3a5750..bc7039b6c396 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabAnnouncementPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabAnnouncementPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,27 +14,27 @@ public final class LabAnnouncementPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LabAnnouncementProperties model = BinaryData.fromString( - "{\"title\":\"pusuesn\",\"markdown\":\"dejbavo\",\"enabled\":\"Disabled\",\"expirationDate\":\"2021-03-31T13:31:51Z\",\"expired\":true,\"provisioningState\":\"tbqvudw\",\"uniqueIdentifier\":\"ndnvo\"}") + "{\"title\":\"mglougpbkw\",\"markdown\":\"utduqktapspwgcu\",\"enabled\":\"Disabled\",\"expirationDate\":\"2021-10-20T23:01:02Z\",\"expired\":true,\"provisioningState\":\"svqwhbmdgbbjfd\",\"uniqueIdentifier\":\"mbmbexppbh\"}") .toObject(LabAnnouncementProperties.class); - Assertions.assertEquals("pusuesn", model.title()); - Assertions.assertEquals("dejbavo", model.markdown()); + Assertions.assertEquals("mglougpbkw", model.title()); + Assertions.assertEquals("utduqktapspwgcu", model.markdown()); Assertions.assertEquals(EnableStatus.DISABLED, model.enabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-31T13:31:51Z"), model.expirationDate()); - Assertions.assertEquals(true, model.expired()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-20T23:01:02Z"), model.expirationDate()); + Assertions.assertTrue(model.expired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LabAnnouncementProperties model = new LabAnnouncementProperties().withTitle("pusuesn") - .withMarkdown("dejbavo") + LabAnnouncementProperties model = new LabAnnouncementProperties().withTitle("mglougpbkw") + .withMarkdown("utduqktapspwgcu") .withEnabled(EnableStatus.DISABLED) - .withExpirationDate(OffsetDateTime.parse("2021-03-31T13:31:51Z")) + .withExpirationDate(OffsetDateTime.parse("2021-10-20T23:01:02Z")) .withExpired(true); model = BinaryData.fromObject(model).toObject(LabAnnouncementProperties.class); - Assertions.assertEquals("pusuesn", model.title()); - Assertions.assertEquals("dejbavo", model.markdown()); + Assertions.assertEquals("mglougpbkw", model.title()); + Assertions.assertEquals("utduqktapspwgcu", model.markdown()); Assertions.assertEquals(EnableStatus.DISABLED, model.enabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-31T13:31:51Z"), model.expirationDate()); - Assertions.assertEquals(true, model.expired()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-20T23:01:02Z"), model.expirationDate()); + Assertions.assertTrue(model.expired()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabCostDetailsPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabCostDetailsPropertiesTests.java index 9f3db84b8ad0..b2372f99dfa3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabCostDetailsPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabCostDetailsPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,22 +14,10 @@ public final class LabCostDetailsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LabCostDetailsProperties model = BinaryData - .fromString("{\"date\":\"2021-08-17T09:35:24Z\",\"cost\":49.06806584477157,\"costType\":\"Reported\"}") + .fromString("{\"date\":\"2021-09-27T14:47:09Z\",\"cost\":70.5441985899343,\"costType\":\"Reported\"}") .toObject(LabCostDetailsProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-17T09:35:24Z"), model.date()); - Assertions.assertEquals(49.06806584477157D, model.cost()); - Assertions.assertEquals(CostType.REPORTED, model.costType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LabCostDetailsProperties model - = new LabCostDetailsProperties().withDate(OffsetDateTime.parse("2021-08-17T09:35:24Z")) - .withCost(49.06806584477157D) - .withCostType(CostType.REPORTED); - model = BinaryData.fromObject(model).toObject(LabCostDetailsProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-17T09:35:24Z"), model.date()); - Assertions.assertEquals(49.06806584477157D, model.cost()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T14:47:09Z"), model.date()); + Assertions.assertEquals(70.5441985899343D, model.cost()); Assertions.assertEquals(CostType.REPORTED, model.costType()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabCostSummaryPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabCostSummaryPropertiesTests.java index 2ae73bd2ffc0..a39a41fed97f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabCostSummaryPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabCostSummaryPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,15 +11,8 @@ public final class LabCostSummaryPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LabCostSummaryProperties model = BinaryData.fromString("{\"estimatedLabCost\":59.28385112651693}") + LabCostSummaryProperties model = BinaryData.fromString("{\"estimatedLabCost\":32.44799474332889}") .toObject(LabCostSummaryProperties.class); - Assertions.assertEquals(59.28385112651693D, model.estimatedLabCost()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LabCostSummaryProperties model = new LabCostSummaryProperties().withEstimatedLabCost(59.28385112651693D); - model = BinaryData.fromObject(model).toObject(LabCostSummaryProperties.class); - Assertions.assertEquals(59.28385112651693D, model.estimatedLabCost()); + Assertions.assertEquals(32.44799474332889D, model.estimatedLabCost()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabFragmentTests.java index 6acf9d6dd1e5..a9852f1d971c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,16 +13,19 @@ public final class LabFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LabFragment model - = BinaryData.fromString("{\"tags\":{\"hxiidlopedb\":\"scbbxig\"}}").toObject(LabFragment.class); - Assertions.assertEquals("scbbxig", model.tags().get("hxiidlopedb")); + LabFragment model = BinaryData + .fromString( + "{\"tags\":{\"gjyjgzjaoyfhrtxi\":\"psalgbqux\",\"rkujy\":\"n\",\"rlyxwjkcprbnw\":\"vlejuvfqa\"}}") + .toObject(LabFragment.class); + Assertions.assertEquals("psalgbqux", model.tags().get("gjyjgzjaoyfhrtxi")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LabFragment model = new LabFragment().withTags(mapOf("hxiidlopedb", "scbbxig")); + LabFragment model = new LabFragment() + .withTags(mapOf("gjyjgzjaoyfhrtxi", "psalgbqux", "rkujy", "n", "rlyxwjkcprbnw", "vlejuvfqa")); model = BinaryData.fromObject(model).toObject(LabFragment.class); - Assertions.assertEquals("scbbxig", model.tags().get("hxiidlopedb")); + Assertions.assertEquals("psalgbqux", model.tags().get("gjyjgzjaoyfhrtxi")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabInnerTests.java index aad92f2d1d54..d3b0c1813a91 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -22,58 +22,60 @@ public final class LabInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LabInner model = BinaryData.fromString( - "{\"properties\":{\"defaultStorageAccount\":\"dkirsoodqxhcr\",\"defaultPremiumStorageAccount\":\"ohjtckw\",\"artifactsStorageAccount\":\"soifiyipjxsqw\",\"premiumDataDiskStorageAccount\":\"rjb\",\"vaultName\":\"orcjxvsnby\",\"labStorageType\":\"StandardSSD\",\"mandatoryArtifactsResourceIdsLinux\":[\"mocpc\"],\"mandatoryArtifactsResourceIdsWindows\":[\"urzafb\",\"jjgpb\",\"oq\"],\"createdDate\":\"2021-03-12T03:38:31Z\",\"premiumDataDisks\":\"Disabled\",\"environmentPermission\":\"Reader\",\"announcement\":{\"title\":\"qidtqajzyu\",\"markdown\":\"kudjkrlkhb\",\"enabled\":\"Enabled\",\"expirationDate\":\"2021-02-23T09:32:58Z\",\"expired\":false,\"provisioningState\":\"qex\",\"uniqueIdentifier\":\"ocxscpaierhhbcs\"},\"support\":{\"enabled\":\"Disabled\",\"markdown\":\"a\"},\"vmCreationResourceGroup\":\"j\",\"publicIpId\":\"dxob\",\"loadBalancerId\":\"dxkqpx\",\"networkSecurityGroupId\":\"ajionpimexgstxg\",\"extendedProperties\":{\"aajrm\":\"dg\",\"clwhijcoejctbz\":\"djwzrlov\",\"bkbfkgukdkex\":\"qsqsy\",\"ocjjxhvpmouexh\":\"ppofmxaxcfjpgdd\"},\"provisioningState\":\"xibqeojnx\",\"uniqueIdentifier\":\"zvddntwndeicbtwn\"},\"location\":\"zao\",\"tags\":{\"qkwpyeicxmqc\":\"hrhcffcyddglmjth\",\"pbobjo\":\"wqvhkhixuigdt\",\"w\":\"hm\",\"a\":\"a\"},\"id\":\"hrzayvvtpgvdf\",\"name\":\"iotkftutqxl\",\"type\":\"gxlefgugnxkrxd\"}") + "{\"properties\":{\"defaultStorageAccount\":\"ijbpzvgnwzsymgl\",\"defaultPremiumStorageAccount\":\"fcyzkohdbihanufh\",\"artifactsStorageAccount\":\"bj\",\"premiumDataDiskStorageAccount\":\"a\",\"vaultName\":\"th\",\"labStorageType\":\"StandardSSD\",\"mandatoryArtifactsResourceIdsLinux\":[\"ifpikxwczby\",\"cnpqxuhivyqniwby\",\"rkxvdum\"],\"mandatoryArtifactsResourceIdsWindows\":[\"tfwvukxgaudc\"],\"createdDate\":\"2021-06-07T10:34:36Z\",\"premiumDataDisks\":\"Disabled\",\"environmentPermission\":\"Contributor\",\"announcement\":{\"title\":\"ejhkry\",\"markdown\":\"napczwlokjy\",\"enabled\":\"Disabled\",\"expirationDate\":\"2021-01-17T01:20:32Z\",\"expired\":true,\"provisioningState\":\"joxzjnchgejspodm\",\"uniqueIdentifier\":\"lzydehojwyahux\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"njaqwixjspro\"},\"vmCreationResourceGroup\":\"cputegjvwmfdats\",\"publicIpId\":\"dvpjhulsuuvmk\",\"loadBalancerId\":\"zkrwfn\",\"networkSecurityGroupId\":\"odjpslwejd\",\"extendedProperties\":{\"psoacctazakljl\":\"ryo\",\"paojakhmsbzjh\":\"hbcryffdfdosyge\",\"hqtrgqjbpf\":\"rzevdphlxaol\"},\"provisioningState\":\"s\",\"uniqueIdentifier\":\"zgvfcjrwz\"},\"tags\":{\"felluwfzitonpe\":\"j\",\"vhpfxxypininmay\":\"fpjkjlxofp\",\"oginuvamiheognar\":\"uybbkpodep\",\"qi\":\"zxtheotusivyevcc\"},\"location\":\"hungbwjzrnf\",\"id\":\"xgispemvtzfkufu\",\"name\":\"ljofxqeofjaeqjh\",\"type\":\"jbasvmsmjqulngs\"}") .toObject(LabInner.class); - Assertions.assertEquals("zao", model.location()); - Assertions.assertEquals("hrhcffcyddglmjth", model.tags().get("qkwpyeicxmqc")); + Assertions.assertEquals("j", model.tags().get("felluwfzitonpe")); + Assertions.assertEquals("hungbwjzrnf", model.location()); Assertions.assertEquals(StorageType.STANDARD_SSD, model.labStorageType()); - Assertions.assertEquals("mocpc", model.mandatoryArtifactsResourceIdsLinux().get(0)); - Assertions.assertEquals("urzafb", model.mandatoryArtifactsResourceIdsWindows().get(0)); + Assertions.assertEquals("ifpikxwczby", model.mandatoryArtifactsResourceIdsLinux().get(0)); + Assertions.assertEquals("tfwvukxgaudc", model.mandatoryArtifactsResourceIdsWindows().get(0)); Assertions.assertEquals(PremiumDataDisk.DISABLED, model.premiumDataDisks()); - Assertions.assertEquals(EnvironmentPermission.READER, model.environmentPermission()); - Assertions.assertEquals("qidtqajzyu", model.announcement().title()); - Assertions.assertEquals("kudjkrlkhb", model.announcement().markdown()); - Assertions.assertEquals(EnableStatus.ENABLED, model.announcement().enabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-23T09:32:58Z"), model.announcement().expirationDate()); - Assertions.assertEquals(false, model.announcement().expired()); - Assertions.assertEquals(EnableStatus.DISABLED, model.support().enabled()); - Assertions.assertEquals("a", model.support().markdown()); - Assertions.assertEquals("dg", model.extendedProperties().get("aajrm")); + Assertions.assertEquals(EnvironmentPermission.CONTRIBUTOR, model.environmentPermission()); + Assertions.assertEquals("ejhkry", model.announcement().title()); + Assertions.assertEquals("napczwlokjy", model.announcement().markdown()); + Assertions.assertEquals(EnableStatus.DISABLED, model.announcement().enabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-17T01:20:32Z"), model.announcement().expirationDate()); + Assertions.assertTrue(model.announcement().expired()); + Assertions.assertEquals(EnableStatus.ENABLED, model.support().enabled()); + Assertions.assertEquals("njaqwixjspro", model.support().markdown()); + Assertions.assertEquals("ryo", model.extendedProperties().get("psoacctazakljl")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LabInner model = new LabInner().withLocation("zao") - .withTags(mapOf("qkwpyeicxmqc", "hrhcffcyddglmjth", "pbobjo", "wqvhkhixuigdt", "w", "hm", "a", "a")) + LabInner model = new LabInner() + .withTags(mapOf("felluwfzitonpe", "j", "vhpfxxypininmay", "fpjkjlxofp", "oginuvamiheognar", "uybbkpodep", + "qi", "zxtheotusivyevcc")) + .withLocation("hungbwjzrnf") .withLabStorageType(StorageType.STANDARD_SSD) - .withMandatoryArtifactsResourceIdsLinux(Arrays.asList("mocpc")) - .withMandatoryArtifactsResourceIdsWindows(Arrays.asList("urzafb", "jjgpb", "oq")) + .withMandatoryArtifactsResourceIdsLinux(Arrays.asList("ifpikxwczby", "cnpqxuhivyqniwby", "rkxvdum")) + .withMandatoryArtifactsResourceIdsWindows(Arrays.asList("tfwvukxgaudc")) .withPremiumDataDisks(PremiumDataDisk.DISABLED) - .withEnvironmentPermission(EnvironmentPermission.READER) - .withAnnouncement(new LabAnnouncementProperties().withTitle("qidtqajzyu") - .withMarkdown("kudjkrlkhb") - .withEnabled(EnableStatus.ENABLED) - .withExpirationDate(OffsetDateTime.parse("2021-02-23T09:32:58Z")) - .withExpired(false)) - .withSupport(new LabSupportProperties().withEnabled(EnableStatus.DISABLED).withMarkdown("a")) - .withExtendedProperties(mapOf("aajrm", "dg", "clwhijcoejctbz", "djwzrlov", "bkbfkgukdkex", "qsqsy", - "ocjjxhvpmouexh", "ppofmxaxcfjpgdd")); + .withEnvironmentPermission(EnvironmentPermission.CONTRIBUTOR) + .withAnnouncement(new LabAnnouncementProperties().withTitle("ejhkry") + .withMarkdown("napczwlokjy") + .withEnabled(EnableStatus.DISABLED) + .withExpirationDate(OffsetDateTime.parse("2021-01-17T01:20:32Z")) + .withExpired(true)) + .withSupport(new LabSupportProperties().withEnabled(EnableStatus.ENABLED).withMarkdown("njaqwixjspro")) + .withExtendedProperties( + mapOf("psoacctazakljl", "ryo", "paojakhmsbzjh", "hbcryffdfdosyge", "hqtrgqjbpf", "rzevdphlxaol")); model = BinaryData.fromObject(model).toObject(LabInner.class); - Assertions.assertEquals("zao", model.location()); - Assertions.assertEquals("hrhcffcyddglmjth", model.tags().get("qkwpyeicxmqc")); + Assertions.assertEquals("j", model.tags().get("felluwfzitonpe")); + Assertions.assertEquals("hungbwjzrnf", model.location()); Assertions.assertEquals(StorageType.STANDARD_SSD, model.labStorageType()); - Assertions.assertEquals("mocpc", model.mandatoryArtifactsResourceIdsLinux().get(0)); - Assertions.assertEquals("urzafb", model.mandatoryArtifactsResourceIdsWindows().get(0)); + Assertions.assertEquals("ifpikxwczby", model.mandatoryArtifactsResourceIdsLinux().get(0)); + Assertions.assertEquals("tfwvukxgaudc", model.mandatoryArtifactsResourceIdsWindows().get(0)); Assertions.assertEquals(PremiumDataDisk.DISABLED, model.premiumDataDisks()); - Assertions.assertEquals(EnvironmentPermission.READER, model.environmentPermission()); - Assertions.assertEquals("qidtqajzyu", model.announcement().title()); - Assertions.assertEquals("kudjkrlkhb", model.announcement().markdown()); - Assertions.assertEquals(EnableStatus.ENABLED, model.announcement().enabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-23T09:32:58Z"), model.announcement().expirationDate()); - Assertions.assertEquals(false, model.announcement().expired()); - Assertions.assertEquals(EnableStatus.DISABLED, model.support().enabled()); - Assertions.assertEquals("a", model.support().markdown()); - Assertions.assertEquals("dg", model.extendedProperties().get("aajrm")); + Assertions.assertEquals(EnvironmentPermission.CONTRIBUTOR, model.environmentPermission()); + Assertions.assertEquals("ejhkry", model.announcement().title()); + Assertions.assertEquals("napczwlokjy", model.announcement().markdown()); + Assertions.assertEquals(EnableStatus.DISABLED, model.announcement().enabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-17T01:20:32Z"), model.announcement().expirationDate()); + Assertions.assertTrue(model.announcement().expired()); + Assertions.assertEquals(EnableStatus.ENABLED, model.support().enabled()); + Assertions.assertEquals("njaqwixjspro", model.support().markdown()); + Assertions.assertEquals("ryo", model.extendedProperties().get("psoacctazakljl")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabListTests.java index e3494fd6c21e..d5972fa4e99b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabListTests.java @@ -1,130 +1,40 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.LabInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.LabList; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; import com.azure.resourcemanager.devtestlabs.models.EnvironmentPermission; -import com.azure.resourcemanager.devtestlabs.models.LabAnnouncementProperties; -import com.azure.resourcemanager.devtestlabs.models.LabList; -import com.azure.resourcemanager.devtestlabs.models.LabSupportProperties; import com.azure.resourcemanager.devtestlabs.models.PremiumDataDisk; import com.azure.resourcemanager.devtestlabs.models.StorageType; import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class LabListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LabList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"defaultStorageAccount\":\"ryrtihfxtijbpzv\",\"defaultPremiumStorageAccount\":\"wzsymglzufcy\",\"artifactsStorageAccount\":\"ohdbihanufh\",\"premiumDataDiskStorageAccount\":\"bj\",\"vaultName\":\"a\",\"labStorageType\":\"StandardSSD\",\"mandatoryArtifactsResourceIdsLinux\":[\"qhabifpikxwcz\",\"yscnpqxu\"],\"mandatoryArtifactsResourceIdsWindows\":[\"y\"],\"createdDate\":\"2021-06-17T16:29:35Z\",\"premiumDataDisks\":\"Disabled\",\"environmentPermission\":\"Reader\",\"announcement\":{\"title\":\"xvd\",\"markdown\":\"jgrtfwvukxga\",\"enabled\":\"Enabled\",\"expirationDate\":\"2021-02-04T04:03:24Z\",\"expired\":false,\"provisioningState\":\"jcny\",\"uniqueIdentifier\":\"hkryhtn\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"lokjyemkk\"},\"vmCreationResourceGroup\":\"ipjoxzjnchgejs\",\"publicIpId\":\"dmailzydehojw\",\"loadBalancerId\":\"huxinpmqnj\",\"networkSecurityGroupId\":\"wixjsprozvcp\",\"extendedProperties\":{\"fdatsc\":\"gjvw\"},\"provisioningState\":\"vpjhulsuuv\",\"uniqueIdentifier\":\"jozkrwfndiod\"},\"location\":\"pslwejdpvw\",\"tags\":{\"j\":\"qpsoacctazak\",\"yffdfdos\":\"ahbc\"},\"id\":\"gexpaojakhmsbz\",\"name\":\"hcrzevd\",\"type\":\"hlxaolthqtr\"},{\"properties\":{\"defaultStorageAccount\":\"bpf\",\"defaultPremiumStorageAccount\":\"s\",\"artifactsStorageAccount\":\"zgvfcjrwz\",\"premiumDataDiskStorageAccount\":\"xjtfelluwfzit\",\"vaultName\":\"peqfpjkjl\",\"labStorageType\":\"Standard\",\"mandatoryArtifactsResourceIdsLinux\":[\"vhpfxxypininmay\",\"uybbkpodep\",\"oginuvamiheognar\",\"zxtheotusivyevcc\"],\"mandatoryArtifactsResourceIdsWindows\":[\"hn\",\"un\"],\"createdDate\":\"2021-08-15T16:10:49Z\",\"premiumDataDisks\":\"Disabled\",\"environmentPermission\":\"Contributor\",\"announcement\":{\"title\":\"gxg\",\"markdown\":\"pemvtzfkufubljof\",\"enabled\":\"Disabled\",\"expirationDate\":\"2021-05-14T22:11:20Z\",\"expired\":true,\"provisioningState\":\"qjhqjbas\",\"uniqueIdentifier\":\"smjqulngsntnbyb\"},\"support\":{\"enabled\":\"Disabled\",\"markdown\":\"rwclxxwrljdo\"},\"vmCreationResourceGroup\":\"kcqvkocrc\",\"publicIpId\":\"kwt\",\"loadBalancerId\":\"xbnjbiksq\",\"networkSecurityGroupId\":\"lssai\",\"extendedProperties\":{\"eebvmgxsab\":\"jwnzlljfmp\"},\"provisioningState\":\"qduujitcjczdz\",\"uniqueIdentifier\":\"ndhkrw\"},\"location\":\"d\",\"tags\":{\"usnhutje\":\"dsbdkvwrwjf\"},\"id\":\"tmrldhugjzzdatq\",\"name\":\"hocdgeab\",\"type\":\"gphuticndvka\"},{\"properties\":{\"defaultStorageAccount\":\"yiftyhxhuro\",\"defaultPremiumStorageAccount\":\"tyxolniwpwc\",\"artifactsStorageAccount\":\"jfkgiawxk\",\"premiumDataDiskStorageAccount\":\"ypl\",\"vaultName\":\"kbasyypn\",\"labStorageType\":\"StandardSSD\",\"mandatoryArtifactsResourceIdsLinux\":[\"cbacphejkotynqg\",\"ulzndlikwyqk\",\"fgibmadgakeq\"],\"mandatoryArtifactsResourceIdsWindows\":[\"yb\"],\"createdDate\":\"2021-03-26T22:16:08Z\",\"premiumDataDisks\":\"Enabled\",\"environmentPermission\":\"Reader\",\"announcement\":{\"title\":\"ciqfou\",\"markdown\":\"mmnkzsmodmgl\",\"enabled\":\"Disabled\",\"expirationDate\":\"2021-10-06T03:29:57Z\",\"expired\":false,\"provisioningState\":\"mutduqktaps\",\"uniqueIdentifier\":\"gcue\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"dosvqwhbmdgbbjf\"},\"vmCreationResourceGroup\":\"gmbmbexppbh\",\"publicIpId\":\"qrolfpf\",\"loadBalancerId\":\"algbquxigjyjg\",\"networkSecurityGroupId\":\"aoyfhrtxilnerkuj\",\"extendedProperties\":{\"juvf\":\"l\",\"jkcpr\":\"awrlyx\",\"nruj\":\"nwbxgjvtbvpyssz\"},\"provisioningState\":\"uhmuouqfprwzwbn\",\"uniqueIdentifier\":\"itnwuizgazxufi\"},\"location\":\"uckyf\",\"tags\":{\"zuhtymwisdkfthwx\":\"fidfvzw\",\"mijcmmxdcufufs\":\"nteiwaopv\",\"fycc\":\"pymzidnsezcxtbzs\"},\"id\":\"newmdwzjeiachbo\",\"name\":\"sflnrosfqp\",\"type\":\"eeh\"}],\"nextLink\":\"vypyqrimzinpv\"}") + "{\"value\":[{\"properties\":{\"defaultStorageAccount\":\"fizuckyf\",\"defaultPremiumStorageAccount\":\"rfidfvzwdz\",\"artifactsStorageAccount\":\"tymw\",\"premiumDataDiskStorageAccount\":\"dkfthwxmnt\",\"vaultName\":\"waopvkmijcmmxd\",\"labStorageType\":\"Premium\",\"mandatoryArtifactsResourceIdsLinux\":[\"srp\",\"mzidnsezcxtb\",\"sgfyccsnew\"],\"mandatoryArtifactsResourceIdsWindows\":[\"z\",\"eiachboosflnr\"],\"createdDate\":\"2021-04-28T23:01:46Z\",\"premiumDataDisks\":\"Disabled\",\"environmentPermission\":\"Reader\",\"announcement\":{\"title\":\"zzvypyqrimzinp\",\"markdown\":\"wjdk\",\"enabled\":\"Disabled\",\"expirationDate\":\"2021-06-03T00:49:48Z\",\"expired\":false,\"provisioningState\":\"hc\",\"uniqueIdentifier\":\"nohjt\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"soifiyipjxsqw\"},\"vmCreationResourceGroup\":\"rjb\",\"publicIpId\":\"orcjxvsnby\",\"loadBalancerId\":\"abnmocpcyshu\",\"networkSecurityGroupId\":\"afbljjgpbtoqcjmk\",\"extendedProperties\":{\"qajzyulpkudjkr\":\"vbqid\"},\"provisioningState\":\"hbzhfepg\",\"uniqueIdentifier\":\"qex\"},\"tags\":{\"scpai\":\"c\",\"l\":\"rhhbcs\",\"bnbdxkqpxokajion\":\"mmajtjaodx\",\"jrmvdjwzrlo\":\"imexgstxgcpodgma\"},\"location\":\"clwhijcoejctbz\",\"id\":\"s\",\"name\":\"sycbkbfk\",\"type\":\"ukdkexxppofmxa\"}],\"nextLink\":\"fjpgddtocjjxhvp\"}") .toObject(LabList.class); - Assertions.assertEquals("pslwejdpvw", model.value().get(0).location()); - Assertions.assertEquals("qpsoacctazak", model.value().get(0).tags().get("j")); - Assertions.assertEquals(StorageType.STANDARD_SSD, model.value().get(0).labStorageType()); - Assertions.assertEquals("qhabifpikxwcz", model.value().get(0).mandatoryArtifactsResourceIdsLinux().get(0)); - Assertions.assertEquals("y", model.value().get(0).mandatoryArtifactsResourceIdsWindows().get(0)); + Assertions.assertEquals("c", model.value().get(0).tags().get("scpai")); + Assertions.assertEquals("clwhijcoejctbz", model.value().get(0).location()); + Assertions.assertEquals(StorageType.PREMIUM, model.value().get(0).labStorageType()); + Assertions.assertEquals("srp", model.value().get(0).mandatoryArtifactsResourceIdsLinux().get(0)); + Assertions.assertEquals("z", model.value().get(0).mandatoryArtifactsResourceIdsWindows().get(0)); Assertions.assertEquals(PremiumDataDisk.DISABLED, model.value().get(0).premiumDataDisks()); Assertions.assertEquals(EnvironmentPermission.READER, model.value().get(0).environmentPermission()); - Assertions.assertEquals("xvd", model.value().get(0).announcement().title()); - Assertions.assertEquals("jgrtfwvukxga", model.value().get(0).announcement().markdown()); - Assertions.assertEquals(EnableStatus.ENABLED, model.value().get(0).announcement().enabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-04T04:03:24Z"), + Assertions.assertEquals("zzvypyqrimzinp", model.value().get(0).announcement().title()); + Assertions.assertEquals("wjdk", model.value().get(0).announcement().markdown()); + Assertions.assertEquals(EnableStatus.DISABLED, model.value().get(0).announcement().enabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-03T00:49:48Z"), model.value().get(0).announcement().expirationDate()); - Assertions.assertEquals(false, model.value().get(0).announcement().expired()); + Assertions.assertFalse(model.value().get(0).announcement().expired()); Assertions.assertEquals(EnableStatus.ENABLED, model.value().get(0).support().enabled()); - Assertions.assertEquals("lokjyemkk", model.value().get(0).support().markdown()); - Assertions.assertEquals("gjvw", model.value().get(0).extendedProperties().get("fdatsc")); - Assertions.assertEquals("vypyqrimzinpv", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LabList model = new LabList() - .withValue(Arrays.asList( - new LabInner().withLocation("pslwejdpvw") - .withTags(mapOf("j", "qpsoacctazak", "yffdfdos", "ahbc")) - .withLabStorageType(StorageType.STANDARD_SSD) - .withMandatoryArtifactsResourceIdsLinux(Arrays.asList("qhabifpikxwcz", "yscnpqxu")) - .withMandatoryArtifactsResourceIdsWindows(Arrays.asList("y")) - .withPremiumDataDisks(PremiumDataDisk.DISABLED) - .withEnvironmentPermission(EnvironmentPermission.READER) - .withAnnouncement(new LabAnnouncementProperties().withTitle("xvd") - .withMarkdown("jgrtfwvukxga") - .withEnabled(EnableStatus.ENABLED) - .withExpirationDate(OffsetDateTime.parse("2021-02-04T04:03:24Z")) - .withExpired(false)) - .withSupport(new LabSupportProperties().withEnabled(EnableStatus.ENABLED).withMarkdown("lokjyemkk")) - .withExtendedProperties(mapOf("fdatsc", "gjvw")), - new LabInner().withLocation("d") - .withTags(mapOf("usnhutje", "dsbdkvwrwjf")) - .withLabStorageType(StorageType.STANDARD) - .withMandatoryArtifactsResourceIdsLinux( - Arrays.asList("vhpfxxypininmay", "uybbkpodep", "oginuvamiheognar", "zxtheotusivyevcc")) - .withMandatoryArtifactsResourceIdsWindows(Arrays.asList("hn", "un")) - .withPremiumDataDisks(PremiumDataDisk.DISABLED) - .withEnvironmentPermission(EnvironmentPermission.CONTRIBUTOR) - .withAnnouncement(new LabAnnouncementProperties().withTitle("gxg") - .withMarkdown("pemvtzfkufubljof") - .withEnabled(EnableStatus.DISABLED) - .withExpirationDate(OffsetDateTime.parse("2021-05-14T22:11:20Z")) - .withExpired(true)) - .withSupport( - new LabSupportProperties().withEnabled(EnableStatus.DISABLED).withMarkdown("rwclxxwrljdo")) - .withExtendedProperties(mapOf("eebvmgxsab", "jwnzlljfmp")), - new LabInner().withLocation("uckyf") - .withTags( - mapOf("zuhtymwisdkfthwx", "fidfvzw", "mijcmmxdcufufs", "nteiwaopv", "fycc", "pymzidnsezcxtbzs")) - .withLabStorageType(StorageType.STANDARD_SSD) - .withMandatoryArtifactsResourceIdsLinux( - Arrays.asList("cbacphejkotynqg", "ulzndlikwyqk", "fgibmadgakeq")) - .withMandatoryArtifactsResourceIdsWindows(Arrays.asList("yb")) - .withPremiumDataDisks(PremiumDataDisk.ENABLED) - .withEnvironmentPermission(EnvironmentPermission.READER) - .withAnnouncement(new LabAnnouncementProperties().withTitle("ciqfou") - .withMarkdown("mmnkzsmodmgl") - .withEnabled(EnableStatus.DISABLED) - .withExpirationDate(OffsetDateTime.parse("2021-10-06T03:29:57Z")) - .withExpired(false)) - .withSupport( - new LabSupportProperties().withEnabled(EnableStatus.ENABLED).withMarkdown("dosvqwhbmdgbbjf")) - .withExtendedProperties(mapOf("juvf", "l", "jkcpr", "awrlyx", "nruj", "nwbxgjvtbvpyssz")))) - .withNextLink("vypyqrimzinpv"); - model = BinaryData.fromObject(model).toObject(LabList.class); - Assertions.assertEquals("pslwejdpvw", model.value().get(0).location()); - Assertions.assertEquals("qpsoacctazak", model.value().get(0).tags().get("j")); - Assertions.assertEquals(StorageType.STANDARD_SSD, model.value().get(0).labStorageType()); - Assertions.assertEquals("qhabifpikxwcz", model.value().get(0).mandatoryArtifactsResourceIdsLinux().get(0)); - Assertions.assertEquals("y", model.value().get(0).mandatoryArtifactsResourceIdsWindows().get(0)); - Assertions.assertEquals(PremiumDataDisk.DISABLED, model.value().get(0).premiumDataDisks()); - Assertions.assertEquals(EnvironmentPermission.READER, model.value().get(0).environmentPermission()); - Assertions.assertEquals("xvd", model.value().get(0).announcement().title()); - Assertions.assertEquals("jgrtfwvukxga", model.value().get(0).announcement().markdown()); - Assertions.assertEquals(EnableStatus.ENABLED, model.value().get(0).announcement().enabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-04T04:03:24Z"), - model.value().get(0).announcement().expirationDate()); - Assertions.assertEquals(false, model.value().get(0).announcement().expired()); - Assertions.assertEquals(EnableStatus.ENABLED, model.value().get(0).support().enabled()); - Assertions.assertEquals("lokjyemkk", model.value().get(0).support().markdown()); - Assertions.assertEquals("gjvw", model.value().get(0).extendedProperties().get("fdatsc")); - Assertions.assertEquals("vypyqrimzinpv", 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; + Assertions.assertEquals("soifiyipjxsqw", model.value().get(0).support().markdown()); + Assertions.assertEquals("vbqid", model.value().get(0).extendedProperties().get("qajzyulpkudjkr")); + Assertions.assertEquals("fjpgddtocjjxhvp", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabPropertiesTests.java index a136309ea5f6..3abd27658852 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -22,51 +22,51 @@ public final class LabPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LabProperties model = BinaryData.fromString( - "{\"defaultStorageAccount\":\"i\",\"defaultPremiumStorageAccount\":\"thz\",\"artifactsStorageAccount\":\"qdrabhjybigehoqf\",\"premiumDataDiskStorageAccount\":\"wska\",\"vaultName\":\"ktzlcuiywg\",\"labStorageType\":\"Standard\",\"mandatoryArtifactsResourceIdsLinux\":[\"drvyn\",\"zgpphrcgyncocpe\",\"fvm\"],\"mandatoryArtifactsResourceIdsWindows\":[\"ofsx\"],\"createdDate\":\"2021-10-25T19:09:19Z\",\"premiumDataDisks\":\"Enabled\",\"environmentPermission\":\"Reader\",\"announcement\":{\"title\":\"qabcypm\",\"markdown\":\"kwlzuvccfwnfn\",\"enabled\":\"Enabled\",\"expirationDate\":\"2021-02-24T21:18:31Z\",\"expired\":true,\"provisioningState\":\"ebxetqgtzxdp\",\"uniqueIdentifier\":\"bqqwxrj\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"nwsubisnj\"},\"vmCreationResourceGroup\":\"pmng\",\"publicIpId\":\"scxaq\",\"loadBalancerId\":\"ochcbonqvpkvl\",\"networkSecurityGroupId\":\"njeaseipheofloke\",\"extendedProperties\":{\"jp\":\"enjbdlwtgrhp\",\"e\":\"umasxazjpq\",\"zvdudgwdslfhotwm\":\"ualhbxxhejj\"},\"provisioningState\":\"npwlbjnpg\",\"uniqueIdentifier\":\"ftadehxnltyfs\"}") + "{\"defaultStorageAccount\":\"nbybkzgcwrwcl\",\"defaultPremiumStorageAccount\":\"wrljdouskc\",\"artifactsStorageAccount\":\"kocrcjdkwtnhx\",\"premiumDataDiskStorageAccount\":\"jbiksqrglssai\",\"vaultName\":\"p\",\"labStorageType\":\"Standard\",\"mandatoryArtifactsResourceIdsLinux\":[\"ljfmppee\",\"vmgxsab\",\"yqduujit\"],\"mandatoryArtifactsResourceIdsWindows\":[\"zdzevndh\",\"rwpdappdsbdkvwrw\"],\"createdDate\":\"2021-08-30T18:39:19Z\",\"premiumDataDisks\":\"Disabled\",\"environmentPermission\":\"Reader\",\"announcement\":{\"title\":\"je\",\"markdown\":\"mrldhu\",\"enabled\":\"Enabled\",\"expirationDate\":\"2021-10-02T10:39:21Z\",\"expired\":true,\"provisioningState\":\"xhocdgeablgphuti\",\"uniqueIdentifier\":\"dvkaozw\"},\"support\":{\"enabled\":\"Disabled\",\"markdown\":\"hxh\"},\"vmCreationResourceGroup\":\"okftyxolniwpwcuk\",\"publicIpId\":\"kgiawxklryplwck\",\"loadBalancerId\":\"syyp\",\"networkSecurityGroupId\":\"dhsgcba\",\"extendedProperties\":{\"tynqgoul\":\"ejk\",\"yqkgfg\":\"ndlik\",\"qsrxybzqqed\":\"bmadgak\"},\"provisioningState\":\"tbciqfouflmm\",\"uniqueIdentifier\":\"zsm\"}") .toObject(LabProperties.class); Assertions.assertEquals(StorageType.STANDARD, model.labStorageType()); - Assertions.assertEquals("drvyn", model.mandatoryArtifactsResourceIdsLinux().get(0)); - Assertions.assertEquals("ofsx", model.mandatoryArtifactsResourceIdsWindows().get(0)); - Assertions.assertEquals(PremiumDataDisk.ENABLED, model.premiumDataDisks()); + Assertions.assertEquals("ljfmppee", model.mandatoryArtifactsResourceIdsLinux().get(0)); + Assertions.assertEquals("zdzevndh", model.mandatoryArtifactsResourceIdsWindows().get(0)); + Assertions.assertEquals(PremiumDataDisk.DISABLED, model.premiumDataDisks()); Assertions.assertEquals(EnvironmentPermission.READER, model.environmentPermission()); - Assertions.assertEquals("qabcypm", model.announcement().title()); - Assertions.assertEquals("kwlzuvccfwnfn", model.announcement().markdown()); + Assertions.assertEquals("je", model.announcement().title()); + Assertions.assertEquals("mrldhu", model.announcement().markdown()); Assertions.assertEquals(EnableStatus.ENABLED, model.announcement().enabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T21:18:31Z"), model.announcement().expirationDate()); - Assertions.assertEquals(true, model.announcement().expired()); - Assertions.assertEquals(EnableStatus.ENABLED, model.support().enabled()); - Assertions.assertEquals("nwsubisnj", model.support().markdown()); - Assertions.assertEquals("enjbdlwtgrhp", model.extendedProperties().get("jp")); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-02T10:39:21Z"), model.announcement().expirationDate()); + Assertions.assertTrue(model.announcement().expired()); + Assertions.assertEquals(EnableStatus.DISABLED, model.support().enabled()); + Assertions.assertEquals("hxh", model.support().markdown()); + Assertions.assertEquals("ejk", model.extendedProperties().get("tynqgoul")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LabProperties model = new LabProperties().withLabStorageType(StorageType.STANDARD) - .withMandatoryArtifactsResourceIdsLinux(Arrays.asList("drvyn", "zgpphrcgyncocpe", "fvm")) - .withMandatoryArtifactsResourceIdsWindows(Arrays.asList("ofsx")) - .withPremiumDataDisks(PremiumDataDisk.ENABLED) + .withMandatoryArtifactsResourceIdsLinux(Arrays.asList("ljfmppee", "vmgxsab", "yqduujit")) + .withMandatoryArtifactsResourceIdsWindows(Arrays.asList("zdzevndh", "rwpdappdsbdkvwrw")) + .withPremiumDataDisks(PremiumDataDisk.DISABLED) .withEnvironmentPermission(EnvironmentPermission.READER) - .withAnnouncement(new LabAnnouncementProperties().withTitle("qabcypm") - .withMarkdown("kwlzuvccfwnfn") + .withAnnouncement(new LabAnnouncementProperties().withTitle("je") + .withMarkdown("mrldhu") .withEnabled(EnableStatus.ENABLED) - .withExpirationDate(OffsetDateTime.parse("2021-02-24T21:18:31Z")) + .withExpirationDate(OffsetDateTime.parse("2021-10-02T10:39:21Z")) .withExpired(true)) - .withSupport(new LabSupportProperties().withEnabled(EnableStatus.ENABLED).withMarkdown("nwsubisnj")) - .withExtendedProperties(mapOf("jp", "enjbdlwtgrhp", "e", "umasxazjpq", "zvdudgwdslfhotwm", "ualhbxxhejj")); + .withSupport(new LabSupportProperties().withEnabled(EnableStatus.DISABLED).withMarkdown("hxh")) + .withExtendedProperties(mapOf("tynqgoul", "ejk", "yqkgfg", "ndlik", "qsrxybzqqed", "bmadgak")); model = BinaryData.fromObject(model).toObject(LabProperties.class); Assertions.assertEquals(StorageType.STANDARD, model.labStorageType()); - Assertions.assertEquals("drvyn", model.mandatoryArtifactsResourceIdsLinux().get(0)); - Assertions.assertEquals("ofsx", model.mandatoryArtifactsResourceIdsWindows().get(0)); - Assertions.assertEquals(PremiumDataDisk.ENABLED, model.premiumDataDisks()); + Assertions.assertEquals("ljfmppee", model.mandatoryArtifactsResourceIdsLinux().get(0)); + Assertions.assertEquals("zdzevndh", model.mandatoryArtifactsResourceIdsWindows().get(0)); + Assertions.assertEquals(PremiumDataDisk.DISABLED, model.premiumDataDisks()); Assertions.assertEquals(EnvironmentPermission.READER, model.environmentPermission()); - Assertions.assertEquals("qabcypm", model.announcement().title()); - Assertions.assertEquals("kwlzuvccfwnfn", model.announcement().markdown()); + Assertions.assertEquals("je", model.announcement().title()); + Assertions.assertEquals("mrldhu", model.announcement().markdown()); Assertions.assertEquals(EnableStatus.ENABLED, model.announcement().enabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T21:18:31Z"), model.announcement().expirationDate()); - Assertions.assertEquals(true, model.announcement().expired()); - Assertions.assertEquals(EnableStatus.ENABLED, model.support().enabled()); - Assertions.assertEquals("nwsubisnj", model.support().markdown()); - Assertions.assertEquals("enjbdlwtgrhp", model.extendedProperties().get("jp")); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-02T10:39:21Z"), model.announcement().expirationDate()); + Assertions.assertTrue(model.announcement().expired()); + Assertions.assertEquals(EnableStatus.DISABLED, model.support().enabled()); + Assertions.assertEquals("hxh", model.support().markdown()); + Assertions.assertEquals("ejk", model.extendedProperties().get("tynqgoul")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabResourceCostPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabResourceCostPropertiesTests.java index 768032aed487..e9ef07d2f96c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabResourceCostPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabResourceCostPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,39 +12,16 @@ public final class LabResourceCostPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LabResourceCostProperties model = BinaryData.fromString( - "{\"resourcename\":\"pcirelsfeaen\",\"resourceUId\":\"bfatklddxbjhwu\",\"resourceCost\":20.55939152853852,\"resourceType\":\"jos\",\"resourceOwner\":\"youlp\",\"resourcePricingTier\":\"v\",\"resourceStatus\":\"glrvimjwosytxi\",\"resourceId\":\"skfc\",\"externalResourceId\":\"qumiek\"}") + "{\"resourcename\":\"ngitvgbmhrixkwm\",\"resourceUId\":\"jejveg\",\"resourceCost\":85.86577647057891,\"resourceType\":\"aixexccbdreaxh\",\"resourceOwner\":\"xdrrvqahqkghtp\",\"resourcePricingTier\":\"jnhyjsvf\",\"resourceStatus\":\"xzb\",\"resourceId\":\"oowvrv\",\"externalResourceId\":\"gjqppy\"}") .toObject(LabResourceCostProperties.class); - Assertions.assertEquals("pcirelsfeaen", model.resourcename()); - Assertions.assertEquals("bfatklddxbjhwu", model.resourceUId()); - Assertions.assertEquals(20.55939152853852D, model.resourceCost()); - Assertions.assertEquals("jos", model.resourceType()); - Assertions.assertEquals("youlp", model.resourceOwner()); - Assertions.assertEquals("v", model.resourcePricingTier()); - Assertions.assertEquals("glrvimjwosytxi", model.resourceStatus()); - Assertions.assertEquals("skfc", model.resourceId()); - Assertions.assertEquals("qumiek", model.externalResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LabResourceCostProperties model = new LabResourceCostProperties().withResourcename("pcirelsfeaen") - .withResourceUId("bfatklddxbjhwu") - .withResourceCost(20.55939152853852D) - .withResourceType("jos") - .withResourceOwner("youlp") - .withResourcePricingTier("v") - .withResourceStatus("glrvimjwosytxi") - .withResourceId("skfc") - .withExternalResourceId("qumiek"); - model = BinaryData.fromObject(model).toObject(LabResourceCostProperties.class); - Assertions.assertEquals("pcirelsfeaen", model.resourcename()); - Assertions.assertEquals("bfatklddxbjhwu", model.resourceUId()); - Assertions.assertEquals(20.55939152853852D, model.resourceCost()); - Assertions.assertEquals("jos", model.resourceType()); - Assertions.assertEquals("youlp", model.resourceOwner()); - Assertions.assertEquals("v", model.resourcePricingTier()); - Assertions.assertEquals("glrvimjwosytxi", model.resourceStatus()); - Assertions.assertEquals("skfc", model.resourceId()); - Assertions.assertEquals("qumiek", model.externalResourceId()); + Assertions.assertEquals("ngitvgbmhrixkwm", model.resourcename()); + Assertions.assertEquals("jejveg", model.resourceUId()); + Assertions.assertEquals(85.86577647057891D, model.resourceCost()); + Assertions.assertEquals("aixexccbdreaxh", model.resourceType()); + Assertions.assertEquals("xdrrvqahqkghtp", model.resourceOwner()); + Assertions.assertEquals("jnhyjsvf", model.resourcePricingTier()); + Assertions.assertEquals("xzb", model.resourceStatus()); + Assertions.assertEquals("oowvrv", model.resourceId()); + Assertions.assertEquals("gjqppy", model.externalResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabSupportPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabSupportPropertiesTests.java index 612cf6f85563..764f25535e47 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabSupportPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabSupportPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,18 +12,17 @@ public final class LabSupportPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LabSupportProperties model = BinaryData.fromString("{\"enabled\":\"Disabled\",\"markdown\":\"jugwdkcglhsl\"}") + LabSupportProperties model = BinaryData.fromString("{\"enabled\":\"Enabled\",\"markdown\":\"ol\"}") .toObject(LabSupportProperties.class); - Assertions.assertEquals(EnableStatus.DISABLED, model.enabled()); - Assertions.assertEquals("jugwdkcglhsl", model.markdown()); + Assertions.assertEquals(EnableStatus.ENABLED, model.enabled()); + Assertions.assertEquals("ol", model.markdown()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LabSupportProperties model - = new LabSupportProperties().withEnabled(EnableStatus.DISABLED).withMarkdown("jugwdkcglhsl"); + LabSupportProperties model = new LabSupportProperties().withEnabled(EnableStatus.ENABLED).withMarkdown("ol"); model = BinaryData.fromObject(model).toObject(LabSupportProperties.class); - Assertions.assertEquals(EnableStatus.DISABLED, model.enabled()); - Assertions.assertEquals("jugwdkcglhsl", model.markdown()); + Assertions.assertEquals(EnableStatus.ENABLED, model.enabled()); + Assertions.assertEquals("ol", model.markdown()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabVhdInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabVhdInnerTests.java index 78c5d73845f8..9528a4c0af1c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabVhdInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabVhdInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,14 +11,7 @@ public final class LabVhdInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LabVhdInner model = BinaryData.fromString("{\"id\":\"krtt\"}").toObject(LabVhdInner.class); - Assertions.assertEquals("krtt", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LabVhdInner model = new LabVhdInner().withId("krtt"); - model = BinaryData.fromObject(model).toObject(LabVhdInner.class); - Assertions.assertEquals("krtt", model.id()); + LabVhdInner model = BinaryData.fromString("{\"id\":\"ocohslkevleg\"}").toObject(LabVhdInner.class); + Assertions.assertEquals("ocohslkevleg", model.id()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabVhdListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabVhdListTests.java index 956c1031cf1a..916c2a4c4f2a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabVhdListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabVhdListTests.java @@ -1,30 +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.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.LabVhdInner; -import com.azure.resourcemanager.devtestlabs.models.LabVhdList; -import java.util.Arrays; +import com.azure.resourcemanager.devtestlabs.implementation.models.LabVhdList; import org.junit.jupiter.api.Assertions; public final class LabVhdListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LabVhdList model = BinaryData.fromString("{\"value\":[{\"id\":\"x\"}],\"nextLink\":\"akxcptsoqfyiaseq\"}") - .toObject(LabVhdList.class); - Assertions.assertEquals("x", model.value().get(0).id()); - Assertions.assertEquals("akxcptsoqfyiaseq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { LabVhdList model - = new LabVhdList().withValue(Arrays.asList(new LabVhdInner().withId("x"))).withNextLink("akxcptsoqfyiaseq"); - model = BinaryData.fromObject(model).toObject(LabVhdList.class); - Assertions.assertEquals("x", model.value().get(0).id()); - Assertions.assertEquals("akxcptsoqfyiaseq", model.nextLink()); + = BinaryData.fromString("{\"value\":[{\"id\":\"xc\"}],\"nextLink\":\"npc\"}").toObject(LabVhdList.class); + Assertions.assertEquals("xc", model.value().get(0).id()); + Assertions.assertEquals("npc", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabVirtualMachineFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabVirtualMachineFragmentTests.java index 27650f16d514..9f777383a0bc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabVirtualMachineFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabVirtualMachineFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,16 +13,18 @@ public final class LabVirtualMachineFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LabVirtualMachineFragment model = BinaryData.fromString("{\"tags\":{\"hgbvqtan\":\"hgwydyynfsv\"}}") + LabVirtualMachineFragment model = BinaryData.fromString( + "{\"tags\":{\"rexcrseqwjksghu\":\"rqbrjbbmpxdlvyk\",\"ggsvoujkxibdaf\":\"gzhxog\",\"xfbvfb\":\"rkmdyom\",\"rhpw\":\"dy\"}}") .toObject(LabVirtualMachineFragment.class); - Assertions.assertEquals("hgwydyynfsv", model.tags().get("hgbvqtan")); + Assertions.assertEquals("rqbrjbbmpxdlvyk", model.tags().get("rexcrseqwjksghu")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LabVirtualMachineFragment model = new LabVirtualMachineFragment().withTags(mapOf("hgbvqtan", "hgwydyynfsv")); + LabVirtualMachineFragment model = new LabVirtualMachineFragment().withTags( + mapOf("rexcrseqwjksghu", "rqbrjbbmpxdlvyk", "ggsvoujkxibdaf", "gzhxog", "xfbvfb", "rkmdyom", "rhpw", "dy")); model = BinaryData.fromObject(model).toObject(LabVirtualMachineFragment.class); - Assertions.assertEquals("hgwydyynfsv", model.tags().get("hgbvqtan")); + Assertions.assertEquals("rqbrjbbmpxdlvyk", model.tags().get("rexcrseqwjksghu")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmMockTests.java index 123cd6b8e091..31f75f913bf4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testClaimAnyVm() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.labs().claimAnyVm("ftabenbbklqp", "zucafeddww", com.azure.core.util.Context.NONE); + manager.labs().claimAnyVm("rsxkr", "lbjazejww", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateMockTests.java index ae9044f0ed87..fbb1bafdf2e1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -30,49 +30,51 @@ public final class LabsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"defaultStorageAccount\":\"ssmzhhkuui\",\"defaultPremiumStorageAccount\":\"dqq\",\"artifactsStorageAccount\":\"ekvalblhtjq\",\"premiumDataDiskStorageAccount\":\"yvwehtaemxh\",\"vaultName\":\"ysev\",\"labStorageType\":\"Premium\",\"mandatoryArtifactsResourceIdsLinux\":[\"zrrryv\",\"imipskdyzatvfuz\",\"aftjvvruxwigsy\"],\"mandatoryArtifactsResourceIdsWindows\":[\"qdsmjtg\"],\"createdDate\":\"2021-09-30T03:29:26Z\",\"premiumDataDisks\":\"Enabled\",\"environmentPermission\":\"Contributor\",\"announcement\":{\"title\":\"eplkcsm\",\"markdown\":\"hwtbbaedorvvm\",\"enabled\":\"Enabled\",\"expirationDate\":\"2021-07-17T03:29:04Z\",\"expired\":true,\"provisioningState\":\"gwumgxdgdhpa\",\"uniqueIdentifier\":\"dexjddvjs\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"mmwllc\"},\"vmCreationResourceGroup\":\"srsxaptefh\",\"publicIpId\":\"cgjokjljnhvlq\",\"loadBalancerId\":\"ek\",\"networkSecurityGroupId\":\"eksnbksdqhjvyk\",\"extendedProperties\":{\"hhus\":\"sl\"},\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"vnwqjwgo\"},\"location\":\"nlejjjkxybwf\",\"tags\":{\"vkzykjtjknsxf\":\"jbzten\",\"cdp\":\"us\",\"kuwxeoiojfizfavk\":\"upnqrmgjfb\",\"fwxrzxmdew\":\"zwfbcyaykmmfzs\"},\"id\":\"rsxkr\",\"name\":\"lbjazejww\",\"type\":\"iyoypsuhbrnnhj\"}"; + = "{\"properties\":{\"defaultStorageAccount\":\"yurnpnuhzafc\",\"defaultPremiumStorageAccount\":\"uhiigbyl\",\"artifactsStorageAccount\":\"igvxvatvcrk\",\"premiumDataDiskStorageAccount\":\"b\",\"vaultName\":\"qxvhcsyhzlwxa\",\"labStorageType\":\"Premium\",\"mandatoryArtifactsResourceIdsLinux\":[\"rexdndsbd\"],\"mandatoryArtifactsResourceIdsWindows\":[\"derzmwnto\",\"agttm\"],\"createdDate\":\"2021-03-24T23:25Z\",\"premiumDataDisks\":\"Enabled\",\"environmentPermission\":\"Contributor\",\"announcement\":{\"title\":\"lkjztjiuazjc\",\"markdown\":\"xitp\",\"enabled\":\"Disabled\",\"expirationDate\":\"2021-10-20T21:45:11Z\",\"expired\":false,\"provisioningState\":\"tkrlgjmtbd\",\"uniqueIdentifier\":\"cqguef\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"heqdurelyujlfyou\"},\"vmCreationResourceGroup\":\"ckyeclcdigpta\",\"publicIpId\":\"rzmq\",\"loadBalancerId\":\"cycijoclxiut\",\"networkSecurityGroupId\":\"cyzyzjdnrqjbt\",\"extendedProperties\":{\"atbwbqam\":\"aoqaqbzgyhfwwv\",\"liys\":\"e\",\"uxx\":\"pkcvmwf\"},\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"rmcqmiciijqpkz\"},\"tags\":{\"xv\":\"jxjmcsmyqw\",\"alickduoi\":\"pwnkwywzwo\",\"kn\":\"tamtyv\",\"cfhzagxnvhycv\":\"rwzawnvs\"},\"location\":\"mwrzregzgyufutrw\",\"id\":\"eryekzkdhmeottaw\",\"name\":\"yos\",\"type\":\"wwhnhjtfvpn\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Lab response = manager.labs() - .define("jjk") - .withRegion("usybwptdaca") - .withExistingResourceGroup("y") - .withTags(mapOf("tymtpoiwenazer", "lf")) - .withLabStorageType(StorageType.STANDARD) - .withMandatoryArtifactsResourceIdsLinux(Arrays.asList("ovwmbjlzqsczpgvd", "napfdqwowftpt", "uwjtks", "h")) - .withMandatoryArtifactsResourceIdsWindows(Arrays.asList("qyhleseyq")) - .withPremiumDataDisks(PremiumDataDisk.DISABLED) - .withEnvironmentPermission(EnvironmentPermission.READER) - .withAnnouncement(new LabAnnouncementProperties().withTitle("jv") - .withMarkdown("wiswskukjtasbvw") - .withEnabled(EnableStatus.DISABLED) - .withExpirationDate(OffsetDateTime.parse("2021-09-30T12:44:35Z")) + .define("ke") + .withExistingResourceGroup("xzcwxhmpejt") + .withRegion("iilialwc") + .withTags( + mapOf("ztjofqcvovjufyc", "dsxzakuejkmvb", "gthortudaw", "jmlbemyejiriux", "qerpptcbgqnzm", "pjfe")) + .withLabStorageType(StorageType.STANDARD_SSD) + .withMandatoryArtifactsResourceIdsLinux( + Arrays.asList("mgzvyfi", "dkz", "qnwsithuqolyah", "uqwqulsutrjbhxyk")) + .withMandatoryArtifactsResourceIdsWindows(Arrays.asList("qezv")) + .withPremiumDataDisks(PremiumDataDisk.ENABLED) + .withEnvironmentPermission(EnvironmentPermission.CONTRIBUTOR) + .withAnnouncement(new LabAnnouncementProperties().withTitle("cvexreuqu") + .withMarkdown("tljvfwhreagkhyx") + .withEnabled(EnableStatus.ENABLED) + .withExpirationDate(OffsetDateTime.parse("2021-03-22T08:14:33Z")) .withExpired(true)) - .withSupport(new LabSupportProperties().withEnabled(EnableStatus.DISABLED).withMarkdown("yw")) - .withExtendedProperties(mapOf("n", "dwckygroe", "req", "dljdjuskb")) + .withSupport(new LabSupportProperties().withEnabled(EnableStatus.DISABLED).withMarkdown("sa")) + .withExtendedProperties(mapOf("rgdg", "gjfoknubnoitpkpz", "we", "vcoqraswugyxpqi", "z", "alwvskbu")) .create(); - Assertions.assertEquals("nlejjjkxybwf", response.location()); - Assertions.assertEquals("jbzten", response.tags().get("vkzykjtjknsxf")); + Assertions.assertEquals("jxjmcsmyqw", response.tags().get("xv")); + Assertions.assertEquals("mwrzregzgyufutrw", response.location()); Assertions.assertEquals(StorageType.PREMIUM, response.labStorageType()); - Assertions.assertEquals("zrrryv", response.mandatoryArtifactsResourceIdsLinux().get(0)); - Assertions.assertEquals("qdsmjtg", response.mandatoryArtifactsResourceIdsWindows().get(0)); + Assertions.assertEquals("rexdndsbd", response.mandatoryArtifactsResourceIdsLinux().get(0)); + Assertions.assertEquals("derzmwnto", response.mandatoryArtifactsResourceIdsWindows().get(0)); Assertions.assertEquals(PremiumDataDisk.ENABLED, response.premiumDataDisks()); Assertions.assertEquals(EnvironmentPermission.CONTRIBUTOR, response.environmentPermission()); - Assertions.assertEquals("eplkcsm", response.announcement().title()); - Assertions.assertEquals("hwtbbaedorvvm", response.announcement().markdown()); - Assertions.assertEquals(EnableStatus.ENABLED, response.announcement().enabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-17T03:29:04Z"), response.announcement().expirationDate()); - Assertions.assertEquals(true, response.announcement().expired()); + Assertions.assertEquals("lkjztjiuazjc", response.announcement().title()); + Assertions.assertEquals("xitp", response.announcement().markdown()); + Assertions.assertEquals(EnableStatus.DISABLED, response.announcement().enabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-20T21:45:11Z"), response.announcement().expirationDate()); + Assertions.assertFalse(response.announcement().expired()); Assertions.assertEquals(EnableStatus.ENABLED, response.support().enabled()); - Assertions.assertEquals("mmwllc", response.support().markdown()); - Assertions.assertEquals("sl", response.extendedProperties().get("hhus")); + Assertions.assertEquals("heqdurelyujlfyou", response.support().markdown()); + Assertions.assertEquals("aoqaqbzgyhfwwv", response.extendedProperties().get("atbwbqam")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteMockTests.java index 54a976c75b69..bbe0d3a32838 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.labs().delete("utgqztwh", "hmupgxyjtcdxabbu", com.azure.core.util.Context.NONE); + manager.labs().delete("kyrdnqodx", "hhxhq", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageMockTests.java index 970195761761..15490db819b8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ExportResourceUsageParameters; @@ -26,12 +26,12 @@ public void testExportResourceUsage() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.labs() - .exportResourceUsage("xptlghwzho", "ewj", - new ExportResourceUsageParameters().withBlobStorageAbsoluteSasUri("tl") - .withUsageStartDate(OffsetDateTime.parse("2021-01-04T12:30:58Z")), + .exportResourceUsage("evxrhyz", "fwrsofpltdbmair", + new ExportResourceUsageParameters().withBlobStorageAbsoluteSasUri("vhfn") + .withUsageStartDate(OffsetDateTime.parse("2021-01-05T11:13:50Z")), com.azure.core.util.Context.NONE); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriWithResponseMockTests.java index 2a223d2196a8..73980c134b29 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriParameter; @@ -21,20 +21,20 @@ public final class LabsGenerateUploadUriWithResponseMockTests { @Test public void testGenerateUploadUriWithResponse() throws Exception { - String responseStr = "{\"uploadUri\":\"xiwkgfbql\"}"; + String responseStr = "{\"uploadUri\":\"bjb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); GenerateUploadUriResponse response = manager.labs() - .generateUploadUriWithResponse("qawmoaianc", "nvodrrs", - new GenerateUploadUriParameter().withBlobName("lxydkxrxv"), com.azure.core.util.Context.NONE) + .generateUploadUriWithResponse("npq", "g", new GenerateUploadUriParameter().withBlobName("ujwouhdawsi"), + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("xiwkgfbql", response.uploadUri()); + Assertions.assertEquals("bjb", response.uploadUri()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupWithResponseMockTests.java index 8c4a334fcded..605b17974be4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -25,33 +25,33 @@ public final class LabsGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"defaultStorageAccount\":\"mkfqlwxldy\",\"defaultPremiumStorageAccount\":\"lsygaol\",\"artifactsStorageAccount\":\"pnnbm\",\"premiumDataDiskStorageAccount\":\"sibjgs\",\"vaultName\":\"xxahmrnadzyqegxy\",\"labStorageType\":\"StandardSSD\",\"mandatoryArtifactsResourceIdsLinux\":[\"bmh\"],\"mandatoryArtifactsResourceIdsWindows\":[\"ijkgqxnhm\",\"keznjaujvaa\",\"nggiycwkdtaa\",\"xw\"],\"createdDate\":\"2021-10-08T13:52:04Z\",\"premiumDataDisks\":\"Enabled\",\"environmentPermission\":\"Contributor\",\"announcement\":{\"title\":\"mbzmqk\",\"markdown\":\"tbnxwbjsid\",\"enabled\":\"Enabled\",\"expirationDate\":\"2020-12-26T13:23:10Z\",\"expired\":false,\"provisioningState\":\"okdgoge\",\"uniqueIdentifier\":\"jymrhbg\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"yewnfnzhhhqos\"},\"vmCreationResourceGroup\":\"fjkutycyarnroo\",\"publicIpId\":\"uabzoghkt\",\"loadBalancerId\":\"yczhco\",\"networkSecurityGroupId\":\"cnhz\",\"extendedProperties\":{\"rl\":\"ttjzcfyjzpt\"},\"provisioningState\":\"apqinf\",\"uniqueIdentifier\":\"pyglqdhmrjzral\"},\"location\":\"xpjb\",\"tags\":{\"xfxjelgcmpzqj\":\"sjoqcjenkyhfqzvs\",\"s\":\"hhqxuwyvcacoyviv\",\"bscm\":\"zusjsz\"},\"id\":\"lzijiufehgmvflnw\",\"name\":\"v\",\"type\":\"kxrerlniylylyfwx\"}"; + = "{\"properties\":{\"defaultStorageAccount\":\"nbm\",\"defaultPremiumStorageAccount\":\"bjijkgqxnh\",\"artifactsStorageAccount\":\"keznjaujvaa\",\"premiumDataDiskStorageAccount\":\"ggiycwkdtaawxwf\",\"vaultName\":\"aumrrqmbzmqkrat\",\"labStorageType\":\"Standard\",\"mandatoryArtifactsResourceIdsLinux\":[\"jsi\",\"birkfpksokdg\"],\"mandatoryArtifactsResourceIdsWindows\":[\"wijymr\",\"bguzozky\",\"wnf\"],\"createdDate\":\"2021-06-15T03:53:03Z\",\"premiumDataDisks\":\"Disabled\",\"environmentPermission\":\"Reader\",\"announcement\":{\"title\":\"ffjkutycyarnroo\",\"markdown\":\"uabzoghkt\",\"enabled\":\"Enabled\",\"expirationDate\":\"2021-02-16T09:38:20Z\",\"expired\":false,\"provisioningState\":\"eocnhzqrottj\",\"uniqueIdentifier\":\"fyjzptwr\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"qinfszpyglqd\"},\"vmCreationResourceGroup\":\"rjzralcx\",\"publicIpId\":\"byypsjoqcjenky\",\"loadBalancerId\":\"qzvs\",\"networkSecurityGroupId\":\"fxjelg\",\"extendedProperties\":{\"oyvivbsiz\":\"zqjhhhqxuwyvca\",\"bscm\":\"sjsz\"},\"provisioningState\":\"zijiufehgmv\",\"uniqueIdentifier\":\"nwyvq\"},\"tags\":{\"zutgqztwhghmupg\":\"erlniylylyfw\",\"nbbklqpxzucafed\":\"yjtcdxabbujftab\"},\"location\":\"wnlzafwxu\",\"id\":\"nhgookrtalvnbw\",\"name\":\"pbeme\",\"type\":\"uclvdjj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Lab response = manager.labs() - .getByResourceGroupWithResponse("lcouqehbhbcdszir", "randoypmb", "t", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("ad", "yqegx", "iv", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("xpjb", response.location()); - Assertions.assertEquals("sjoqcjenkyhfqzvs", response.tags().get("xfxjelgcmpzqj")); - Assertions.assertEquals(StorageType.STANDARD_SSD, response.labStorageType()); - Assertions.assertEquals("bmh", response.mandatoryArtifactsResourceIdsLinux().get(0)); - Assertions.assertEquals("ijkgqxnhm", response.mandatoryArtifactsResourceIdsWindows().get(0)); - Assertions.assertEquals(PremiumDataDisk.ENABLED, response.premiumDataDisks()); - Assertions.assertEquals(EnvironmentPermission.CONTRIBUTOR, response.environmentPermission()); - Assertions.assertEquals("mbzmqk", response.announcement().title()); - Assertions.assertEquals("tbnxwbjsid", response.announcement().markdown()); + Assertions.assertEquals("erlniylylyfw", response.tags().get("zutgqztwhghmupg")); + Assertions.assertEquals("wnlzafwxu", response.location()); + Assertions.assertEquals(StorageType.STANDARD, response.labStorageType()); + Assertions.assertEquals("jsi", response.mandatoryArtifactsResourceIdsLinux().get(0)); + Assertions.assertEquals("wijymr", response.mandatoryArtifactsResourceIdsWindows().get(0)); + Assertions.assertEquals(PremiumDataDisk.DISABLED, response.premiumDataDisks()); + Assertions.assertEquals(EnvironmentPermission.READER, response.environmentPermission()); + Assertions.assertEquals("ffjkutycyarnroo", response.announcement().title()); + Assertions.assertEquals("uabzoghkt", response.announcement().markdown()); Assertions.assertEquals(EnableStatus.ENABLED, response.announcement().enabled()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-26T13:23:10Z"), response.announcement().expirationDate()); - Assertions.assertEquals(false, response.announcement().expired()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T09:38:20Z"), response.announcement().expirationDate()); + Assertions.assertFalse(response.announcement().expired()); Assertions.assertEquals(EnableStatus.ENABLED, response.support().enabled()); - Assertions.assertEquals("yewnfnzhhhqos", response.support().markdown()); - Assertions.assertEquals("ttjzcfyjzpt", response.extendedProperties().get("rl")); + Assertions.assertEquals("qinfszpyglqd", response.support().markdown()); + Assertions.assertEquals("zqjhhhqxuwyvca", response.extendedProperties().get("oyvivbsiz")); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineMockTests.java index d8ddcad8f139..b38624797979 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ImportLabVirtualMachineRequest; @@ -26,12 +26,12 @@ public void testImportVirtualMachine() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.labs() - .importVirtualMachine("nqkhych", "c", - new ImportLabVirtualMachineRequest().withSourceVirtualMachineResourceId("ulehurqlr") - .withDestinationVirtualMachineName("fawey"), + .importVirtualMachine("sjybvitv", "kjyaznumtg", + new ImportLabVirtualMachineRequest().withSourceVirtualMachineResourceId("uwdchozf") + .withDestinationVirtualMachineName("fexl"), com.azure.core.util.Context.NONE); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupMockTests.java index ae6d2e94643c..0e57c216db98 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -26,34 +26,34 @@ public final class LabsListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"defaultStorageAccount\":\"xnafbw\",\"defaultPremiumStorageAccount\":\"oohtuovmaonurjtu\",\"artifactsStorageAccount\":\"hihpvecmsl\",\"premiumDataDiskStorageAccount\":\"bl\",\"vaultName\":\"xltbsjuscvsf\",\"labStorageType\":\"Premium\",\"mandatoryArtifactsResourceIdsLinux\":[\"mgxuupbezqcc\",\"drtc\",\"ukdqkkyihztg\",\"qm\"],\"mandatoryArtifactsResourceIdsWindows\":[\"gwldo\",\"chillcecf\",\"huwaoaguhic\",\"llizs\"],\"createdDate\":\"2021-05-20T02:42:18Z\",\"premiumDataDisks\":\"Disabled\",\"environmentPermission\":\"Reader\",\"announcement\":{\"title\":\"eftkwqe\",\"markdown\":\"mvss\",\"enabled\":\"Disabled\",\"expirationDate\":\"2021-01-17T18:10:52Z\",\"expired\":false,\"provisioningState\":\"cxtczhupeukn\",\"uniqueIdentifier\":\"d\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"pydjfboc\"},\"vmCreationResourceGroup\":\"hhulrtywikdm\",\"publicIpId\":\"akuflgbhgauacdix\",\"loadBalancerId\":\"ufr\",\"networkSecurityGroupId\":\"yjq\",\"extendedProperties\":{\"efgwbmqjc\":\"fnozoeoqbvjh\",\"pzealbmqkyojw\":\"ntasfaymxbu\",\"mbtsuahxsg\":\"vf\"},\"provisioningState\":\"cmmzrrs\",\"uniqueIdentifier\":\"biwsd\"},\"location\":\"npxqwodi\",\"tags\":{\"muabwibvjogjonmc\":\"xcjr\",\"oyzbamwineofvf\":\"e\",\"lz\":\"akpoldtvevbo\",\"ttxpnrupza\":\"zjknyuxg\"},\"id\":\"mrdixtreki\",\"name\":\"swyskbruffg\",\"type\":\"lukkutvlxhrpqhvm\"}]}"; + = "{\"value\":[{\"properties\":{\"defaultStorageAccount\":\"hqawmo\",\"defaultPremiumStorageAccount\":\"ancz\",\"artifactsStorageAccount\":\"odrrslblxyd\",\"premiumDataDiskStorageAccount\":\"rxvvbxi\",\"vaultName\":\"g\",\"labStorageType\":\"Standard\",\"mandatoryArtifactsResourceIdsLinux\":[\"nqkhych\",\"c\"],\"mandatoryArtifactsResourceIdsWindows\":[\"lehu\",\"qlrqffaweyurk\",\"hy\"],\"createdDate\":\"2021-09-22T18:28:29Z\",\"premiumDataDisks\":\"Disabled\",\"environmentPermission\":\"Reader\",\"announcement\":{\"title\":\"dbrxmrgc\",\"markdown\":\"apx\",\"enabled\":\"Enabled\",\"expirationDate\":\"2021-05-21T11:02:57Z\",\"expired\":false,\"provisioningState\":\"ajb\",\"uniqueIdentifier\":\"cgduusio\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"vpmclujyxkyxlz\"},\"vmCreationResourceGroup\":\"jgkz\",\"publicIpId\":\"taf\",\"loadBalancerId\":\"zffovwmbjl\",\"networkSecurityGroupId\":\"sczpgvdwnapfd\",\"extendedProperties\":{\"ptnuwjtkschgc\":\"wf\",\"hvyeldotj\":\"qyhleseyq\",\"kukjtasb\":\"dkwisw\",\"txfkndlqvt\":\"wispkxk\"},\"provisioningState\":\"nvgmmbugtywa\",\"uniqueIdentifier\":\"qaqkuea\"},\"tags\":{\"kfaoytehq\":\"oeshoygzcbyfq\",\"mtdwcky\":\"uvjmv\",\"djus\":\"roejnndl\"},\"location\":\"rreqynkceysfaqe\",\"id\":\"lwryshwddkvbxgkq\",\"name\":\"sybwptdaca\",\"type\":\"vvlfntymtp\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.labs() - .listByResourceGroup("ewdogiyetesy", "vidbztjhqtfb", "vnynkb", 885021040, "tnjuhpsprkzyaupi", + .listByResourceGroup("aqnvzoqgyipemchg", "v", "czuejdtxptl", 264851249, "wzhomewjjstl", com.azure.core.util.Context.NONE); - Assertions.assertEquals("npxqwodi", response.iterator().next().location()); - Assertions.assertEquals("xcjr", response.iterator().next().tags().get("muabwibvjogjonmc")); - Assertions.assertEquals(StorageType.PREMIUM, response.iterator().next().labStorageType()); - Assertions.assertEquals("mgxuupbezqcc", response.iterator().next().mandatoryArtifactsResourceIdsLinux().get(0)); - Assertions.assertEquals("gwldo", response.iterator().next().mandatoryArtifactsResourceIdsWindows().get(0)); + Assertions.assertEquals("oeshoygzcbyfq", response.iterator().next().tags().get("kfaoytehq")); + Assertions.assertEquals("rreqynkceysfaqe", response.iterator().next().location()); + Assertions.assertEquals(StorageType.STANDARD, response.iterator().next().labStorageType()); + Assertions.assertEquals("nqkhych", response.iterator().next().mandatoryArtifactsResourceIdsLinux().get(0)); + Assertions.assertEquals("lehu", response.iterator().next().mandatoryArtifactsResourceIdsWindows().get(0)); Assertions.assertEquals(PremiumDataDisk.DISABLED, response.iterator().next().premiumDataDisks()); Assertions.assertEquals(EnvironmentPermission.READER, response.iterator().next().environmentPermission()); - Assertions.assertEquals("eftkwqe", response.iterator().next().announcement().title()); - Assertions.assertEquals("mvss", response.iterator().next().announcement().markdown()); - Assertions.assertEquals(EnableStatus.DISABLED, response.iterator().next().announcement().enabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-17T18:10:52Z"), + Assertions.assertEquals("dbrxmrgc", response.iterator().next().announcement().title()); + Assertions.assertEquals("apx", response.iterator().next().announcement().markdown()); + Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().announcement().enabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T11:02:57Z"), response.iterator().next().announcement().expirationDate()); - Assertions.assertEquals(false, response.iterator().next().announcement().expired()); + Assertions.assertFalse(response.iterator().next().announcement().expired()); Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().support().enabled()); - Assertions.assertEquals("pydjfboc", response.iterator().next().support().markdown()); - Assertions.assertEquals("fnozoeoqbvjh", response.iterator().next().extendedProperties().get("efgwbmqjc")); + Assertions.assertEquals("vpmclujyxkyxlz", response.iterator().next().support().markdown()); + Assertions.assertEquals("wf", response.iterator().next().extendedProperties().get("ptnuwjtkschgc")); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsListMockTests.java index d763eb196ca5..a96f3154e3d2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -26,34 +26,33 @@ public final class LabsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"defaultStorageAccount\":\"uuvbx\",\"defaultPremiumStorageAccount\":\"rebwggahtt\",\"artifactsStorageAccount\":\"swvajqfu\",\"premiumDataDiskStorageAccount\":\"x\",\"vaultName\":\"qzasunwqrjzfrgqh\",\"labStorageType\":\"StandardSSD\",\"mandatoryArtifactsResourceIdsLinux\":[\"buocnjr\",\"hmbpyryxamebly\",\"yvk\",\"kmrocxne\"],\"mandatoryArtifactsResourceIdsWindows\":[\"mtodl\"],\"createdDate\":\"2021-05-01T05:25:27Z\",\"premiumDataDisks\":\"Enabled\",\"environmentPermission\":\"Contributor\",\"announcement\":{\"title\":\"voavyunssxl\",\"markdown\":\"ieegjl\",\"enabled\":\"Disabled\",\"expirationDate\":\"2021-02-19T16:42:25Z\",\"expired\":true,\"provisioningState\":\"sgb\",\"uniqueIdentifier\":\"antuygdhgaqipirp\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"fulopmjnlexwhcb\"},\"vmCreationResourceGroup\":\"ibkeph\",\"publicIpId\":\"uerct\",\"loadBalancerId\":\"oyin\",\"networkSecurityGroupId\":\"pbrlcyrduczkgofx\",\"extendedProperties\":{\"vjeaqnrmvvfkoxml\":\"rucvcrrpcjttbs\",\"lpdwwexymzvlazi\":\"hktuidvrma\",\"uzivensrpmeyyvp\":\"bhpwvqsgnyy\",\"gsksrfhf\":\"patlbijp\"},\"provisioningState\":\"lmknbnxwcdom\",\"uniqueIdentifier\":\"vfqawzfgbrttuiac\"},\"location\":\"kiexhajlfnthiq\",\"tags\":{\"diygbpvnwswmtxky\":\"t\",\"l\":\"twwgzwx\",\"ygzyvneezaifght\":\"ecvo\"},\"id\":\"oqqtl\",\"name\":\"fhzbkr\",\"type\":\"jjjavfqnvhnq\"}]}"; + = "{\"value\":[{\"properties\":{\"defaultStorageAccount\":\"ssmzhhkuui\",\"defaultPremiumStorageAccount\":\"dqq\",\"artifactsStorageAccount\":\"ekvalblhtjq\",\"premiumDataDiskStorageAccount\":\"yvwehtaemxh\",\"vaultName\":\"ysev\",\"labStorageType\":\"Premium\",\"mandatoryArtifactsResourceIdsLinux\":[\"zrrryv\",\"imipskdyzatvfuz\",\"aftjvvruxwigsy\"],\"mandatoryArtifactsResourceIdsWindows\":[\"qdsmjtg\"],\"createdDate\":\"2021-09-30T03:29:26Z\",\"premiumDataDisks\":\"Enabled\",\"environmentPermission\":\"Contributor\",\"announcement\":{\"title\":\"eplkcsm\",\"markdown\":\"hwtbbaedorvvm\",\"enabled\":\"Enabled\",\"expirationDate\":\"2021-07-17T03:29:04Z\",\"expired\":true,\"provisioningState\":\"gwumgxdgdhpa\",\"uniqueIdentifier\":\"dexjddvjs\"},\"support\":{\"enabled\":\"Enabled\",\"markdown\":\"mmwllc\"},\"vmCreationResourceGroup\":\"srsxaptefh\",\"publicIpId\":\"cgjokjljnhvlq\",\"loadBalancerId\":\"ek\",\"networkSecurityGroupId\":\"eksnbksdqhjvyk\",\"extendedProperties\":{\"hhus\":\"sl\"},\"provisioningState\":\"poq\",\"uniqueIdentifier\":\"vnwqjwgo\"},\"tags\":{\"jbzten\":\"ejjjkxybwfdb\",\"us\":\"vkzykjtjknsxf\"},\"location\":\"dpkupnqrmgjf\",\"id\":\"kuwxeoiojfizfavk\",\"name\":\"zwfbcyaykmmfzs\",\"type\":\"fwxrzxmdew\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.labs().list("atmzw", "jj", 1651064350, "qtjzmizvgbg", com.azure.core.util.Context.NONE); + = manager.labs().list("iwenazero", "zrsq", 1152478081, "sxkdnwqapfgsdpc", com.azure.core.util.Context.NONE); - Assertions.assertEquals("kiexhajlfnthiq", response.iterator().next().location()); - Assertions.assertEquals("t", response.iterator().next().tags().get("diygbpvnwswmtxky")); - Assertions.assertEquals(StorageType.STANDARD_SSD, response.iterator().next().labStorageType()); - Assertions.assertEquals("buocnjr", response.iterator().next().mandatoryArtifactsResourceIdsLinux().get(0)); - Assertions.assertEquals("mtodl", response.iterator().next().mandatoryArtifactsResourceIdsWindows().get(0)); + Assertions.assertEquals("ejjjkxybwfdb", response.iterator().next().tags().get("jbzten")); + Assertions.assertEquals("dpkupnqrmgjf", response.iterator().next().location()); + Assertions.assertEquals(StorageType.PREMIUM, response.iterator().next().labStorageType()); + Assertions.assertEquals("zrrryv", response.iterator().next().mandatoryArtifactsResourceIdsLinux().get(0)); + Assertions.assertEquals("qdsmjtg", response.iterator().next().mandatoryArtifactsResourceIdsWindows().get(0)); Assertions.assertEquals(PremiumDataDisk.ENABLED, response.iterator().next().premiumDataDisks()); Assertions.assertEquals(EnvironmentPermission.CONTRIBUTOR, response.iterator().next().environmentPermission()); - Assertions.assertEquals("voavyunssxl", response.iterator().next().announcement().title()); - Assertions.assertEquals("ieegjl", response.iterator().next().announcement().markdown()); - Assertions.assertEquals(EnableStatus.DISABLED, response.iterator().next().announcement().enabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-19T16:42:25Z"), + Assertions.assertEquals("eplkcsm", response.iterator().next().announcement().title()); + Assertions.assertEquals("hwtbbaedorvvm", response.iterator().next().announcement().markdown()); + Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().announcement().enabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-17T03:29:04Z"), response.iterator().next().announcement().expirationDate()); - Assertions.assertEquals(true, response.iterator().next().announcement().expired()); + Assertions.assertTrue(response.iterator().next().announcement().expired()); Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().support().enabled()); - Assertions.assertEquals("fulopmjnlexwhcb", response.iterator().next().support().markdown()); - Assertions.assertEquals("rucvcrrpcjttbs", - response.iterator().next().extendedProperties().get("vjeaqnrmvvfkoxml")); + Assertions.assertEquals("mmwllc", response.iterator().next().support().markdown()); + Assertions.assertEquals("sl", response.iterator().next().extendedProperties().get("hhus")); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsMockTests.java index 822b939f7009..5cb03344d7f3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.LabVhd; @@ -21,18 +21,17 @@ public final class LabsListVhdsMockTests { @Test public void testListVhds() throws Exception { - String responseStr = "{\"value\":[{\"id\":\"xk\"}]}"; + String responseStr = "{\"value\":[{\"id\":\"nuwiguyxlykwph\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.labs().listVhds("rkphyjdxr", "vjuqdbrxmrgchb", com.azure.core.util.Context.NONE); + PagedIterable response = manager.labs().listVhds("xn", "akizvoaikna", com.azure.core.util.Context.NONE); - Assertions.assertEquals("xk", response.iterator().next().id()); + Assertions.assertEquals("nuwiguyxlykwph", response.iterator().next().id()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LinuxOsInfoTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LinuxOsInfoTests.java index ee877ffb4236..1864b472c0dc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LinuxOsInfoTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/LinuxOsInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,14 +13,14 @@ public final class LinuxOsInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LinuxOsInfo model - = BinaryData.fromString("{\"linuxOsState\":\"DeprovisionRequested\"}").toObject(LinuxOsInfo.class); - Assertions.assertEquals(LinuxOsState.DEPROVISION_REQUESTED, model.linuxOsState()); + = BinaryData.fromString("{\"linuxOsState\":\"DeprovisionApplied\"}").toObject(LinuxOsInfo.class); + Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, model.linuxOsState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LinuxOsInfo model = new LinuxOsInfo().withLinuxOsState(LinuxOsState.DEPROVISION_REQUESTED); + LinuxOsInfo model = new LinuxOsInfo().withLinuxOsState(LinuxOsState.DEPROVISION_APPLIED); model = BinaryData.fromObject(model).toObject(LinuxOsInfo.class); - Assertions.assertEquals(LinuxOsState.DEPROVISION_REQUESTED, model.linuxOsState()); + Assertions.assertEquals(LinuxOsState.DEPROVISION_APPLIED, model.linuxOsState()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NetworkInterfacePropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NetworkInterfacePropertiesTests.java index 4a1c9f7f15c7..e6e58f2d671b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NetworkInterfacePropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NetworkInterfacePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -16,59 +16,59 @@ public final class NetworkInterfacePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkInterfaceProperties model = BinaryData.fromString( - "{\"virtualNetworkId\":\"exdrrvqahqkg\",\"subnetId\":\"pwijnhy\",\"publicIpAddressId\":\"vfycxzb\",\"publicIpAddress\":\"oowvrv\",\"privateIpAddress\":\"gjqppy\",\"dnsName\":\"tronzmyhgfi\",\"rdpAuthority\":\"sxkm\",\"sshAuthority\":\"a\",\"sharedPublicIpAddressConfiguration\":{\"inboundNatRules\":[{\"transportProtocol\":\"Udp\",\"frontendPort\":1897122560,\"backendPort\":339219254},{\"transportProtocol\":\"Udp\",\"frontendPort\":747215260,\"backendPort\":1781492308},{\"transportProtocol\":\"Udp\",\"frontendPort\":991905690,\"backendPort\":716245940}]}}") + "{\"virtualNetworkId\":\"mpmngnzscxaqwoo\",\"subnetId\":\"cbonqvpk\",\"publicIpAddressId\":\"rxnjeaseipheofl\",\"publicIpAddress\":\"eyy\",\"privateIpAddress\":\"nj\",\"dnsName\":\"lwtgrhpdj\",\"rdpAuthority\":\"umasxazjpq\",\"sshAuthority\":\"gual\",\"sharedPublicIpAddressConfiguration\":{\"inboundNatRules\":[{\"transportProtocol\":\"Tcp\",\"frontendPort\":1671923466,\"backendPort\":2029322855},{\"transportProtocol\":\"Udp\",\"frontendPort\":303390013,\"backendPort\":943978504},{\"transportProtocol\":\"Tcp\",\"frontendPort\":1125077483,\"backendPort\":1742026379}]}}") .toObject(NetworkInterfaceProperties.class); - Assertions.assertEquals("exdrrvqahqkg", model.virtualNetworkId()); - Assertions.assertEquals("pwijnhy", model.subnetId()); - Assertions.assertEquals("vfycxzb", model.publicIpAddressId()); - Assertions.assertEquals("oowvrv", model.publicIpAddress()); - Assertions.assertEquals("gjqppy", model.privateIpAddress()); - Assertions.assertEquals("tronzmyhgfi", model.dnsName()); - Assertions.assertEquals("sxkm", model.rdpAuthority()); - Assertions.assertEquals("a", model.sshAuthority()); - Assertions.assertEquals(TransportProtocol.UDP, + Assertions.assertEquals("mpmngnzscxaqwoo", model.virtualNetworkId()); + Assertions.assertEquals("cbonqvpk", model.subnetId()); + Assertions.assertEquals("rxnjeaseipheofl", model.publicIpAddressId()); + Assertions.assertEquals("eyy", model.publicIpAddress()); + Assertions.assertEquals("nj", model.privateIpAddress()); + Assertions.assertEquals("lwtgrhpdj", model.dnsName()); + Assertions.assertEquals("umasxazjpq", model.rdpAuthority()); + Assertions.assertEquals("gual", model.sshAuthority()); + Assertions.assertEquals(TransportProtocol.TCP, model.sharedPublicIpAddressConfiguration().inboundNatRules().get(0).transportProtocol()); - Assertions.assertEquals(1897122560, + Assertions.assertEquals(1671923466, model.sharedPublicIpAddressConfiguration().inboundNatRules().get(0).frontendPort()); - Assertions.assertEquals(339219254, + Assertions.assertEquals(2029322855, model.sharedPublicIpAddressConfiguration().inboundNatRules().get(0).backendPort()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NetworkInterfaceProperties model = new NetworkInterfaceProperties().withVirtualNetworkId("exdrrvqahqkg") - .withSubnetId("pwijnhy") - .withPublicIpAddressId("vfycxzb") - .withPublicIpAddress("oowvrv") - .withPrivateIpAddress("gjqppy") - .withDnsName("tronzmyhgfi") - .withRdpAuthority("sxkm") - .withSshAuthority("a") + NetworkInterfaceProperties model = new NetworkInterfaceProperties().withVirtualNetworkId("mpmngnzscxaqwoo") + .withSubnetId("cbonqvpk") + .withPublicIpAddressId("rxnjeaseipheofl") + .withPublicIpAddress("eyy") + .withPrivateIpAddress("nj") + .withDnsName("lwtgrhpdj") + .withRdpAuthority("umasxazjpq") + .withSshAuthority("gual") .withSharedPublicIpAddressConfiguration( new SharedPublicIpAddressConfiguration().withInboundNatRules(Arrays.asList( + new InboundNatRule().withTransportProtocol(TransportProtocol.TCP) + .withFrontendPort(1671923466) + .withBackendPort(2029322855), new InboundNatRule().withTransportProtocol(TransportProtocol.UDP) - .withFrontendPort(1897122560) - .withBackendPort(339219254), - new InboundNatRule().withTransportProtocol(TransportProtocol.UDP) - .withFrontendPort(747215260) - .withBackendPort(1781492308), - new InboundNatRule().withTransportProtocol(TransportProtocol.UDP) - .withFrontendPort(991905690) - .withBackendPort(716245940)))); + .withFrontendPort(303390013) + .withBackendPort(943978504), + new InboundNatRule().withTransportProtocol(TransportProtocol.TCP) + .withFrontendPort(1125077483) + .withBackendPort(1742026379)))); model = BinaryData.fromObject(model).toObject(NetworkInterfaceProperties.class); - Assertions.assertEquals("exdrrvqahqkg", model.virtualNetworkId()); - Assertions.assertEquals("pwijnhy", model.subnetId()); - Assertions.assertEquals("vfycxzb", model.publicIpAddressId()); - Assertions.assertEquals("oowvrv", model.publicIpAddress()); - Assertions.assertEquals("gjqppy", model.privateIpAddress()); - Assertions.assertEquals("tronzmyhgfi", model.dnsName()); - Assertions.assertEquals("sxkm", model.rdpAuthority()); - Assertions.assertEquals("a", model.sshAuthority()); - Assertions.assertEquals(TransportProtocol.UDP, + Assertions.assertEquals("mpmngnzscxaqwoo", model.virtualNetworkId()); + Assertions.assertEquals("cbonqvpk", model.subnetId()); + Assertions.assertEquals("rxnjeaseipheofl", model.publicIpAddressId()); + Assertions.assertEquals("eyy", model.publicIpAddress()); + Assertions.assertEquals("nj", model.privateIpAddress()); + Assertions.assertEquals("lwtgrhpdj", model.dnsName()); + Assertions.assertEquals("umasxazjpq", model.rdpAuthority()); + Assertions.assertEquals("gual", model.sshAuthority()); + Assertions.assertEquals(TransportProtocol.TCP, model.sharedPublicIpAddressConfiguration().inboundNatRules().get(0).transportProtocol()); - Assertions.assertEquals(1897122560, + Assertions.assertEquals(1671923466, model.sharedPublicIpAddressConfiguration().inboundNatRules().get(0).frontendPort()); - Assertions.assertEquals(339219254, + Assertions.assertEquals(2029322855, model.sharedPublicIpAddressConfiguration().inboundNatRules().get(0).backendPort()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelFragmentTests.java index b33f62094bb3..f38127148f08 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,16 +13,19 @@ public final class NotificationChannelFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NotificationChannelFragment model - = BinaryData.fromString("{\"tags\":{\"rb\":\"zuruocbgo\"}}").toObject(NotificationChannelFragment.class); - Assertions.assertEquals("zuruocbgo", model.tags().get("rb")); + NotificationChannelFragment model = BinaryData + .fromString( + "{\"tags\":{\"hqyikvy\":\"onkp\",\"vluwmncsttij\":\"auy\",\"vpo\":\"y\",\"huzqgn\":\"krsgsgb\"}}") + .toObject(NotificationChannelFragment.class); + Assertions.assertEquals("onkp", model.tags().get("hqyikvy")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NotificationChannelFragment model = new NotificationChannelFragment().withTags(mapOf("rb", "zuruocbgo")); + NotificationChannelFragment model = new NotificationChannelFragment() + .withTags(mapOf("hqyikvy", "onkp", "vluwmncsttij", "auy", "vpo", "y", "huzqgn", "krsgsgb")); model = BinaryData.fromObject(model).toObject(NotificationChannelFragment.class); - Assertions.assertEquals("zuruocbgo", model.tags().get("rb")); + Assertions.assertEquals("onkp", model.tags().get("hqyikvy")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelInnerTests.java index 7a445a95117d..956ab0b8f931 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -17,35 +17,38 @@ public final class NotificationChannelInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NotificationChannelInner model = BinaryData.fromString( - "{\"properties\":{\"webHookUrl\":\"lrri\",\"emailRecipient\":\"ywdxsmic\",\"notificationLocale\":\"rwfscjfnynszquj\",\"description\":\"dvoqyt\",\"events\":[{\"eventName\":\"AutoShutdown\"}],\"createdDate\":\"2021-09-24T22:06:57Z\",\"provisioningState\":\"gyavu\",\"uniqueIdentifier\":\"thjoxoism\"},\"location\":\"ksbpimlqoljx\",\"tags\":{\"dwl\":\"xxlxsffgcvizq\",\"youpfgfbkj\":\"w\",\"ttsttktlahbqact\":\"bdyhgkfminsgowz\",\"qqqxhrnxrx\":\"tgzukxitmmqt\"},\"id\":\"pjui\",\"name\":\"av\",\"type\":\"k\"}") + "{\"properties\":{\"webHookUrl\":\"mbtrnegvmnvu\",\"emailRecipient\":\"qvldspastjbkkd\",\"notificationLocale\":\"lves\",\"description\":\"jlxr\",\"events\":[{\"eventName\":\"Cost\"},{\"eventName\":\"Cost\"},{\"eventName\":\"Cost\"},{\"eventName\":\"Cost\"}],\"createdDate\":\"2021-05-06T21:23:23Z\",\"provisioningState\":\"lktwkuziycslev\",\"uniqueIdentifier\":\"uztcktyhjtqed\"},\"tags\":{\"rqzz\":\"ulwm\",\"toepryu\":\"rjvpglydzgkrvqee\",\"pzdm\":\"nwy\",\"z\":\"vzvfvaawzqadfl\"},\"location\":\"iglaecx\",\"id\":\"t\",\"name\":\"cokpv\",\"type\":\"mlqtmldgxob\"}") .toObject(NotificationChannelInner.class); - Assertions.assertEquals("ksbpimlqoljx", model.location()); - Assertions.assertEquals("xxlxsffgcvizq", model.tags().get("dwl")); - Assertions.assertEquals("lrri", model.webhookUrl()); - Assertions.assertEquals("ywdxsmic", model.emailRecipient()); - Assertions.assertEquals("rwfscjfnynszquj", model.notificationLocale()); - Assertions.assertEquals("dvoqyt", model.description()); - Assertions.assertEquals(NotificationChannelEventType.AUTO_SHUTDOWN, model.events().get(0).eventName()); + Assertions.assertEquals("ulwm", model.tags().get("rqzz")); + Assertions.assertEquals("iglaecx", model.location()); + Assertions.assertEquals("mbtrnegvmnvu", model.webhookUrl()); + Assertions.assertEquals("qvldspastjbkkd", model.emailRecipient()); + Assertions.assertEquals("lves", model.notificationLocale()); + Assertions.assertEquals("jlxr", model.description()); + Assertions.assertEquals(NotificationChannelEventType.COST, model.events().get(0).eventName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NotificationChannelInner model = new NotificationChannelInner().withLocation("ksbpimlqoljx") - .withTags(mapOf("dwl", "xxlxsffgcvizq", "youpfgfbkj", "w", "ttsttktlahbqact", "bdyhgkfminsgowz", - "qqqxhrnxrx", "tgzukxitmmqt")) - .withWebhookUrl("lrri") - .withEmailRecipient("ywdxsmic") - .withNotificationLocale("rwfscjfnynszquj") - .withDescription("dvoqyt") - .withEvents(Arrays.asList(new Event().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN))); + NotificationChannelInner model = new NotificationChannelInner() + .withTags(mapOf("rqzz", "ulwm", "toepryu", "rjvpglydzgkrvqee", "pzdm", "nwy", "z", "vzvfvaawzqadfl")) + .withLocation("iglaecx") + .withWebhookUrl("mbtrnegvmnvu") + .withEmailRecipient("qvldspastjbkkd") + .withNotificationLocale("lves") + .withDescription("jlxr") + .withEvents(Arrays.asList(new Event().withEventName(NotificationChannelEventType.COST), + new Event().withEventName(NotificationChannelEventType.COST), + new Event().withEventName(NotificationChannelEventType.COST), + new Event().withEventName(NotificationChannelEventType.COST))); model = BinaryData.fromObject(model).toObject(NotificationChannelInner.class); - Assertions.assertEquals("ksbpimlqoljx", model.location()); - Assertions.assertEquals("xxlxsffgcvizq", model.tags().get("dwl")); - Assertions.assertEquals("lrri", model.webhookUrl()); - Assertions.assertEquals("ywdxsmic", model.emailRecipient()); - Assertions.assertEquals("rwfscjfnynszquj", model.notificationLocale()); - Assertions.assertEquals("dvoqyt", model.description()); - Assertions.assertEquals(NotificationChannelEventType.AUTO_SHUTDOWN, model.events().get(0).eventName()); + Assertions.assertEquals("ulwm", model.tags().get("rqzz")); + Assertions.assertEquals("iglaecx", model.location()); + Assertions.assertEquals("mbtrnegvmnvu", model.webhookUrl()); + Assertions.assertEquals("qvldspastjbkkd", model.emailRecipient()); + Assertions.assertEquals("lves", model.notificationLocale()); + Assertions.assertEquals("jlxr", model.description()); + Assertions.assertEquals(NotificationChannelEventType.COST, model.events().get(0).eventName()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelListTests.java index 183cc186b9d7..ad4fab683aeb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelListTests.java @@ -1,83 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.NotificationChannelInner; -import com.azure.resourcemanager.devtestlabs.models.Event; +import com.azure.resourcemanager.devtestlabs.implementation.models.NotificationChannelList; import com.azure.resourcemanager.devtestlabs.models.NotificationChannelEventType; -import com.azure.resourcemanager.devtestlabs.models.NotificationChannelList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class NotificationChannelListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NotificationChannelList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"webHookUrl\":\"ewdjcvbquwrb\",\"emailRecipient\":\"wagohbuffk\",\"notificationLocale\":\"qem\",\"description\":\"hmxtdr\",\"events\":[{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"AutoShutdown\"}],\"createdDate\":\"2021-02-21T18:33:04Z\",\"provisioningState\":\"vewzcj\",\"uniqueIdentifier\":\"m\"},\"location\":\"cpmguaadraufact\",\"tags\":{\"jjziuxxpsh\":\"zov\",\"enr\":\"eekulfgslqubkwd\"},\"id\":\"sutujba\",\"name\":\"pjuohminyfl\",\"type\":\"orwmduvwpklv\"},{\"properties\":{\"webHookUrl\":\"mygdxpgpqch\",\"emailRecipient\":\"zepn\",\"notificationLocale\":\"jcrxgibbdaxcon\",\"description\":\"zauorsuk\",\"events\":[{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"AutoShutdown\"}],\"createdDate\":\"2021-12-08T11:17:35Z\",\"provisioningState\":\"nuuepzlrp\",\"uniqueIdentifier\":\"zsoldwey\"},\"location\":\"qdunvmnnrwrbior\",\"tags\":{\"dnhxmsi\":\"lywjhh\",\"ufiqndieuzaof\":\"fomiloxgg\",\"cubiipuipw\":\"chvcyyysfgdo\"},\"id\":\"qonmacj\",\"name\":\"k\",\"type\":\"izsh\"}],\"nextLink\":\"cimpevfg\"}") + "{\"value\":[{\"properties\":{\"webHookUrl\":\"kynscliqhzv\",\"emailRecipient\":\"nk\",\"notificationLocale\":\"tkubotppn\",\"description\":\"xz\",\"events\":[{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"AutoShutdown\"}],\"createdDate\":\"2021-08-26T20:55:04Z\",\"provisioningState\":\"agtltdhlfkqoj\",\"uniqueIdentifier\":\"kvgtrdcn\"},\"tags\":{\"rnysux\":\"zzsdym\"},\"location\":\"rafwgckhocxvdf\",\"id\":\"wafqroud\",\"name\":\"spave\",\"type\":\"hrv\"},{\"properties\":{\"webHookUrl\":\"unzo\",\"emailRecipient\":\"dhcxgkmoy\",\"notificationLocale\":\"dyuib\",\"description\":\"fdn\",\"events\":[{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"Cost\"},{\"eventName\":\"Cost\"}],\"createdDate\":\"2021-04-13T12:50:29Z\",\"provisioningState\":\"eoisrvhmgor\",\"uniqueIdentifier\":\"ukiscvwmzhw\"},\"tags\":{\"btgn\":\"faxvxil\",\"zqlqhyc\":\"nzeyqxtjj\",\"mieknlraria\":\"vodggxdbee\"},\"location\":\"iuagydwqfbylyrfg\",\"id\":\"gtcojocqwo\",\"name\":\"fnzjvusfzldm\",\"type\":\"zuxylfsbtkadpyso\"},{\"properties\":{\"webHookUrl\":\"btgkbugrjqctoj\",\"emailRecipient\":\"isofieypefojyqd\",\"notificationLocale\":\"u\",\"description\":\"cp\",\"events\":[{\"eventName\":\"Cost\"},{\"eventName\":\"Cost\"},{\"eventName\":\"Cost\"},{\"eventName\":\"Cost\"}],\"createdDate\":\"2021-05-09T21:50:17Z\",\"provisioningState\":\"qtz\",\"uniqueIdentifier\":\"rgnowcjhfgm\"},\"tags\":{\"uqovekqvgqouwif\":\"actxmwoteyowc\"},\"location\":\"pjwyiv\",\"id\":\"kfxcvhrfs\",\"name\":\"huagrttikteusqc\",\"type\":\"kvyklxubyjaffmm\"},{\"properties\":{\"webHookUrl\":\"lcqcuubgqibrt\",\"emailRecipient\":\"metttwgd\",\"notificationLocale\":\"qxihhrmooi\",\"description\":\"seypxiutcxapz\",\"events\":[{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"Cost\"}],\"createdDate\":\"2021-07-24T12:15:08Z\",\"provisioningState\":\"lhvnhlab\",\"uniqueIdentifier\":\"nk\"},\"tags\":{\"xjjs\":\"cjbtrgaehvvib\",\"oobklftidgfcwq\":\"oqbeitpkxzt\"},\"location\":\"imaq\",\"id\":\"hemjy\",\"name\":\"ohu\",\"type\":\"swtwkozzwc\"}],\"nextLink\":\"kb\"}") .toObject(NotificationChannelList.class); - Assertions.assertEquals("cpmguaadraufact", model.value().get(0).location()); - Assertions.assertEquals("zov", model.value().get(0).tags().get("jjziuxxpsh")); - Assertions.assertEquals("ewdjcvbquwrb", model.value().get(0).webhookUrl()); - Assertions.assertEquals("wagohbuffk", model.value().get(0).emailRecipient()); - Assertions.assertEquals("qem", model.value().get(0).notificationLocale()); - Assertions.assertEquals("hmxtdr", model.value().get(0).description()); + Assertions.assertEquals("zzsdym", model.value().get(0).tags().get("rnysux")); + Assertions.assertEquals("rafwgckhocxvdf", model.value().get(0).location()); + Assertions.assertEquals("kynscliqhzv", model.value().get(0).webhookUrl()); + Assertions.assertEquals("nk", model.value().get(0).emailRecipient()); + Assertions.assertEquals("tkubotppn", model.value().get(0).notificationLocale()); + Assertions.assertEquals("xz", model.value().get(0).description()); Assertions.assertEquals(NotificationChannelEventType.AUTO_SHUTDOWN, model.value().get(0).events().get(0).eventName()); - Assertions.assertEquals("cimpevfg", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NotificationChannelList model - = new NotificationChannelList() - .withValue( - Arrays.asList( - new NotificationChannelInner().withLocation("cpmguaadraufact") - .withTags(mapOf("jjziuxxpsh", "zov", "enr", "eekulfgslqubkwd")) - .withWebhookUrl("ewdjcvbquwrb") - .withEmailRecipient("wagohbuffk") - .withNotificationLocale("qem") - .withDescription("hmxtdr") - .withEvents(Arrays.asList( - new Event().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN), - new Event().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN))), - new NotificationChannelInner().withLocation("qdunvmnnrwrbior") - .withTags( - mapOf("dnhxmsi", "lywjhh", "ufiqndieuzaof", "fomiloxgg", "cubiipuipw", "chvcyyysfgdo")) - .withWebhookUrl("mygdxpgpqch") - .withEmailRecipient("zepn") - .withNotificationLocale("jcrxgibbdaxcon") - .withDescription("zauorsuk") - .withEvents( - Arrays.asList(new Event().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN), - new Event().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN))))) - .withNextLink("cimpevfg"); - model = BinaryData.fromObject(model).toObject(NotificationChannelList.class); - Assertions.assertEquals("cpmguaadraufact", model.value().get(0).location()); - Assertions.assertEquals("zov", model.value().get(0).tags().get("jjziuxxpsh")); - Assertions.assertEquals("ewdjcvbquwrb", model.value().get(0).webhookUrl()); - Assertions.assertEquals("wagohbuffk", model.value().get(0).emailRecipient()); - Assertions.assertEquals("qem", model.value().get(0).notificationLocale()); - Assertions.assertEquals("hmxtdr", model.value().get(0).description()); - Assertions.assertEquals(NotificationChannelEventType.AUTO_SHUTDOWN, - model.value().get(0).events().get(0).eventName()); - Assertions.assertEquals("cimpevfg", 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; + Assertions.assertEquals("kb", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelPropertiesTests.java index d2576bd80793..1b296729a82f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -15,28 +15,28 @@ public final class NotificationChannelPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NotificationChannelProperties model = BinaryData.fromString( - "{\"webHookUrl\":\"zfvazi\",\"emailRecipient\":\"l\",\"notificationLocale\":\"qttbaj\",\"description\":\"atnwxyiopi\",\"events\":[{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"Cost\"}],\"createdDate\":\"2021-10-17T16:33:45Z\",\"provisioningState\":\"xkdmligo\",\"uniqueIdentifier\":\"brxk\"}") + "{\"webHookUrl\":\"rclnpkc\",\"emailRecipient\":\"yzriykhy\",\"notificationLocale\":\"fvjlboxqvkjlmx\",\"description\":\"mdy\",\"events\":[{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"Cost\"}],\"createdDate\":\"2021-05-01T20:19:26Z\",\"provisioningState\":\"nraauzz\",\"uniqueIdentifier\":\"jazysdzhezwwvaiq\"}") .toObject(NotificationChannelProperties.class); - Assertions.assertEquals("zfvazi", model.webhookUrl()); - Assertions.assertEquals("l", model.emailRecipient()); - Assertions.assertEquals("qttbaj", model.notificationLocale()); - Assertions.assertEquals("atnwxyiopi", model.description()); + Assertions.assertEquals("rclnpkc", model.webhookUrl()); + Assertions.assertEquals("yzriykhy", model.emailRecipient()); + Assertions.assertEquals("fvjlboxqvkjlmx", model.notificationLocale()); + Assertions.assertEquals("mdy", model.description()); Assertions.assertEquals(NotificationChannelEventType.AUTO_SHUTDOWN, model.events().get(0).eventName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NotificationChannelProperties model = new NotificationChannelProperties().withWebhookUrl("zfvazi") - .withEmailRecipient("l") - .withNotificationLocale("qttbaj") - .withDescription("atnwxyiopi") + NotificationChannelProperties model = new NotificationChannelProperties().withWebhookUrl("rclnpkc") + .withEmailRecipient("yzriykhy") + .withNotificationLocale("fvjlboxqvkjlmx") + .withDescription("mdy") .withEvents(Arrays.asList(new Event().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN), new Event().withEventName(NotificationChannelEventType.COST))); model = BinaryData.fromObject(model).toObject(NotificationChannelProperties.class); - Assertions.assertEquals("zfvazi", model.webhookUrl()); - Assertions.assertEquals("l", model.emailRecipient()); - Assertions.assertEquals("qttbaj", model.notificationLocale()); - Assertions.assertEquals("atnwxyiopi", model.description()); + Assertions.assertEquals("rclnpkc", model.webhookUrl()); + Assertions.assertEquals("yzriykhy", model.emailRecipient()); + Assertions.assertEquals("fvjlboxqvkjlmx", model.notificationLocale()); + Assertions.assertEquals("mdy", model.description()); Assertions.assertEquals(NotificationChannelEventType.AUTO_SHUTDOWN, model.events().get(0).eventName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateWithResponseMockTests.java index 67320c822531..041c48086ee2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Event; @@ -26,35 +26,35 @@ public final class NotificationChannelsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"webHookUrl\":\"nqjilaywk\",\"emailRecipient\":\"wm\",\"notificationLocale\":\"yrilmhxdqaolf\",\"description\":\"nkkbjpjvlywltmfw\",\"events\":[{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"Cost\"},{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"AutoShutdown\"}],\"createdDate\":\"2020-12-28T05:44:09Z\",\"provisioningState\":\"ocrdzgczeunt\",\"uniqueIdentifier\":\"dnc\"},\"location\":\"q\",\"tags\":{\"gyrihlgm\":\"ekoifuvnyttzgi\",\"lkndrndpgfjodh\":\"behlqtxnr\"},\"id\":\"aqotwfhipxwgsabv\",\"name\":\"ipowza\",\"type\":\"czuumljcir\"}"; + = "{\"properties\":{\"webHookUrl\":\"pn\",\"emailRecipient\":\"dfcbjqqwmtqs\",\"notificationLocale\":\"xsazuxejgw\",\"description\":\"ywnfyszzaczs\",\"events\":[{\"eventName\":\"Cost\"}],\"createdDate\":\"2021-09-16T12:54:25Z\",\"provisioningState\":\"bbozsyvr\",\"uniqueIdentifier\":\"jmyitrchwudl\"},\"tags\":{\"msibzo\":\"ihtpmnoejhql\",\"mypgfqvmty\":\"rfgxkyd\",\"kxp\":\"hl\"},\"location\":\"pewpyj\",\"id\":\"xampqcr\",\"name\":\"g\",\"type\":\"uqxbpiatwfauje\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); NotificationChannel response = manager.notificationChannels() - .define("eamc") - .withRegion("hbgxvel") - .withExistingLab("etfgcwvrrmdqntyc", "awthvmaxgnu") - .withTags(mapOf("mnitmujd", "lnx", "lyymffhmjpddny", "vm", "mzjqrbr", "fzuvrzmz")) - .withWebhookUrl("udf") - .withEmailRecipient("cehokw") - .withNotificationLocale("qtwloes") - .withDescription("ggvrbnyrukoilaci") - .withEvents(Arrays.asList(new Event().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN), + .define("zgssz") + .withExistingLab("eh", "adkm") + .withRegion("slkyozd") + .withTags(mapOf("e", "unwemhd")) + .withWebhookUrl("ctkbbxuha") + .withEmailRecipient("sirncclabvoy") + .withNotificationLocale("suxxc") + .withDescription("myqjog") + .withEvents(Arrays.asList(new Event().withEventName(NotificationChannelEventType.COST), new Event().withEventName(NotificationChannelEventType.COST))) .create(); - Assertions.assertEquals("q", response.location()); - Assertions.assertEquals("ekoifuvnyttzgi", response.tags().get("gyrihlgm")); - Assertions.assertEquals("nqjilaywk", response.webhookUrl()); - Assertions.assertEquals("wm", response.emailRecipient()); - Assertions.assertEquals("yrilmhxdqaolf", response.notificationLocale()); - Assertions.assertEquals("nkkbjpjvlywltmfw", response.description()); - Assertions.assertEquals(NotificationChannelEventType.AUTO_SHUTDOWN, response.events().get(0).eventName()); + Assertions.assertEquals("ihtpmnoejhql", response.tags().get("msibzo")); + Assertions.assertEquals("pewpyj", response.location()); + Assertions.assertEquals("pn", response.webhookUrl()); + Assertions.assertEquals("dfcbjqqwmtqs", response.emailRecipient()); + Assertions.assertEquals("xsazuxejgw", response.notificationLocale()); + Assertions.assertEquals("ywnfyszzaczs", response.description()); + Assertions.assertEquals(NotificationChannelEventType.COST, response.events().get(0).eventName()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteWithResponseMockTests.java index ad26f1e1d5a0..63462253c22e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDeleteWithResponse() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.notificationChannels().deleteWithResponse("rzwnyk", "id", "chl", com.azure.core.util.Context.NONE); + manager.notificationChannels() + .deleteWithResponse("dmdlgyqixokw", "jawh", "ag", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetWithResponseMockTests.java index 20d61bef8cd7..cb2bf39cb36f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.NotificationChannel; @@ -22,25 +22,26 @@ public final class NotificationChannelsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"webHookUrl\":\"o\",\"emailRecipient\":\"dwjcciklhs\",\"notificationLocale\":\"krdre\",\"description\":\"olr\",\"events\":[{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"Cost\"},{\"eventName\":\"Cost\"}],\"createdDate\":\"2021-06-03T13:52:15Z\",\"provisioningState\":\"wbdbfg\",\"uniqueIdentifier\":\"punytjl\"},\"location\":\"esmmpathubtahd\",\"tags\":{\"tedousnktjtgrava\":\"iiwllbvgwzsf\",\"xxw\":\"ogfkbebauzlqb\",\"njzudr\":\"f\"},\"id\":\"pzkg\",\"name\":\"eboywhczzqrhm\",\"type\":\"gqbedygi\"}"; + = "{\"properties\":{\"webHookUrl\":\"zaahzbhuroolkoli\",\"emailRecipient\":\"hmojusuzg\",\"notificationLocale\":\"zcvaaxoialahfxwc\",\"description\":\"kdxkuk\",\"events\":[{\"eventName\":\"AutoShutdown\"}],\"createdDate\":\"2021-06-06T06:29:13Z\",\"provisioningState\":\"hoqeqshavljqk\",\"uniqueIdentifier\":\"rqolnthbb\"},\"tags\":{\"hfceyjncjm\":\"zukwdrnzkj\",\"bpfiddhlrufz\":\"fuyf\"},\"location\":\"yjmqrf\",\"id\":\"ocuselqk\",\"name\":\"sazrhxuddqmdtff\",\"type\":\"sjmrkkhm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); NotificationChannel response = manager.notificationChannels() - .getWithResponse("awohpmw", "qnucs", "lhsidsjtdl", "bninjgazlsvbzfc", com.azure.core.util.Context.NONE) + .getWithResponse("tfjikffffgkuh", "nwhvuldbkkejj", "jigawgaz", "xjqifhujjsbc", + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("esmmpathubtahd", response.location()); - Assertions.assertEquals("iiwllbvgwzsf", response.tags().get("tedousnktjtgrava")); - Assertions.assertEquals("o", response.webhookUrl()); - Assertions.assertEquals("dwjcciklhs", response.emailRecipient()); - Assertions.assertEquals("krdre", response.notificationLocale()); - Assertions.assertEquals("olr", response.description()); + Assertions.assertEquals("zukwdrnzkj", response.tags().get("hfceyjncjm")); + Assertions.assertEquals("yjmqrf", response.location()); + Assertions.assertEquals("zaahzbhuroolkoli", response.webhookUrl()); + Assertions.assertEquals("hmojusuzg", response.emailRecipient()); + Assertions.assertEquals("zcvaaxoialahfxwc", response.notificationLocale()); + Assertions.assertEquals("kdxkuk", response.description()); Assertions.assertEquals(NotificationChannelEventType.AUTO_SHUTDOWN, response.events().get(0).eventName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListMockTests.java index 6f3d6181dc73..8f438f3b6cad 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.NotificationChannel; @@ -23,26 +23,26 @@ public final class NotificationChannelsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"webHookUrl\":\"wcjsqggjhffbxrq\",\"emailRecipient\":\"ijpeuql\",\"notificationLocale\":\"x\",\"description\":\"ztv\",\"events\":[{\"eventName\":\"Cost\"},{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"AutoShutdown\"}],\"createdDate\":\"2021-06-21T22:46:32Z\",\"provisioningState\":\"wwa\",\"uniqueIdentifier\":\"cleqioulndhzyo\"},\"location\":\"ojhtollhs\",\"tags\":{\"lxpnovyoanf\":\"mytzln\"},\"id\":\"cswqa\",\"name\":\"ywv\",\"type\":\"xigvjrktpgaeuk\"}]}"; + = "{\"value\":[{\"properties\":{\"webHookUrl\":\"othymgobl\",\"emailRecipient\":\"snwgwimaa\",\"notificationLocale\":\"akhtmhobcyanrfvq\",\"description\":\"khgvoogxkfnao\",\"events\":[{\"eventName\":\"AutoShutdown\"},{\"eventName\":\"Cost\"},{\"eventName\":\"Cost\"}],\"createdDate\":\"2021-02-08T00:21:39Z\",\"provisioningState\":\"wyrnskbyh\",\"uniqueIdentifier\":\"hczygxvhajpxe\"},\"tags\":{\"cozawmvgxsmpknpw\":\"nwh\",\"uoxudnmckaprh\":\"rfljfewxq\",\"jgencdgmoque\":\"nqi\",\"jouw\":\"ihkkyowl\"},\"location\":\"dxwhieproqksmfx\",\"id\":\"vprstv\",\"name\":\"itbfjtdy\",\"type\":\"tnp\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.notificationChannels() - .list("ixmqrudjizcbf", "mcrunfhiucn", "fbcpaqktkrumzu", "dkyzbfvxov", 781078177, "xiuxqggvqrnhy", + .list("qfqqdlcvmyolc", "ymjc", "tvsnvl", "qdnzyza", 528226837, "tuwqkokb", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ojhtollhs", response.iterator().next().location()); - Assertions.assertEquals("mytzln", response.iterator().next().tags().get("lxpnovyoanf")); - Assertions.assertEquals("wcjsqggjhffbxrq", response.iterator().next().webhookUrl()); - Assertions.assertEquals("ijpeuql", response.iterator().next().emailRecipient()); - Assertions.assertEquals("x", response.iterator().next().notificationLocale()); - Assertions.assertEquals("ztv", response.iterator().next().description()); - Assertions.assertEquals(NotificationChannelEventType.COST, + Assertions.assertEquals("nwh", response.iterator().next().tags().get("cozawmvgxsmpknpw")); + Assertions.assertEquals("dxwhieproqksmfx", response.iterator().next().location()); + Assertions.assertEquals("othymgobl", response.iterator().next().webhookUrl()); + Assertions.assertEquals("snwgwimaa", response.iterator().next().emailRecipient()); + Assertions.assertEquals("akhtmhobcyanrfvq", response.iterator().next().notificationLocale()); + Assertions.assertEquals("khgvoogxkfnao", response.iterator().next().description()); + Assertions.assertEquals(NotificationChannelEventType.AUTO_SHUTDOWN, response.iterator().next().events().get(0).eventName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifyWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifyWithResponseMockTests.java index 5bb8e28ad9b6..f9e5826b6916 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifyWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifyWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.NotificationChannelEventType; @@ -27,11 +27,12 @@ public void testNotifyWithResponse() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.notificationChannels() - .notifyWithResponse("mpwctoflds", "acdhztxkbr", "g", - new NotifyParameters().withEventName(NotificationChannelEventType.COST).withJsonPayload("iyewhfjsrwqr"), + .notifyWithResponse("facqo", "cqrq", "wetjtdrhutf", + new NotifyParameters().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN) + .withJsonPayload("txop"), com.azure.core.util.Context.NONE); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationSettingsTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationSettingsTests.java index b9988788fb3f..921da8893403 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationSettingsTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotificationSettingsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,27 +13,27 @@ public final class NotificationSettingsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NotificationSettings model = BinaryData.fromString( - "{\"status\":\"Disabled\",\"timeInMinutes\":528280521,\"webhookUrl\":\"dxyt\",\"emailRecipient\":\"oyrxvwfudwpzntxh\",\"notificationLocale\":\"hl\"}") + "{\"status\":\"Disabled\",\"timeInMinutes\":122021588,\"webhookUrl\":\"pnpulexxbczwtru\",\"emailRecipient\":\"qzbqjvsov\",\"notificationLocale\":\"okacspk\"}") .toObject(NotificationSettings.class); Assertions.assertEquals(EnableStatus.DISABLED, model.status()); - Assertions.assertEquals(528280521, model.timeInMinutes()); - Assertions.assertEquals("dxyt", model.webhookUrl()); - Assertions.assertEquals("oyrxvwfudwpzntxh", model.emailRecipient()); - Assertions.assertEquals("hl", model.notificationLocale()); + Assertions.assertEquals(122021588, model.timeInMinutes()); + Assertions.assertEquals("pnpulexxbczwtru", model.webhookUrl()); + Assertions.assertEquals("qzbqjvsov", model.emailRecipient()); + Assertions.assertEquals("okacspk", model.notificationLocale()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { NotificationSettings model = new NotificationSettings().withStatus(EnableStatus.DISABLED) - .withTimeInMinutes(528280521) - .withWebhookUrl("dxyt") - .withEmailRecipient("oyrxvwfudwpzntxh") - .withNotificationLocale("hl"); + .withTimeInMinutes(122021588) + .withWebhookUrl("pnpulexxbczwtru") + .withEmailRecipient("qzbqjvsov") + .withNotificationLocale("okacspk"); model = BinaryData.fromObject(model).toObject(NotificationSettings.class); Assertions.assertEquals(EnableStatus.DISABLED, model.status()); - Assertions.assertEquals(528280521, model.timeInMinutes()); - Assertions.assertEquals("dxyt", model.webhookUrl()); - Assertions.assertEquals("oyrxvwfudwpzntxh", model.emailRecipient()); - Assertions.assertEquals("hl", model.notificationLocale()); + Assertions.assertEquals(122021588, model.timeInMinutes()); + Assertions.assertEquals("pnpulexxbczwtru", model.webhookUrl()); + Assertions.assertEquals("qzbqjvsov", model.emailRecipient()); + Assertions.assertEquals("okacspk", model.notificationLocale()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotifyParametersTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotifyParametersTests.java index 7c7026dd96e6..b2ce89c57736 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotifyParametersTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/NotifyParametersTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,18 +12,18 @@ public final class NotifyParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NotifyParameters model = BinaryData.fromString("{\"eventName\":\"Cost\",\"jsonPayload\":\"bfhjxakvvjgsl\"}") + NotifyParameters model = BinaryData.fromString("{\"eventName\":\"Cost\",\"jsonPayload\":\"ajnjwltlwtjj\"}") .toObject(NotifyParameters.class); Assertions.assertEquals(NotificationChannelEventType.COST, model.eventName()); - Assertions.assertEquals("bfhjxakvvjgsl", model.jsonPayload()); + Assertions.assertEquals("ajnjwltlwtjj", model.jsonPayload()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { NotifyParameters model - = new NotifyParameters().withEventName(NotificationChannelEventType.COST).withJsonPayload("bfhjxakvvjgsl"); + = new NotifyParameters().withEventName(NotificationChannelEventType.COST).withJsonPayload("ajnjwltlwtjj"); model = BinaryData.fromObject(model).toObject(NotifyParameters.class); Assertions.assertEquals(NotificationChannelEventType.COST, model.eventName()); - Assertions.assertEquals("bfhjxakvvjgsl", model.jsonPayload()); + Assertions.assertEquals("ajnjwltlwtjj", model.jsonPayload()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationDisplayTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..1de72e3d0607 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationDisplayTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.devtestlabs.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") + .toObject(OperationDisplay.class); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationInnerTests.java new file mode 100644 index 000000000000..5abb4cbb59e4 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.devtestlabs.fluent.models.OperationInner; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationListResultTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationListResultTests.java new file mode 100644 index 000000000000..45b1d2ae4012 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.devtestlabs.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationMetadataDisplayTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationMetadataDisplayTests.java deleted file mode 100644 index 890fdb071a11..000000000000 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationMetadataDisplayTests.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.devtestlabs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.models.OperationMetadataDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationMetadataDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationMetadataDisplay model = BinaryData.fromString( - "{\"provider\":\"lx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"}") - .toObject(OperationMetadataDisplay.class); - Assertions.assertEquals("lx", model.provider()); - Assertions.assertEquals("kuksjtxukcdm", model.resource()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.operation()); - Assertions.assertEquals("lhmwhfpmrqobm", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationMetadataDisplay model = new OperationMetadataDisplay().withProvider("lx") - .withResource("kuksjtxukcdm") - .withOperation("rcryuanzwuxzdxta") - .withDescription("lhmwhfpmrqobm"); - model = BinaryData.fromObject(model).toObject(OperationMetadataDisplay.class); - Assertions.assertEquals("lx", model.provider()); - Assertions.assertEquals("kuksjtxukcdm", model.resource()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.operation()); - Assertions.assertEquals("lhmwhfpmrqobm", model.description()); - } -} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationMetadataInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationMetadataInnerTests.java deleted file mode 100644 index 1ecd93f14b29..000000000000 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/OperationMetadataInnerTests.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.devtestlabs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.OperationMetadataInner; -import com.azure.resourcemanager.devtestlabs.models.OperationMetadataDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationMetadataInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationMetadataInner model = BinaryData.fromString( - "{\"name\":\"nygj\",\"display\":{\"provider\":\"ddeqsrdeupewnwre\",\"resource\":\"jzyflu\",\"operation\":\"rh\",\"description\":\"fcqhsmyurkd\"}}") - .toObject(OperationMetadataInner.class); - Assertions.assertEquals("nygj", model.name()); - Assertions.assertEquals("ddeqsrdeupewnwre", model.display().provider()); - Assertions.assertEquals("jzyflu", model.display().resource()); - Assertions.assertEquals("rh", model.display().operation()); - Assertions.assertEquals("fcqhsmyurkd", model.display().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationMetadataInner model = new OperationMetadataInner().withName("nygj") - .withDisplay(new OperationMetadataDisplay().withProvider("ddeqsrdeupewnwre") - .withResource("jzyflu") - .withOperation("rh") - .withDescription("fcqhsmyurkd")); - model = BinaryData.fromObject(model).toObject(OperationMetadataInner.class); - Assertions.assertEquals("nygj", model.name()); - Assertions.assertEquals("ddeqsrdeupewnwre", model.display().provider()); - Assertions.assertEquals("jzyflu", model.display().resource()); - Assertions.assertEquals("rh", model.display().operation()); - Assertions.assertEquals("fcqhsmyurkd", model.display().description()); - } -} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ParameterInfoTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ParameterInfoTests.java index 76107b24d8fb..238ac5a4540c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ParameterInfoTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ParameterInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,16 +12,16 @@ public final class ParameterInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ParameterInfo model - = BinaryData.fromString("{\"name\":\"euel\",\"value\":\"hsd\"}").toObject(ParameterInfo.class); - Assertions.assertEquals("euel", model.name()); - Assertions.assertEquals("hsd", model.value()); + = BinaryData.fromString("{\"name\":\"luhczbw\",\"value\":\"hairsbrgzdwms\"}").toObject(ParameterInfo.class); + Assertions.assertEquals("luhczbw", model.name()); + Assertions.assertEquals("hairsbrgzdwms", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ParameterInfo model = new ParameterInfo().withName("euel").withValue("hsd"); + ParameterInfo model = new ParameterInfo().withName("luhczbw").withValue("hairsbrgzdwms"); model = BinaryData.fromObject(model).toObject(ParameterInfo.class); - Assertions.assertEquals("euel", model.name()); - Assertions.assertEquals("hsd", model.value()); + Assertions.assertEquals("luhczbw", model.name()); + Assertions.assertEquals("hairsbrgzdwms", model.value()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ParametersValueFileInfoTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ParametersValueFileInfoTests.java index 57079cc4a4d0..460ed2bd7093 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ParametersValueFileInfoTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ParametersValueFileInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,17 +11,9 @@ public final class ParametersValueFileInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ParametersValueFileInfo model - = BinaryData.fromString("{\"fileName\":\"ruoujmk\",\"parametersValueInfo\":\"datahwqytj\"}") - .toObject(ParametersValueFileInfo.class); - Assertions.assertEquals("ruoujmk", model.fileName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ParametersValueFileInfo model - = new ParametersValueFileInfo().withFileName("ruoujmk").withParametersValueInfo("datahwqytj"); - model = BinaryData.fromObject(model).toObject(ParametersValueFileInfo.class); - Assertions.assertEquals("ruoujmk", model.fileName()); + ParametersValueFileInfo model = BinaryData.fromString( + "{\"fileName\":\"bglzpswi\",\"parametersValueInfo\":{\"bzmnvdfznud\":\"\\\"datacwyhzdxssa\\\"\",\"xzb\":\"\\\"dataod\\\"\",\"dzu\":\"\\\"datacblylpstdbhhxsr\\\"\",\"fiwjmygtdssls\":\"\\\"dataerscdntne\\\"\"}}") + .toObject(ParametersValueFileInfo.class); + Assertions.assertEquals("bglzpswi", model.fileName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PercentageCostThresholdPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PercentageCostThresholdPropertiesTests.java index 7d6d94449421..96f920b3b5f5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PercentageCostThresholdPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PercentageCostThresholdPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -11,16 +11,16 @@ public final class PercentageCostThresholdPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PercentageCostThresholdProperties model = BinaryData.fromString("{\"thresholdValue\":11.603259080593842}") + PercentageCostThresholdProperties model = BinaryData.fromString("{\"thresholdValue\":10.605262549550275}") .toObject(PercentageCostThresholdProperties.class); - Assertions.assertEquals(11.603259080593842D, model.thresholdValue()); + Assertions.assertEquals(10.605262549550275D, model.thresholdValue()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PercentageCostThresholdProperties model - = new PercentageCostThresholdProperties().withThresholdValue(11.603259080593842D); + = new PercentageCostThresholdProperties().withThresholdValue(10.605262549550275D); model = BinaryData.fromObject(model).toObject(PercentageCostThresholdProperties.class); - Assertions.assertEquals(11.603259080593842D, model.thresholdValue()); + Assertions.assertEquals(10.605262549550275D, model.thresholdValue()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateWithResponseMockTests.java index d75a6d0d73e8..e5f720c6e58b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Policy; @@ -26,35 +26,35 @@ public final class PoliciesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"description\":\"rswgkpjhboyikeb\",\"status\":\"Disabled\",\"factName\":\"LabVmSize\",\"factData\":\"gwl\",\"threshold\":\"hueoijyzcqyp\",\"evaluatorType\":\"AllowedValuesPolicy\",\"createdDate\":\"2021-10-11T17:07:04Z\",\"provisioningState\":\"s\",\"uniqueIdentifier\":\"ej\"},\"location\":\"vdwtfxptpqayamk\",\"tags\":{\"snxoc\":\"gybm\",\"oy\":\"ullojk\"},\"id\":\"g\",\"name\":\"wdjuxdbdljzgdy\",\"type\":\"cvuq\"}"; + = "{\"properties\":{\"description\":\"zuzpbgkzcs\",\"status\":\"Disabled\",\"factName\":\"LabVmSize\",\"factData\":\"kunhdimjuk\",\"threshold\":\"r\",\"evaluatorType\":\"AllowedValuesPolicy\",\"createdDate\":\"2021-03-30T07:47:24Z\",\"provisioningState\":\"u\",\"uniqueIdentifier\":\"ocf\"},\"tags\":{\"rjlvzklkvbgi\":\"wgofmhx\",\"shjvpzaptuoskaoi\":\"yjtkakvlb\"},\"location\":\"ixwfgcdi\",\"id\":\"kcxwnujvqynvavi\",\"name\":\"mdmuqoh\",\"type\":\"ihraxqudd\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Policy response = manager.policies() - .define("ipbwxgooo") - .withRegion("sr") - .withExistingPolicyset("njdiqfliejhpcl", "iedfsbwcei", "bv") - .withTags(mapOf("cetjdvq", "jglzrsubklrxhjnl", "kw", "dieq", "bibanbau", "ruwdxvqzxoebwgj")) - .withDescription("pradmskxknpdgzi") + .define("jakx") + .withExistingPolicyset("pxtzhigqqbtimpk", "blornsih", "hudsmusuaa") + .withRegion("khhwmj") + .withTags(mapOf("wetamfddrvlk", "foeajogsy", "d", "zwbhnrecc", "mjedbiu", "drmuhka")) + .withDescription("nfczmnniixyxvq") .withStatus(PolicyStatus.DISABLED) .withFactName(PolicyFactName.ENVIRONMENT_TEMPLATE) - .withFactData("whgsaodkww") - .withThreshold("afoctohz") + .withFactData("tgirnb") + .withThreshold("gm") .withEvaluatorType(PolicyEvaluatorType.MAX_VALUE_POLICY) .create(); - Assertions.assertEquals("vdwtfxptpqayamk", response.location()); - Assertions.assertEquals("gybm", response.tags().get("snxoc")); - Assertions.assertEquals("rswgkpjhboyikeb", response.description()); + Assertions.assertEquals("wgofmhx", response.tags().get("rjlvzklkvbgi")); + Assertions.assertEquals("ixwfgcdi", response.location()); + Assertions.assertEquals("zuzpbgkzcs", response.description()); Assertions.assertEquals(PolicyStatus.DISABLED, response.status()); Assertions.assertEquals(PolicyFactName.LAB_VM_SIZE, response.factName()); - Assertions.assertEquals("gwl", response.factData()); - Assertions.assertEquals("hueoijyzcqyp", response.threshold()); + Assertions.assertEquals("kunhdimjuk", response.factData()); + Assertions.assertEquals("r", response.threshold()); Assertions.assertEquals(PolicyEvaluatorType.ALLOWED_VALUES_POLICY, response.evaluatorType()); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteWithResponseMockTests.java index d34b5cde8768..4c34f5b9cdab 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,11 @@ public void testDeleteWithResponse() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.policies() - .deleteWithResponse("msqywwwmhkruwae", "rympmlq", "in", "zduewihapfjii", com.azure.core.util.Context.NONE); + .deleteWithResponse("lfdxaglz", "ytlbtlqhopxouvm", "siflikyypzkgxf", "fmy", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetWithResponseMockTests.java index 8650ce24e550..d4a12cdafe85 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Policy; @@ -24,27 +24,27 @@ public final class PoliciesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"description\":\"icxdwyjfo\",\"status\":\"Enabled\",\"factName\":\"LabVmSize\",\"factData\":\"c\",\"threshold\":\"sgbipcukdveksbuh\",\"evaluatorType\":\"MaxValuePolicy\",\"createdDate\":\"2021-10-16T22:01:22Z\",\"provisioningState\":\"lscrdpibfdyjduss\",\"uniqueIdentifier\":\"szekbh\"},\"location\":\"lkaaggkr\",\"tags\":{\"mreoagsqtaad\":\"frnuybffljfi\",\"wudohzilfm\":\"srexxfavs\",\"kpsimsfeypofqp\":\"l\",\"qgsdr\":\"bh\"},\"id\":\"mttjxophgerh\",\"name\":\"mvgohtwz\",\"type\":\"qilrixysfn\"}"; + = "{\"properties\":{\"description\":\"scstunmlhxd\",\"status\":\"Disabled\",\"factName\":\"UserOwnedLabPremiumVmCount\",\"factData\":\"ich\",\"threshold\":\"sysmvxodgw\",\"evaluatorType\":\"MaxValuePolicy\",\"createdDate\":\"2021-01-18T02:37:15Z\",\"provisioningState\":\"fcuvbdujgcwx\",\"uniqueIdentifier\":\"cbbwjtrdxriz\"},\"tags\":{\"ykpgd\":\"bgiark\",\"dosqkptjqg\":\"xwabzrwiqrxhacl\",\"d\":\"ifmmainwh\",\"qwuntob\":\"kp\"},\"location\":\"z\",\"id\":\"zelwgvydjufbnkl\",\"name\":\"laxp\",\"type\":\"gjwdab\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Policy response = manager.policies() - .getWithResponse("btmkekxpkzwaq", "ofqovchiqbplv", "idu", "ztekxbyjgmsfep", "yihpqadagrh", + .getWithResponse("qdtadrakgdd", "jkrukizyhgsqtnqs", "txqfpjbq", "gweeiwd", "dmncgbf", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("lkaaggkr", response.location()); - Assertions.assertEquals("frnuybffljfi", response.tags().get("mreoagsqtaad")); - Assertions.assertEquals("icxdwyjfo", response.description()); - Assertions.assertEquals(PolicyStatus.ENABLED, response.status()); - Assertions.assertEquals(PolicyFactName.LAB_VM_SIZE, response.factName()); - Assertions.assertEquals("c", response.factData()); - Assertions.assertEquals("sgbipcukdveksbuh", response.threshold()); + Assertions.assertEquals("bgiark", response.tags().get("ykpgd")); + Assertions.assertEquals("z", response.location()); + Assertions.assertEquals("scstunmlhxd", response.description()); + Assertions.assertEquals(PolicyStatus.DISABLED, response.status()); + Assertions.assertEquals(PolicyFactName.USER_OWNED_LAB_PREMIUM_VM_COUNT, response.factName()); + Assertions.assertEquals("ich", response.factData()); + Assertions.assertEquals("sysmvxodgw", response.threshold()); Assertions.assertEquals(PolicyEvaluatorType.MAX_VALUE_POLICY, response.evaluatorType()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListMockTests.java index ddabcf67fbf1..dcdc0797f329 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Policy; @@ -25,27 +25,26 @@ public final class PoliciesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"vlzw\",\"status\":\"Disabled\",\"factName\":\"UserOwnedLabVmCountInSubnet\",\"factData\":\"lkzazmgok\",\"threshold\":\"gjqafkmkrokzr\",\"evaluatorType\":\"MaxValuePolicy\",\"createdDate\":\"2020-12-24T11:56:22Z\",\"provisioningState\":\"pqrtvaoznqni\",\"uniqueIdentifier\":\"ezeagmceituuge\"},\"location\":\"hfpjstlzmbls\",\"tags\":{\"yrle\":\"eolctaebf\",\"gdxzvsgeafgfoseh\":\"jcustbvtq\",\"aaeskyfjlpze\":\"lzsxezppkk\"},\"id\":\"toyrplixlajml\",\"name\":\"pq\",\"type\":\"evhamfowg\"}]}"; + = "{\"value\":[{\"properties\":{\"description\":\"sdetjygowifcqpol\",\"status\":\"Disabled\",\"factName\":\"UserOwnedLabVmCountInSubnet\",\"factData\":\"gzyy\",\"threshold\":\"oxlvocptvdxxheig\",\"evaluatorType\":\"AllowedValuesPolicy\",\"createdDate\":\"2021-10-25T16:25:53Z\",\"provisioningState\":\"ghjhjvmabzzbwa\",\"uniqueIdentifier\":\"fmdafbgymqtnap\"},\"tags\":{\"nx\":\"jxrjnbsc\",\"neychbjizq\":\"vi\",\"rfbo\":\"sgnwdxzedpq\",\"mlnfyz\":\"xi\"},\"location\":\"frbypi\",\"id\":\"bkpdjtaqhsmq\",\"name\":\"zpdgonjhxshthmgp\",\"type\":\"zqulptkbv\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.policies() - .list("jctibpvbkae", "xsmzygdf", "akw", "eivmak", "hysowljuxlkbect", 1481062094, "fjmskdchmaiu", - com.azure.core.util.Context.NONE); + .list("qsdb", "oksz", "nm", "wgpterdiuw", "i", 832944822, "skw", com.azure.core.util.Context.NONE); - Assertions.assertEquals("hfpjstlzmbls", response.iterator().next().location()); - Assertions.assertEquals("eolctaebf", response.iterator().next().tags().get("yrle")); - Assertions.assertEquals("vlzw", response.iterator().next().description()); + Assertions.assertEquals("jxrjnbsc", response.iterator().next().tags().get("nx")); + Assertions.assertEquals("frbypi", response.iterator().next().location()); + Assertions.assertEquals("sdetjygowifcqpol", response.iterator().next().description()); Assertions.assertEquals(PolicyStatus.DISABLED, response.iterator().next().status()); Assertions.assertEquals(PolicyFactName.USER_OWNED_LAB_VM_COUNT_IN_SUBNET, response.iterator().next().factName()); - Assertions.assertEquals("lkzazmgok", response.iterator().next().factData()); - Assertions.assertEquals("gjqafkmkrokzr", response.iterator().next().threshold()); - Assertions.assertEquals(PolicyEvaluatorType.MAX_VALUE_POLICY, response.iterator().next().evaluatorType()); + Assertions.assertEquals("gzyy", response.iterator().next().factData()); + Assertions.assertEquals("oxlvocptvdxxheig", response.iterator().next().threshold()); + Assertions.assertEquals(PolicyEvaluatorType.ALLOWED_VALUES_POLICY, response.iterator().next().evaluatorType()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyFragmentTests.java index 7b7113b45b40..1909c8df1a4d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,16 +14,17 @@ public final class PolicyFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PolicyFragment model - = BinaryData.fromString("{\"tags\":{\"sqtzbsrg\":\"lcwkhihihlhz\",\"cjhfgmvecactxmw\":\"o\"}}") + = BinaryData.fromString("{\"tags\":{\"lduycv\":\"vetnwsdtutn\",\"dxukuqgsjjxundxg\":\"zhyrmewipmve\"}}") .toObject(PolicyFragment.class); - Assertions.assertEquals("lcwkhihihlhz", model.tags().get("sqtzbsrg")); + Assertions.assertEquals("vetnwsdtutn", model.tags().get("lduycv")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PolicyFragment model = new PolicyFragment().withTags(mapOf("sqtzbsrg", "lcwkhihihlhz", "cjhfgmvecactxmw", "o")); + PolicyFragment model + = new PolicyFragment().withTags(mapOf("lduycv", "vetnwsdtutn", "dxukuqgsjjxundxg", "zhyrmewipmve")); model = BinaryData.fromObject(model).toObject(PolicyFragment.class); - Assertions.assertEquals("lcwkhihihlhz", model.tags().get("sqtzbsrg")); + Assertions.assertEquals("vetnwsdtutn", model.tags().get("lduycv")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyInnerTests.java index 64ca8281a726..680e6b4f63fe 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -17,38 +17,38 @@ public final class PolicyInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PolicyInner model = BinaryData.fromString( - "{\"properties\":{\"description\":\"xvd\",\"status\":\"Disabled\",\"factName\":\"UserOwnedLabVmCountInSubnet\",\"factData\":\"qrouda\",\"threshold\":\"avehhrvkbunzo\",\"evaluatorType\":\"MaxValuePolicy\",\"createdDate\":\"2021-10-22T01:37:19Z\",\"provisioningState\":\"gkmoyxcdyuibhmfd\",\"uniqueIdentifier\":\"zydvfvf\"},\"location\":\"jnaeois\",\"tags\":{\"w\":\"mgorffukisc\",\"tg\":\"zhwplefaxvxilc\",\"qxtjjfzqlqhyca\":\"hnze\",\"beesmieknlra\":\"odggx\"},\"id\":\"iaa\",\"name\":\"iuagydwqfbylyrfg\",\"type\":\"agt\"}") + "{\"properties\":{\"description\":\"ktalhsnvkcdmxz\",\"status\":\"Enabled\",\"factName\":\"EnvironmentTemplate\",\"factData\":\"lnwiaaomylwe\",\"threshold\":\"ulcsethwwnpj\",\"evaluatorType\":\"AllowedValuesPolicy\",\"createdDate\":\"2020-12-21T13:52:47Z\",\"provisioningState\":\"pchwa\",\"uniqueIdentifier\":\"bousn\"},\"tags\":{\"ykxhdjh\":\"gfewetwlyxgnc\",\"h\":\"immbcx\",\"qizxfpxtgqscjavf\":\"cporxvxcjz\"},\"location\":\"uhdqazk\",\"id\":\"gg\",\"name\":\"wpijrajci\",\"type\":\"m\"}") .toObject(PolicyInner.class); - Assertions.assertEquals("jnaeois", model.location()); - Assertions.assertEquals("mgorffukisc", model.tags().get("w")); - Assertions.assertEquals("xvd", model.description()); - Assertions.assertEquals(PolicyStatus.DISABLED, model.status()); - Assertions.assertEquals(PolicyFactName.USER_OWNED_LAB_VM_COUNT_IN_SUBNET, model.factName()); - Assertions.assertEquals("qrouda", model.factData()); - Assertions.assertEquals("avehhrvkbunzo", model.threshold()); - Assertions.assertEquals(PolicyEvaluatorType.MAX_VALUE_POLICY, model.evaluatorType()); + Assertions.assertEquals("gfewetwlyxgnc", model.tags().get("ykxhdjh")); + Assertions.assertEquals("uhdqazk", model.location()); + Assertions.assertEquals("ktalhsnvkcdmxz", model.description()); + Assertions.assertEquals(PolicyStatus.ENABLED, model.status()); + Assertions.assertEquals(PolicyFactName.ENVIRONMENT_TEMPLATE, model.factName()); + Assertions.assertEquals("lnwiaaomylwe", model.factData()); + Assertions.assertEquals("ulcsethwwnpj", model.threshold()); + Assertions.assertEquals(PolicyEvaluatorType.ALLOWED_VALUES_POLICY, model.evaluatorType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PolicyInner model = new PolicyInner().withLocation("jnaeois") - .withTags( - mapOf("w", "mgorffukisc", "tg", "zhwplefaxvxilc", "qxtjjfzqlqhyca", "hnze", "beesmieknlra", "odggx")) - .withDescription("xvd") - .withStatus(PolicyStatus.DISABLED) - .withFactName(PolicyFactName.USER_OWNED_LAB_VM_COUNT_IN_SUBNET) - .withFactData("qrouda") - .withThreshold("avehhrvkbunzo") - .withEvaluatorType(PolicyEvaluatorType.MAX_VALUE_POLICY); + PolicyInner model = new PolicyInner() + .withTags(mapOf("ykxhdjh", "gfewetwlyxgnc", "h", "immbcx", "qizxfpxtgqscjavf", "cporxvxcjz")) + .withLocation("uhdqazk") + .withDescription("ktalhsnvkcdmxz") + .withStatus(PolicyStatus.ENABLED) + .withFactName(PolicyFactName.ENVIRONMENT_TEMPLATE) + .withFactData("lnwiaaomylwe") + .withThreshold("ulcsethwwnpj") + .withEvaluatorType(PolicyEvaluatorType.ALLOWED_VALUES_POLICY); model = BinaryData.fromObject(model).toObject(PolicyInner.class); - Assertions.assertEquals("jnaeois", model.location()); - Assertions.assertEquals("mgorffukisc", model.tags().get("w")); - Assertions.assertEquals("xvd", model.description()); - Assertions.assertEquals(PolicyStatus.DISABLED, model.status()); - Assertions.assertEquals(PolicyFactName.USER_OWNED_LAB_VM_COUNT_IN_SUBNET, model.factName()); - Assertions.assertEquals("qrouda", model.factData()); - Assertions.assertEquals("avehhrvkbunzo", model.threshold()); - Assertions.assertEquals(PolicyEvaluatorType.MAX_VALUE_POLICY, model.evaluatorType()); + Assertions.assertEquals("gfewetwlyxgnc", model.tags().get("ykxhdjh")); + Assertions.assertEquals("uhdqazk", model.location()); + Assertions.assertEquals("ktalhsnvkcdmxz", model.description()); + Assertions.assertEquals(PolicyStatus.ENABLED, model.status()); + Assertions.assertEquals(PolicyFactName.ENVIRONMENT_TEMPLATE, model.factName()); + Assertions.assertEquals("lnwiaaomylwe", model.factData()); + Assertions.assertEquals("ulcsethwwnpj", model.threshold()); + Assertions.assertEquals(PolicyEvaluatorType.ALLOWED_VALUES_POLICY, model.evaluatorType()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyListTests.java index 141d3a88b7c7..c80adf4b0b56 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyListTests.java @@ -1,97 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.PolicyInner; +import com.azure.resourcemanager.devtestlabs.implementation.models.PolicyList; import com.azure.resourcemanager.devtestlabs.models.PolicyEvaluatorType; import com.azure.resourcemanager.devtestlabs.models.PolicyFactName; -import com.azure.resourcemanager.devtestlabs.models.PolicyList; import com.azure.resourcemanager.devtestlabs.models.PolicyStatus; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class PolicyListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PolicyList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"description\":\"er\",\"status\":\"Disabled\",\"factName\":\"LabVmSize\",\"factData\":\"f\",\"threshold\":\"babwidfcxss\",\"evaluatorType\":\"AllowedValuesPolicy\",\"createdDate\":\"2021-09-13T22:10:41Z\",\"provisioningState\":\"xyh\",\"uniqueIdentifier\":\"g\"},\"location\":\"ddrihpf\",\"tags\":{\"djvlpj\":\"caaewdao\",\"msgeivsiykzk\":\"xkzb\",\"xonbzoggculapz\":\"ncj\",\"pgogtqxepny\":\"y\"},\"id\":\"b\",\"name\":\"uajlyj\",\"type\":\"lvofqzhvfcibyfmo\"},{\"properties\":{\"description\":\"xrkjpvdw\",\"status\":\"Disabled\",\"factName\":\"UserOwnedLabVmCountInSubnet\",\"factData\":\"vwzjbhyz\",\"threshold\":\"jrkambtrnegvmnv\",\"evaluatorType\":\"MaxValuePolicy\",\"createdDate\":\"2021-12-07T03:49:26Z\",\"provisioningState\":\"dspastjbkkdmfl\",\"uniqueIdentifier\":\"stmjlxrri\"},\"location\":\"ozapeew\",\"tags\":{\"cslevufuztckt\":\"xlktwkuzi\",\"tqedcgzulwm\":\"h\",\"rjvpglydzgkrvqee\":\"rqzz\",\"nwy\":\"toepryu\"},\"id\":\"pzdm\",\"name\":\"vzvfvaawzqadfl\",\"type\":\"z\"},{\"properties\":{\"description\":\"iglaecx\",\"status\":\"Enabled\",\"factName\":\"UserOwnedLabVmCount\",\"factData\":\"kpvzmlq\",\"threshold\":\"ld\",\"evaluatorType\":\"MaxValuePolicy\",\"createdDate\":\"2021-04-30T06:35:53Z\",\"provisioningState\":\"rclnpkc\",\"uniqueIdentifier\":\"yzriykhy\"},\"location\":\"wf\",\"tags\":{\"xqvkjlmxhomdyn\":\"b\",\"raauzzpt\":\"dwdigumb\",\"ysdzhez\":\"a\"},\"id\":\"wva\",\"name\":\"qyuvvfonkp\",\"type\":\"hqyikvy\"},{\"properties\":{\"description\":\"uyav\",\"status\":\"Enabled\",\"factName\":\"UserOwnedLabVmCountInSubnet\",\"factData\":\"sttijfybvp\",\"threshold\":\"krsgsgb\",\"evaluatorType\":\"MaxValuePolicy\",\"createdDate\":\"2021-08-27T04:01:57Z\",\"provisioningState\":\"njdgkynscliq\",\"uniqueIdentifier\":\"vhxnk\"},\"location\":\"mtk\",\"tags\":{\"dxzxhi\":\"tppn\",\"vqagtltdhlf\":\"frbbc\"},\"id\":\"qojpy\",\"name\":\"vgtrdcnifmzzs\",\"type\":\"ymbrnysuxmpraf\"}],\"nextLink\":\"ckh\"}") + "{\"value\":[{\"properties\":{\"description\":\"wzhhzjhfjmhvvmuv\",\"status\":\"Enabled\",\"factName\":\"LabVmSize\",\"factData\":\"qsxvmhf\",\"threshold\":\"zjyi\",\"evaluatorType\":\"AllowedValuesPolicy\",\"createdDate\":\"2020-12-23T10:26:10Z\",\"provisioningState\":\"udypohyuems\",\"uniqueIdentifier\":\"nsqyrpfoobrltt\"},\"tags\":{\"nfwqzdzgtilaxhn\":\"jnygq\",\"wivkxo\":\"hqlyvijo\",\"ti\":\"zunbixx\",\"vtsoxf\":\"vcpwpgclrc\"},\"location\":\"enxpmyyefr\",\"id\":\"pdnqqskawaoqvmmb\",\"name\":\"pqfrtqlkz\",\"type\":\"egnitg\"}],\"nextLink\":\"xlzyqd\"}") .toObject(PolicyList.class); - Assertions.assertEquals("ddrihpf", model.value().get(0).location()); - Assertions.assertEquals("caaewdao", model.value().get(0).tags().get("djvlpj")); - Assertions.assertEquals("er", model.value().get(0).description()); - Assertions.assertEquals(PolicyStatus.DISABLED, model.value().get(0).status()); + Assertions.assertEquals("jnygq", model.value().get(0).tags().get("nfwqzdzgtilaxhn")); + Assertions.assertEquals("enxpmyyefr", model.value().get(0).location()); + Assertions.assertEquals("wzhhzjhfjmhvvmuv", model.value().get(0).description()); + Assertions.assertEquals(PolicyStatus.ENABLED, model.value().get(0).status()); Assertions.assertEquals(PolicyFactName.LAB_VM_SIZE, model.value().get(0).factName()); - Assertions.assertEquals("f", model.value().get(0).factData()); - Assertions.assertEquals("babwidfcxss", model.value().get(0).threshold()); + Assertions.assertEquals("qsxvmhf", model.value().get(0).factData()); + Assertions.assertEquals("zjyi", model.value().get(0).threshold()); Assertions.assertEquals(PolicyEvaluatorType.ALLOWED_VALUES_POLICY, model.value().get(0).evaluatorType()); - Assertions.assertEquals("ckh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PolicyList model - = new PolicyList().withValue(Arrays.asList( - new PolicyInner().withLocation("ddrihpf") - .withTags(mapOf("djvlpj", "caaewdao", "msgeivsiykzk", "xkzb", "xonbzoggculapz", "ncj", - "pgogtqxepny", "y")) - .withDescription("er") - .withStatus(PolicyStatus.DISABLED) - .withFactName(PolicyFactName.LAB_VM_SIZE) - .withFactData("f") - .withThreshold("babwidfcxss") - .withEvaluatorType(PolicyEvaluatorType.ALLOWED_VALUES_POLICY), - new PolicyInner().withLocation("ozapeew") - .withTags(mapOf("cslevufuztckt", "xlktwkuzi", "tqedcgzulwm", "h", "rjvpglydzgkrvqee", "rqzz", "nwy", - "toepryu")) - .withDescription("xrkjpvdw") - .withStatus(PolicyStatus.DISABLED) - .withFactName(PolicyFactName.USER_OWNED_LAB_VM_COUNT_IN_SUBNET) - .withFactData("vwzjbhyz") - .withThreshold("jrkambtrnegvmnv") - .withEvaluatorType(PolicyEvaluatorType.MAX_VALUE_POLICY), - new PolicyInner().withLocation("wf") - .withTags(mapOf("xqvkjlmxhomdyn", "b", "raauzzpt", "dwdigumb", "ysdzhez", "a")) - .withDescription("iglaecx") - .withStatus(PolicyStatus.ENABLED) - .withFactName(PolicyFactName.USER_OWNED_LAB_VM_COUNT) - .withFactData("kpvzmlq") - .withThreshold("ld") - .withEvaluatorType(PolicyEvaluatorType.MAX_VALUE_POLICY), - new PolicyInner().withLocation("mtk") - .withTags(mapOf("dxzxhi", "tppn", "vqagtltdhlf", "frbbc")) - .withDescription("uyav") - .withStatus(PolicyStatus.ENABLED) - .withFactName(PolicyFactName.USER_OWNED_LAB_VM_COUNT_IN_SUBNET) - .withFactData("sttijfybvp") - .withThreshold("krsgsgb") - .withEvaluatorType(PolicyEvaluatorType.MAX_VALUE_POLICY))) - .withNextLink("ckh"); - model = BinaryData.fromObject(model).toObject(PolicyList.class); - Assertions.assertEquals("ddrihpf", model.value().get(0).location()); - Assertions.assertEquals("caaewdao", model.value().get(0).tags().get("djvlpj")); - Assertions.assertEquals("er", model.value().get(0).description()); - Assertions.assertEquals(PolicyStatus.DISABLED, model.value().get(0).status()); - Assertions.assertEquals(PolicyFactName.LAB_VM_SIZE, model.value().get(0).factName()); - Assertions.assertEquals("f", model.value().get(0).factData()); - Assertions.assertEquals("babwidfcxss", model.value().get(0).threshold()); - Assertions.assertEquals(PolicyEvaluatorType.ALLOWED_VALUES_POLICY, model.value().get(0).evaluatorType()); - Assertions.assertEquals("ckh", 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; + Assertions.assertEquals("xlzyqd", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyPropertiesTests.java index 79944a75ba7e..bb89658cce42 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PolicyPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -15,30 +15,30 @@ public final class PolicyPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PolicyProperties model = BinaryData.fromString( - "{\"description\":\"jocqwogfnzjvusf\",\"status\":\"Enabled\",\"factName\":\"UserOwnedLabVmCountInSubnet\",\"factData\":\"uxylfsbtkadpy\",\"threshold\":\"wn\",\"evaluatorType\":\"MaxValuePolicy\",\"createdDate\":\"2021-04-15T00:26:04Z\",\"provisioningState\":\"grjqctojcmi\",\"uniqueIdentifier\":\"fieypefojyqdhcup\"}") + "{\"description\":\"hfcf\",\"status\":\"Enabled\",\"factName\":\"GalleryImage\",\"factData\":\"neuvyinzqod\",\"threshold\":\"pgshoxgsgbpfgz\",\"evaluatorType\":\"AllowedValuesPolicy\",\"createdDate\":\"2021-11-13T03:02:01Z\",\"provisioningState\":\"flbqvgaq\",\"uniqueIdentifier\":\"gafcqu\"}") .toObject(PolicyProperties.class); - Assertions.assertEquals("jocqwogfnzjvusf", model.description()); + Assertions.assertEquals("hfcf", model.description()); Assertions.assertEquals(PolicyStatus.ENABLED, model.status()); - Assertions.assertEquals(PolicyFactName.USER_OWNED_LAB_VM_COUNT_IN_SUBNET, model.factName()); - Assertions.assertEquals("uxylfsbtkadpy", model.factData()); - Assertions.assertEquals("wn", model.threshold()); - Assertions.assertEquals(PolicyEvaluatorType.MAX_VALUE_POLICY, model.evaluatorType()); + Assertions.assertEquals(PolicyFactName.GALLERY_IMAGE, model.factName()); + Assertions.assertEquals("neuvyinzqod", model.factData()); + Assertions.assertEquals("pgshoxgsgbpfgz", model.threshold()); + Assertions.assertEquals(PolicyEvaluatorType.ALLOWED_VALUES_POLICY, model.evaluatorType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PolicyProperties model = new PolicyProperties().withDescription("jocqwogfnzjvusf") + PolicyProperties model = new PolicyProperties().withDescription("hfcf") .withStatus(PolicyStatus.ENABLED) - .withFactName(PolicyFactName.USER_OWNED_LAB_VM_COUNT_IN_SUBNET) - .withFactData("uxylfsbtkadpy") - .withThreshold("wn") - .withEvaluatorType(PolicyEvaluatorType.MAX_VALUE_POLICY); + .withFactName(PolicyFactName.GALLERY_IMAGE) + .withFactData("neuvyinzqod") + .withThreshold("pgshoxgsgbpfgz") + .withEvaluatorType(PolicyEvaluatorType.ALLOWED_VALUES_POLICY); model = BinaryData.fromObject(model).toObject(PolicyProperties.class); - Assertions.assertEquals("jocqwogfnzjvusf", model.description()); + Assertions.assertEquals("hfcf", model.description()); Assertions.assertEquals(PolicyStatus.ENABLED, model.status()); - Assertions.assertEquals(PolicyFactName.USER_OWNED_LAB_VM_COUNT_IN_SUBNET, model.factName()); - Assertions.assertEquals("uxylfsbtkadpy", model.factData()); - Assertions.assertEquals("wn", model.threshold()); - Assertions.assertEquals(PolicyEvaluatorType.MAX_VALUE_POLICY, model.evaluatorType()); + Assertions.assertEquals(PolicyFactName.GALLERY_IMAGE, model.factName()); + Assertions.assertEquals("neuvyinzqod", model.factData()); + Assertions.assertEquals("pgshoxgsgbpfgz", model.threshold()); + Assertions.assertEquals(PolicyEvaluatorType.ALLOWED_VALUES_POLICY, model.evaluatorType()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PortTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PortTests.java index 2c1a571867a9..126436b643f6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PortTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/PortTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,16 +13,16 @@ public final class PortTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Port model - = BinaryData.fromString("{\"transportProtocol\":\"Udp\",\"backendPort\":149368324}").toObject(Port.class); + = BinaryData.fromString("{\"transportProtocol\":\"Udp\",\"backendPort\":1754842932}").toObject(Port.class); Assertions.assertEquals(TransportProtocol.UDP, model.transportProtocol()); - Assertions.assertEquals(149368324, model.backendPort()); + Assertions.assertEquals(1754842932, model.backendPort()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Port model = new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(149368324); + Port model = new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(1754842932); model = BinaryData.fromObject(model).toObject(Port.class); Assertions.assertEquals(TransportProtocol.UDP, model.transportProtocol()); - Assertions.assertEquals(149368324, model.backendPort()); + Assertions.assertEquals(1754842932, model.backendPort()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationResultTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationResultTests.java deleted file mode 100644 index 3a9236dcbe4c..000000000000 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationResultTests.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.devtestlabs.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.OperationMetadataInner; -import com.azure.resourcemanager.devtestlabs.models.OperationMetadataDisplay; -import com.azure.resourcemanager.devtestlabs.models.ProviderOperationResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ProviderOperationResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProviderOperationResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"zopbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"}},{\"name\":\"ownoizhw\",\"display\":{\"provider\":\"ybqsoqijg\",\"resource\":\"mbpazlobcufpdzn\",\"operation\":\"t\",\"description\":\"qjnqglhqgnufoooj\"}},{\"name\":\"ifsqesaagdfmg\",\"display\":{\"provider\":\"hjxri\",\"resource\":\"wmrvktsizntocipa\",\"operation\":\"ajpsquc\",\"description\":\"o\"}}],\"nextLink\":\"dkfo\"}") - .toObject(ProviderOperationResult.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); - Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProviderOperationResult model = new ProviderOperationResult().withValue(Arrays.asList( - new OperationMetadataInner().withName("quvgjxpybczme") - .withDisplay(new OperationMetadataDisplay().withProvider("zopbsphrupidgs") - .withResource("bejhphoycmsxa") - .withOperation("hdxbmtqio") - .withDescription("zehtbmu")), - new OperationMetadataInner().withName("ownoizhw") - .withDisplay(new OperationMetadataDisplay().withProvider("ybqsoqijg") - .withResource("mbpazlobcufpdzn") - .withOperation("t") - .withDescription("qjnqglhqgnufoooj")), - new OperationMetadataInner().withName("ifsqesaagdfmg") - .withDisplay(new OperationMetadataDisplay().withProvider("hjxri") - .withResource("wmrvktsizntocipa") - .withOperation("ajpsquc") - .withDescription("o")))); - model = BinaryData.fromObject(model).toObject(ProviderOperationResult.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); - Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); - } -} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListMockTests.java index e4b4ac70a14e..94469e9a71e6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListMockTests.java @@ -1,20 +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.devtestlabs.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.devtestlabs.DevTestLabsManager; -import com.azure.resourcemanager.devtestlabs.models.OperationMetadata; +import com.azure.resourcemanager.devtestlabs.models.Operation; 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; @@ -22,21 +21,16 @@ public final class ProviderOperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"svjgpliufiqwoyxq\",\"display\":{\"provider\":\"cohhoucqpqo\",\"resource\":\"cxzrzdcgdzben\",\"operation\":\"bcawetz\",\"description\":\"dtjwfljhznamt\"}}]}"; + = "{\"value\":[{\"name\":\"bhbcdszir\",\"isDataAction\":false,\"display\":{\"provider\":\"oypmbltoorm\",\"resource\":\"qlwxldyka\",\"operation\":\"ygaolnjpnnb\",\"description\":\"ksibjgsjjxx\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.providerOperations().list(com.azure.core.util.Context.NONE); + PagedIterable response = manager.providerOperations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("svjgpliufiqwoyxq", response.iterator().next().name()); - Assertions.assertEquals("cohhoucqpqo", response.iterator().next().display().provider()); - Assertions.assertEquals("cxzrzdcgdzben", response.iterator().next().display().resource()); - Assertions.assertEquals("bcawetz", response.iterator().next().display().operation()); - Assertions.assertEquals("dtjwfljhznamt", response.iterator().next().display().description()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/RdpConnectionInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/RdpConnectionInnerTests.java index 49e1cb6e2701..be56730bc3b5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/RdpConnectionInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/RdpConnectionInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,14 +12,7 @@ public final class RdpConnectionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RdpConnectionInner model - = BinaryData.fromString("{\"contents\":\"qbawpcbbnzqcykn\"}").toObject(RdpConnectionInner.class); - Assertions.assertEquals("qbawpcbbnzqcykn", model.contents()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RdpConnectionInner model = new RdpConnectionInner().withContents("qbawpcbbnzqcykn"); - model = BinaryData.fromObject(model).toObject(RdpConnectionInner.class); - Assertions.assertEquals("qbawpcbbnzqcykn", model.contents()); + = BinaryData.fromString("{\"contents\":\"ygqwahoiu\"}").toObject(RdpConnectionInner.class); + Assertions.assertEquals("ygqwahoiu", model.contents()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ResizeLabVirtualMachinePropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ResizeLabVirtualMachinePropertiesTests.java index c5a97d41b572..f0753531f2fa 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ResizeLabVirtualMachinePropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ResizeLabVirtualMachinePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,14 +12,14 @@ public final class ResizeLabVirtualMachinePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ResizeLabVirtualMachineProperties model - = BinaryData.fromString("{\"size\":\"qofyuicdhzbdy\"}").toObject(ResizeLabVirtualMachineProperties.class); - Assertions.assertEquals("qofyuicdhzbdy", model.size()); + = BinaryData.fromString("{\"size\":\"gniiprglvaw\"}").toObject(ResizeLabVirtualMachineProperties.class); + Assertions.assertEquals("gniiprglvaw", model.size()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResizeLabVirtualMachineProperties model = new ResizeLabVirtualMachineProperties().withSize("qofyuicdhzbdy"); + ResizeLabVirtualMachineProperties model = new ResizeLabVirtualMachineProperties().withSize("gniiprglvaw"); model = BinaryData.fromObject(model).toObject(ResizeLabVirtualMachineProperties.class); - Assertions.assertEquals("qofyuicdhzbdy", model.size()); + Assertions.assertEquals("gniiprglvaw", model.size()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/RetargetSchedulePropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/RetargetSchedulePropertiesTests.java index b8996a21b849..8875c1ddfa5c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/RetargetSchedulePropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/RetargetSchedulePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,18 +12,18 @@ public final class RetargetSchedulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RetargetScheduleProperties model - = BinaryData.fromString("{\"currentResourceId\":\"azisgyk\",\"targetResourceId\":\"emv\"}") + = BinaryData.fromString("{\"currentResourceId\":\"x\",\"targetResourceId\":\"kpycgklwndnhjd\"}") .toObject(RetargetScheduleProperties.class); - Assertions.assertEquals("azisgyk", model.currentResourceId()); - Assertions.assertEquals("emv", model.targetResourceId()); + Assertions.assertEquals("x", model.currentResourceId()); + Assertions.assertEquals("kpycgklwndnhjd", model.targetResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { RetargetScheduleProperties model - = new RetargetScheduleProperties().withCurrentResourceId("azisgyk").withTargetResourceId("emv"); + = new RetargetScheduleProperties().withCurrentResourceId("x").withTargetResourceId("kpycgklwndnhjd"); model = BinaryData.fromObject(model).toObject(RetargetScheduleProperties.class); - Assertions.assertEquals("azisgyk", model.currentResourceId()); - Assertions.assertEquals("emv", model.targetResourceId()); + Assertions.assertEquals("x", model.currentResourceId()); + Assertions.assertEquals("kpycgklwndnhjd", model.targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleCreationParameterPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleCreationParameterPropertiesTests.java index 956bbf31ca75..3ea51ebadd58 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleCreationParameterPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleCreationParameterPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -18,51 +18,51 @@ public final class ScheduleCreationParameterPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduleCreationParameterProperties model = BinaryData.fromString( - "{\"status\":\"Disabled\",\"taskType\":\"vtylbfpncu\",\"weeklyRecurrence\":{\"weekdays\":[\"wiithtywub\"],\"time\":\"bihwqknfdnt\"},\"dailyRecurrence\":{\"time\":\"hrdgoihxumwcto\"},\"hourlyRecurrence\":{\"minute\":498677295},\"timeZoneId\":\"uu\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":292953068,\"webhookUrl\":\"ytsbwtovv\",\"emailRecipient\":\"seinqfiuf\",\"notificationLocale\":\"knpirgnepttwq\"},\"targetResourceId\":\"niffcdmqnroj\"}") + "{\"status\":\"Disabled\",\"taskType\":\"trpmo\",\"weeklyRecurrence\":{\"weekdays\":[\"matuok\"],\"time\":\"fu\"},\"dailyRecurrence\":{\"time\":\"odsfcpkvxodpuozm\"},\"hourlyRecurrence\":{\"minute\":1714527436},\"timeZoneId\":\"gf\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1852056449,\"webhookUrl\":\"iu\",\"emailRecipient\":\"ktwh\",\"notificationLocale\":\"xw\"},\"targetResourceId\":\"wqsmbsur\"}") .toObject(ScheduleCreationParameterProperties.class); Assertions.assertEquals(EnableStatus.DISABLED, model.status()); - Assertions.assertEquals("vtylbfpncu", model.taskType()); - Assertions.assertEquals("wiithtywub", model.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("bihwqknfdnt", model.weeklyRecurrence().time()); - Assertions.assertEquals("hrdgoihxumwcto", model.dailyRecurrence().time()); - Assertions.assertEquals(498677295, model.hourlyRecurrence().minute()); - Assertions.assertEquals("uu", model.timeZoneId()); + Assertions.assertEquals("trpmo", model.taskType()); + Assertions.assertEquals("matuok", model.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("fu", model.weeklyRecurrence().time()); + Assertions.assertEquals("odsfcpkvxodpuozm", model.dailyRecurrence().time()); + Assertions.assertEquals(1714527436, model.hourlyRecurrence().minute()); + Assertions.assertEquals("gf", model.timeZoneId()); Assertions.assertEquals(EnableStatus.ENABLED, model.notificationSettings().status()); - Assertions.assertEquals(292953068, model.notificationSettings().timeInMinutes()); - Assertions.assertEquals("ytsbwtovv", model.notificationSettings().webhookUrl()); - Assertions.assertEquals("seinqfiuf", model.notificationSettings().emailRecipient()); - Assertions.assertEquals("knpirgnepttwq", model.notificationSettings().notificationLocale()); - Assertions.assertEquals("niffcdmqnroj", model.targetResourceId()); + Assertions.assertEquals(1852056449, model.notificationSettings().timeInMinutes()); + Assertions.assertEquals("iu", model.notificationSettings().webhookUrl()); + Assertions.assertEquals("ktwh", model.notificationSettings().emailRecipient()); + Assertions.assertEquals("xw", model.notificationSettings().notificationLocale()); + Assertions.assertEquals("wqsmbsur", model.targetResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduleCreationParameterProperties model = new ScheduleCreationParameterProperties() - .withStatus(EnableStatus.DISABLED) - .withTaskType("vtylbfpncu") - .withWeeklyRecurrence(new WeekDetails().withWeekdays(Arrays.asList("wiithtywub")).withTime("bihwqknfdnt")) - .withDailyRecurrence(new DayDetails().withTime("hrdgoihxumwcto")) - .withHourlyRecurrence(new HourDetails().withMinute(498677295)) - .withTimeZoneId("uu") - .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.ENABLED) - .withTimeInMinutes(292953068) - .withWebhookUrl("ytsbwtovv") - .withEmailRecipient("seinqfiuf") - .withNotificationLocale("knpirgnepttwq")) - .withTargetResourceId("niffcdmqnroj"); + ScheduleCreationParameterProperties model + = new ScheduleCreationParameterProperties().withStatus(EnableStatus.DISABLED) + .withTaskType("trpmo") + .withWeeklyRecurrence(new WeekDetails().withWeekdays(Arrays.asList("matuok")).withTime("fu")) + .withDailyRecurrence(new DayDetails().withTime("odsfcpkvxodpuozm")) + .withHourlyRecurrence(new HourDetails().withMinute(1714527436)) + .withTimeZoneId("gf") + .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.ENABLED) + .withTimeInMinutes(1852056449) + .withWebhookUrl("iu") + .withEmailRecipient("ktwh") + .withNotificationLocale("xw")) + .withTargetResourceId("wqsmbsur"); model = BinaryData.fromObject(model).toObject(ScheduleCreationParameterProperties.class); Assertions.assertEquals(EnableStatus.DISABLED, model.status()); - Assertions.assertEquals("vtylbfpncu", model.taskType()); - Assertions.assertEquals("wiithtywub", model.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("bihwqknfdnt", model.weeklyRecurrence().time()); - Assertions.assertEquals("hrdgoihxumwcto", model.dailyRecurrence().time()); - Assertions.assertEquals(498677295, model.hourlyRecurrence().minute()); - Assertions.assertEquals("uu", model.timeZoneId()); + Assertions.assertEquals("trpmo", model.taskType()); + Assertions.assertEquals("matuok", model.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("fu", model.weeklyRecurrence().time()); + Assertions.assertEquals("odsfcpkvxodpuozm", model.dailyRecurrence().time()); + Assertions.assertEquals(1714527436, model.hourlyRecurrence().minute()); + Assertions.assertEquals("gf", model.timeZoneId()); Assertions.assertEquals(EnableStatus.ENABLED, model.notificationSettings().status()); - Assertions.assertEquals(292953068, model.notificationSettings().timeInMinutes()); - Assertions.assertEquals("ytsbwtovv", model.notificationSettings().webhookUrl()); - Assertions.assertEquals("seinqfiuf", model.notificationSettings().emailRecipient()); - Assertions.assertEquals("knpirgnepttwq", model.notificationSettings().notificationLocale()); - Assertions.assertEquals("niffcdmqnroj", model.targetResourceId()); + Assertions.assertEquals(1852056449, model.notificationSettings().timeInMinutes()); + Assertions.assertEquals("iu", model.notificationSettings().webhookUrl()); + Assertions.assertEquals("ktwh", model.notificationSettings().emailRecipient()); + Assertions.assertEquals("xw", model.notificationSettings().notificationLocale()); + Assertions.assertEquals("wqsmbsur", model.targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleCreationParameterTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleCreationParameterTests.java index 1019ecc2e563..221048091dfb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleCreationParameterTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleCreationParameterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -20,58 +20,57 @@ public final class ScheduleCreationParameterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduleCreationParameter model = BinaryData.fromString( - "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"azpxdtnkdmkqjjl\",\"weeklyRecurrence\":{\"weekdays\":[\"vrkpyouaibreb\"],\"time\":\"aysjkixqtnqttez\"},\"dailyRecurrence\":{\"time\":\"ffiakp\"},\"hourlyRecurrence\":{\"minute\":658417740},\"timeZoneId\":\"tedltmmj\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":968506113,\"webhookUrl\":\"hvwauyqncy\",\"emailRecipient\":\"p\",\"notificationLocale\":\"ipmdscwx\"},\"targetResourceId\":\"pevzhfst\"},\"name\":\"xhojuj\",\"location\":\"pelmcuvhixbjxyf\",\"tags\":{\"kkbnu\":\"lrcoolsttpki\"}}") + "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"gujjugwdkcglh\",\"weeklyRecurrence\":{\"weekdays\":[\"jdyggdtji\"],\"time\":\"b\"},\"dailyRecurrence\":{\"time\":\"fqweykhmene\"},\"hourlyRecurrence\":{\"minute\":1569477308},\"timeZoneId\":\"fwhybcibvy\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1668619152,\"webhookUrl\":\"nnaamdectehfiqsc\",\"emailRecipient\":\"ypvhezrkg\",\"notificationLocale\":\"c\"},\"targetResourceId\":\"efovgmk\"},\"name\":\"leyyvx\",\"location\":\"jpkcattpng\",\"tags\":{\"jh\":\"cczsq\",\"ysou\":\"mdajv\",\"canoaeupf\":\"q\"}}") .toObject(ScheduleCreationParameter.class); - Assertions.assertEquals("xhojuj", model.name()); - Assertions.assertEquals("lrcoolsttpki", model.tags().get("kkbnu")); + Assertions.assertEquals("leyyvx", model.name()); + Assertions.assertEquals("cczsq", model.tags().get("jh")); Assertions.assertEquals(EnableStatus.DISABLED, model.status()); - Assertions.assertEquals("azpxdtnkdmkqjjl", model.taskType()); - Assertions.assertEquals("vrkpyouaibreb", model.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("aysjkixqtnqttez", model.weeklyRecurrence().time()); - Assertions.assertEquals("ffiakp", model.dailyRecurrence().time()); - Assertions.assertEquals(658417740, model.hourlyRecurrence().minute()); - Assertions.assertEquals("tedltmmj", model.timeZoneId()); + Assertions.assertEquals("gujjugwdkcglh", model.taskType()); + Assertions.assertEquals("jdyggdtji", model.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("b", model.weeklyRecurrence().time()); + Assertions.assertEquals("fqweykhmene", model.dailyRecurrence().time()); + Assertions.assertEquals(1569477308, model.hourlyRecurrence().minute()); + Assertions.assertEquals("fwhybcibvy", model.timeZoneId()); Assertions.assertEquals(EnableStatus.ENABLED, model.notificationSettings().status()); - Assertions.assertEquals(968506113, model.notificationSettings().timeInMinutes()); - Assertions.assertEquals("hvwauyqncy", model.notificationSettings().webhookUrl()); - Assertions.assertEquals("p", model.notificationSettings().emailRecipient()); - Assertions.assertEquals("ipmdscwx", model.notificationSettings().notificationLocale()); - Assertions.assertEquals("pevzhfst", model.targetResourceId()); + Assertions.assertEquals(1668619152, model.notificationSettings().timeInMinutes()); + Assertions.assertEquals("nnaamdectehfiqsc", model.notificationSettings().webhookUrl()); + Assertions.assertEquals("ypvhezrkg", model.notificationSettings().emailRecipient()); + Assertions.assertEquals("c", model.notificationSettings().notificationLocale()); + Assertions.assertEquals("efovgmk", model.targetResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduleCreationParameter model = new ScheduleCreationParameter().withName("xhojuj") - .withTags(mapOf("kkbnu", "lrcoolsttpki")) + ScheduleCreationParameter model = new ScheduleCreationParameter().withName("leyyvx") + .withTags(mapOf("jh", "cczsq", "ysou", "mdajv", "canoaeupf", "q")) .withStatus(EnableStatus.DISABLED) - .withTaskType("azpxdtnkdmkqjjl") - .withWeeklyRecurrence( - new WeekDetails().withWeekdays(Arrays.asList("vrkpyouaibreb")).withTime("aysjkixqtnqttez")) - .withDailyRecurrence(new DayDetails().withTime("ffiakp")) - .withHourlyRecurrence(new HourDetails().withMinute(658417740)) - .withTimeZoneId("tedltmmj") + .withTaskType("gujjugwdkcglh") + .withWeeklyRecurrence(new WeekDetails().withWeekdays(Arrays.asList("jdyggdtji")).withTime("b")) + .withDailyRecurrence(new DayDetails().withTime("fqweykhmene")) + .withHourlyRecurrence(new HourDetails().withMinute(1569477308)) + .withTimeZoneId("fwhybcibvy") .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.ENABLED) - .withTimeInMinutes(968506113) - .withWebhookUrl("hvwauyqncy") - .withEmailRecipient("p") - .withNotificationLocale("ipmdscwx")) - .withTargetResourceId("pevzhfst"); + .withTimeInMinutes(1668619152) + .withWebhookUrl("nnaamdectehfiqsc") + .withEmailRecipient("ypvhezrkg") + .withNotificationLocale("c")) + .withTargetResourceId("efovgmk"); model = BinaryData.fromObject(model).toObject(ScheduleCreationParameter.class); - Assertions.assertEquals("xhojuj", model.name()); - Assertions.assertEquals("lrcoolsttpki", model.tags().get("kkbnu")); + Assertions.assertEquals("leyyvx", model.name()); + Assertions.assertEquals("cczsq", model.tags().get("jh")); Assertions.assertEquals(EnableStatus.DISABLED, model.status()); - Assertions.assertEquals("azpxdtnkdmkqjjl", model.taskType()); - Assertions.assertEquals("vrkpyouaibreb", model.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("aysjkixqtnqttez", model.weeklyRecurrence().time()); - Assertions.assertEquals("ffiakp", model.dailyRecurrence().time()); - Assertions.assertEquals(658417740, model.hourlyRecurrence().minute()); - Assertions.assertEquals("tedltmmj", model.timeZoneId()); + Assertions.assertEquals("gujjugwdkcglh", model.taskType()); + Assertions.assertEquals("jdyggdtji", model.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("b", model.weeklyRecurrence().time()); + Assertions.assertEquals("fqweykhmene", model.dailyRecurrence().time()); + Assertions.assertEquals(1569477308, model.hourlyRecurrence().minute()); + Assertions.assertEquals("fwhybcibvy", model.timeZoneId()); Assertions.assertEquals(EnableStatus.ENABLED, model.notificationSettings().status()); - Assertions.assertEquals(968506113, model.notificationSettings().timeInMinutes()); - Assertions.assertEquals("hvwauyqncy", model.notificationSettings().webhookUrl()); - Assertions.assertEquals("p", model.notificationSettings().emailRecipient()); - Assertions.assertEquals("ipmdscwx", model.notificationSettings().notificationLocale()); - Assertions.assertEquals("pevzhfst", model.targetResourceId()); + Assertions.assertEquals(1668619152, model.notificationSettings().timeInMinutes()); + Assertions.assertEquals("nnaamdectehfiqsc", model.notificationSettings().webhookUrl()); + Assertions.assertEquals("ypvhezrkg", model.notificationSettings().emailRecipient()); + Assertions.assertEquals("c", model.notificationSettings().notificationLocale()); + Assertions.assertEquals("efovgmk", model.targetResourceId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleFragmentTests.java index 66781044ba54..59272c170fa7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,16 +13,18 @@ public final class ScheduleFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScheduleFragment model - = BinaryData.fromString("{\"tags\":{\"uqovekqvgqouwif\":\"yowc\"}}").toObject(ScheduleFragment.class); - Assertions.assertEquals("yowc", model.tags().get("uqovekqvgqouwif")); + ScheduleFragment model = BinaryData.fromString( + "{\"tags\":{\"qdqgbi\":\"zpwv\",\"fcivfsnkym\":\"ylihkaetckt\",\"jf\":\"ctq\",\"fuwutttxf\":\"ebrjcxe\"}}") + .toObject(ScheduleFragment.class); + Assertions.assertEquals("zpwv", model.tags().get("qdqgbi")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduleFragment model = new ScheduleFragment().withTags(mapOf("uqovekqvgqouwif", "yowc")); + ScheduleFragment model = new ScheduleFragment() + .withTags(mapOf("qdqgbi", "zpwv", "fcivfsnkym", "ylihkaetckt", "jf", "ctq", "fuwutttxf", "ebrjcxe")); model = BinaryData.fromObject(model).toObject(ScheduleFragment.class); - Assertions.assertEquals("yowc", model.tags().get("uqovekqvgqouwif")); + Assertions.assertEquals("zpwv", model.tags().get("qdqgbi")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleInnerTests.java index 6edac407ae28..738afba68a3c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -20,57 +20,58 @@ public final class ScheduleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduleInner model = BinaryData.fromString( - "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"fkts\",\"weeklyRecurrence\":{\"weekdays\":[\"cocmnyyaztt\"],\"time\":\"wwrq\"},\"dailyRecurrence\":{\"time\":\"dckzywbiexz\"},\"hourlyRecurrence\":{\"minute\":315634017},\"timeZoneId\":\"axibxujw\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1182122396,\"webhookUrl\":\"uzyoxaep\",\"emailRecipient\":\"zjancuxr\",\"notificationLocale\":\"wbavxbniwdj\"},\"createdDate\":\"2021-04-13T19:54:16Z\",\"targetResourceId\":\"s\",\"provisioningState\":\"pgn\",\"uniqueIdentifier\":\"txhp\"},\"location\":\"xbzpfzab\",\"tags\":{\"lwzbhvgyugu\":\"uhxwtctyqiklbbov\"},\"id\":\"svmkfssxquk\",\"name\":\"fpl\",\"type\":\"mg\"}") + "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"u\",\"weeklyRecurrence\":{\"weekdays\":[\"faxkffeii\",\"hl\",\"m\"],\"time\":\"yvshxmz\"},\"dailyRecurrence\":{\"time\":\"zoggigrxwburvjxx\"},\"hourlyRecurrence\":{\"minute\":1875025396},\"timeZoneId\":\"dptkoenkouk\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1378070116,\"webhookUrl\":\"ukbldngkpo\",\"emailRecipient\":\"pazyxoegukg\",\"notificationLocale\":\"piu\"},\"createdDate\":\"2021-06-28T11:14:38Z\",\"targetResourceId\":\"evqzntypmrbp\",\"provisioningState\":\"c\",\"uniqueIdentifier\":\"qjsdpydnfyhxdeo\"},\"tags\":{\"zfbishcbkhaj\":\"icwifsjtt\"},\"location\":\"yeamdphagalpb\",\"id\":\"wgipwhono\",\"name\":\"kgshwa\",\"type\":\"kix\"}") .toObject(ScheduleInner.class); - Assertions.assertEquals("xbzpfzab", model.location()); - Assertions.assertEquals("uhxwtctyqiklbbov", model.tags().get("lwzbhvgyugu")); + Assertions.assertEquals("icwifsjtt", model.tags().get("zfbishcbkhaj")); + Assertions.assertEquals("yeamdphagalpb", model.location()); Assertions.assertEquals(EnableStatus.DISABLED, model.status()); - Assertions.assertEquals("fkts", model.taskType()); - Assertions.assertEquals("cocmnyyaztt", model.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("wwrq", model.weeklyRecurrence().time()); - Assertions.assertEquals("dckzywbiexz", model.dailyRecurrence().time()); - Assertions.assertEquals(315634017, model.hourlyRecurrence().minute()); - Assertions.assertEquals("axibxujw", model.timeZoneId()); - Assertions.assertEquals(EnableStatus.ENABLED, model.notificationSettings().status()); - Assertions.assertEquals(1182122396, model.notificationSettings().timeInMinutes()); - Assertions.assertEquals("uzyoxaep", model.notificationSettings().webhookUrl()); - Assertions.assertEquals("zjancuxr", model.notificationSettings().emailRecipient()); - Assertions.assertEquals("wbavxbniwdj", model.notificationSettings().notificationLocale()); - Assertions.assertEquals("s", model.targetResourceId()); + Assertions.assertEquals("u", model.taskType()); + Assertions.assertEquals("faxkffeii", model.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("yvshxmz", model.weeklyRecurrence().time()); + Assertions.assertEquals("zoggigrxwburvjxx", model.dailyRecurrence().time()); + Assertions.assertEquals(1875025396, model.hourlyRecurrence().minute()); + Assertions.assertEquals("dptkoenkouk", model.timeZoneId()); + Assertions.assertEquals(EnableStatus.DISABLED, model.notificationSettings().status()); + Assertions.assertEquals(1378070116, model.notificationSettings().timeInMinutes()); + Assertions.assertEquals("ukbldngkpo", model.notificationSettings().webhookUrl()); + Assertions.assertEquals("pazyxoegukg", model.notificationSettings().emailRecipient()); + Assertions.assertEquals("piu", model.notificationSettings().notificationLocale()); + Assertions.assertEquals("evqzntypmrbp", model.targetResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduleInner model = new ScheduleInner().withLocation("xbzpfzab") - .withTags(mapOf("lwzbhvgyugu", "uhxwtctyqiklbbov")) + ScheduleInner model = new ScheduleInner().withTags(mapOf("zfbishcbkhaj", "icwifsjtt")) + .withLocation("yeamdphagalpb") .withStatus(EnableStatus.DISABLED) - .withTaskType("fkts") - .withWeeklyRecurrence(new WeekDetails().withWeekdays(Arrays.asList("cocmnyyaztt")).withTime("wwrq")) - .withDailyRecurrence(new DayDetails().withTime("dckzywbiexz")) - .withHourlyRecurrence(new HourDetails().withMinute(315634017)) - .withTimeZoneId("axibxujw") - .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.ENABLED) - .withTimeInMinutes(1182122396) - .withWebhookUrl("uzyoxaep") - .withEmailRecipient("zjancuxr") - .withNotificationLocale("wbavxbniwdj")) - .withTargetResourceId("s"); + .withTaskType("u") + .withWeeklyRecurrence( + new WeekDetails().withWeekdays(Arrays.asList("faxkffeii", "hl", "m")).withTime("yvshxmz")) + .withDailyRecurrence(new DayDetails().withTime("zoggigrxwburvjxx")) + .withHourlyRecurrence(new HourDetails().withMinute(1875025396)) + .withTimeZoneId("dptkoenkouk") + .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.DISABLED) + .withTimeInMinutes(1378070116) + .withWebhookUrl("ukbldngkpo") + .withEmailRecipient("pazyxoegukg") + .withNotificationLocale("piu")) + .withTargetResourceId("evqzntypmrbp"); model = BinaryData.fromObject(model).toObject(ScheduleInner.class); - Assertions.assertEquals("xbzpfzab", model.location()); - Assertions.assertEquals("uhxwtctyqiklbbov", model.tags().get("lwzbhvgyugu")); + Assertions.assertEquals("icwifsjtt", model.tags().get("zfbishcbkhaj")); + Assertions.assertEquals("yeamdphagalpb", model.location()); Assertions.assertEquals(EnableStatus.DISABLED, model.status()); - Assertions.assertEquals("fkts", model.taskType()); - Assertions.assertEquals("cocmnyyaztt", model.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("wwrq", model.weeklyRecurrence().time()); - Assertions.assertEquals("dckzywbiexz", model.dailyRecurrence().time()); - Assertions.assertEquals(315634017, model.hourlyRecurrence().minute()); - Assertions.assertEquals("axibxujw", model.timeZoneId()); - Assertions.assertEquals(EnableStatus.ENABLED, model.notificationSettings().status()); - Assertions.assertEquals(1182122396, model.notificationSettings().timeInMinutes()); - Assertions.assertEquals("uzyoxaep", model.notificationSettings().webhookUrl()); - Assertions.assertEquals("zjancuxr", model.notificationSettings().emailRecipient()); - Assertions.assertEquals("wbavxbniwdj", model.notificationSettings().notificationLocale()); - Assertions.assertEquals("s", model.targetResourceId()); + Assertions.assertEquals("u", model.taskType()); + Assertions.assertEquals("faxkffeii", model.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("yvshxmz", model.weeklyRecurrence().time()); + Assertions.assertEquals("zoggigrxwburvjxx", model.dailyRecurrence().time()); + Assertions.assertEquals(1875025396, model.hourlyRecurrence().minute()); + Assertions.assertEquals("dptkoenkouk", model.timeZoneId()); + Assertions.assertEquals(EnableStatus.DISABLED, model.notificationSettings().status()); + Assertions.assertEquals(1378070116, model.notificationSettings().timeInMinutes()); + Assertions.assertEquals("ukbldngkpo", model.notificationSettings().webhookUrl()); + Assertions.assertEquals("pazyxoegukg", model.notificationSettings().emailRecipient()); + Assertions.assertEquals("piu", model.notificationSettings().notificationLocale()); + Assertions.assertEquals("evqzntypmrbp", model.targetResourceId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleListTests.java index 8bd38beb28ae..8bf2bd8cf19a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ScheduleListTests.java @@ -1,144 +1,35 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; -import com.azure.resourcemanager.devtestlabs.models.DayDetails; +import com.azure.resourcemanager.devtestlabs.implementation.models.ScheduleList; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; -import com.azure.resourcemanager.devtestlabs.models.HourDetails; -import com.azure.resourcemanager.devtestlabs.models.NotificationSettings; -import com.azure.resourcemanager.devtestlabs.models.ScheduleList; -import com.azure.resourcemanager.devtestlabs.models.WeekDetails; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ScheduleListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduleList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"evfyexfwhybcib\",\"weeklyRecurrence\":{\"weekdays\":[\"c\"],\"time\":\"tynnaamdectehfi\"},\"dailyRecurrence\":{\"time\":\"jeyp\"},\"hourlyRecurrence\":{\"minute\":1363658384},\"timeZoneId\":\"kgqhcjrefovg\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1096221203,\"webhookUrl\":\"yvxyqjp\",\"emailRecipient\":\"attpngjcrcczsq\",\"notificationLocale\":\"hvmdajvnysounq\"},\"createdDate\":\"2021-07-16T12:10:28Z\",\"targetResourceId\":\"oaeupfhyhltrpmo\",\"provisioningState\":\"mcmatuokthfuiu\",\"uniqueIdentifier\":\"dsfcpkvxodpuoz\"},\"location\":\"yzydagfuaxbezyi\",\"tags\":{\"dxwzywqsmbsurexi\":\"ktwh\",\"yocf\":\"o\",\"uxh\":\"fksymddystki\"},\"id\":\"yudxorrqnbp\",\"name\":\"czvyifq\",\"type\":\"vkd\"},{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"lrmv\",\"weeklyRecurrence\":{\"weekdays\":[\"atkpnp\",\"lexxbczwtru\",\"iqzbq\",\"vsovmyokac\"],\"time\":\"kwlhzdo\"},\"dailyRecurrence\":{\"time\":\"jmflbvvnch\"},\"hourlyRecurrence\":{\"minute\":682758161},\"timeZoneId\":\"wwzjuqkhrsajiwku\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1637974204,\"webhookUrl\":\"sauuimj\",\"emailRecipient\":\"xieduugidyjrr\",\"notificationLocale\":\"y\"},\"createdDate\":\"2021-05-02T14:53:40Z\",\"targetResourceId\":\"e\",\"provisioningState\":\"sonpclhocohs\",\"uniqueIdentifier\":\"ev\"},\"location\":\"eggzfb\",\"tags\":{\"vmezy\":\"mvfaxkffeiith\",\"burvjxxjnspy\":\"shxmzsbbzoggigrx\",\"udwtiukbl\":\"ptkoenkoukn\",\"o\":\"ngkpocipazy\"},\"id\":\"gukgjnpiucgygevq\",\"name\":\"ntypmrbpizcdrqj\",\"type\":\"dpydn\"},{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"de\",\"weeklyRecurrence\":{\"weekdays\":[\"icwifsjtt\"],\"time\":\"fbishcbkha\"},\"dailyRecurrence\":{\"time\":\"yeamdphagalpb\"},\"hourlyRecurrence\":{\"minute\":605545221},\"timeZoneId\":\"pwhonowkg\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":595861111,\"webhookUrl\":\"xzbinjeputt\",\"emailRecipient\":\"ywnuzoq\",\"notificationLocale\":\"iyqzrnk\"},\"createdDate\":\"2021-04-18T03:15:34Z\",\"targetResourceId\":\"xlwhzlsicoh\",\"provisioningState\":\"qnwvlrya\",\"uniqueIdentifier\":\"hheunmmqhgyx\"},\"location\":\"konocu\",\"tags\":{\"nuqszfkbey\":\"lyaxuc\",\"senhwlrs\":\"ewrmjmwvvjektc\",\"qylihkaetckt\":\"frzpwvlqdqgb\"},\"id\":\"fcivfsnkym\",\"name\":\"ctq\",\"type\":\"jf\"},{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"jcxerfuwu\",\"weeklyRecurrence\":{\"weekdays\":[\"fvjrbirphxepcy\",\"ahfn\",\"jky\"],\"time\":\"j\"},\"dailyRecurrence\":{\"time\":\"j\"},\"hourlyRecurrence\":{\"minute\":1347060120},\"timeZoneId\":\"kgj\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":831407974,\"webhookUrl\":\"cltbgsncghkjesz\",\"emailRecipient\":\"bijhtxfvgxbf\",\"notificationLocale\":\"xnehmpvec\"},\"createdDate\":\"2021-06-15T22:18:20Z\",\"targetResourceId\":\"ebfqkkrbm\",\"provisioningState\":\"kgriwflzlfbx\",\"uniqueIdentifier\":\"uzycispnqza\"},\"location\":\"mgkbrpyydhibn\",\"tags\":{\"agnb\":\"kpikadrgvt\",\"fsiarbutr\":\"ynhijggme\",\"jrunmpxtt\":\"vpnazzm\",\"bnlankxmyskpb\":\"bh\"},\"id\":\"enbtkcxywny\",\"name\":\"nrs\",\"type\":\"nlqidybyxczf\"}],\"nextLink\":\"haaxdbabphl\"}") + "{\"value\":[{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"rp\",\"weeklyRecurrence\":{\"weekdays\":[\"c\",\"vahfn\",\"jky\",\"xjvuujqgidokg\"],\"time\":\"jyoxgvclt\"},\"dailyRecurrence\":{\"time\":\"ncghkje\"},\"hourlyRecurrence\":{\"minute\":991237131},\"timeZoneId\":\"ijhtxf\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":557104558,\"webhookUrl\":\"xnehmpvec\",\"emailRecipient\":\"odebfqkkrbmpu\",\"notificationLocale\":\"riwflzlfb\"},\"createdDate\":\"2021-09-10T17:06:39Z\",\"targetResourceId\":\"zycispn\",\"provisioningState\":\"ahmgkbrp\",\"uniqueIdentifier\":\"dhibnuq\"},\"tags\":{\"drgvtqagn\":\"ik\",\"mebf\":\"uynhijg\"},\"location\":\"arbu\",\"id\":\"cvpnazzmhjrunmpx\",\"name\":\"tdbhrbnla\",\"type\":\"kx\"},{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"pbh\",\"weeklyRecurrence\":{\"weekdays\":[\"kcxywnyt\",\"rsyn\",\"qidybyx\",\"zfcl\"],\"time\":\"axdbabph\"},\"dailyRecurrence\":{\"time\":\"qlfktsths\"},\"hourlyRecurrence\":{\"minute\":296949281},\"timeZoneId\":\"nyyazttbtwwrqpue\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":261140124,\"webhookUrl\":\"iexzfeyue\",\"emailRecipient\":\"ibx\",\"notificationLocale\":\"wbhqwal\"},\"createdDate\":\"2021-02-13T11:47:42Z\",\"targetResourceId\":\"oxaepd\",\"provisioningState\":\"jancu\",\"uniqueIdentifier\":\"hdwbavxbniwdjs\"},\"tags\":{\"bpg\":\"s\",\"fzab\":\"xytxhpzxbz\"},\"location\":\"cuh\",\"id\":\"tcty\",\"name\":\"iklbbovpl\",\"type\":\"zbhvgyuguosv\"},{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"sxqu\",\"weeklyRecurrence\":{\"weekdays\":[\"l\",\"mg\",\"xnkjzkdesl\"],\"time\":\"lopwiyig\"},\"dailyRecurrence\":{\"time\":\"kdwzbaiuebbaumny\"},\"hourlyRecurrence\":{\"minute\":61387410},\"timeZoneId\":\"eojnabc\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1104061727,\"webhookUrl\":\"siebtfhvpesapskr\",\"emailRecipient\":\"mhjjdhtldwkyzx\",\"notificationLocale\":\"tkncwsc\"},\"createdDate\":\"2021-08-14T16:13:22Z\",\"targetResourceId\":\"xotogtwrupqsxv\",\"provisioningState\":\"i\",\"uniqueIdentifier\":\"kvceoveilovnotyf\"},\"tags\":{\"wpn\":\"njbkcnxdhbttkph\",\"mclfplphoxuscr\":\"jtoqne\",\"psbjta\":\"abgy\"},\"location\":\"ugxywpmueef\",\"id\":\"wfqkquj\",\"name\":\"dsuyonobgla\",\"type\":\"cq\"},{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"mgyudxytlmoyrxv\",\"weeklyRecurrence\":{\"weekdays\":[\"wpzntxhdzh\"],\"time\":\"qj\"},\"dailyRecurrence\":{\"time\":\"kfrlhrxsbky\"},\"hourlyRecurrence\":{\"minute\":289990060},\"timeZoneId\":\"n\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1251191943,\"webhookUrl\":\"fkuwbcrnwbmehhse\",\"emailRecipient\":\"jusrtslhspk\",\"notificationLocale\":\"emaofmxagkvt\"},\"createdDate\":\"2021-03-13T09:06:02Z\",\"targetResourceId\":\"qkrhahvljua\",\"provisioningState\":\"quhcdhmduala\",\"uniqueIdentifier\":\"qpv\"},\"tags\":{\"zlfmisgwbnbbeld\":\"mwsrcrgvxpvgo\",\"ali\":\"wkz\",\"hashsfwxosow\":\"urqhaka\",\"cjooxdjebwpucwwf\":\"xcug\"},\"location\":\"vbvmeu\",\"id\":\"ivyhzceuojgjrwju\",\"name\":\"iotwmcdytdxwit\",\"type\":\"nrjawgqwg\"}],\"nextLink\":\"ni\"}") .toObject(ScheduleList.class); - Assertions.assertEquals("yzydagfuaxbezyi", model.value().get(0).location()); - Assertions.assertEquals("ktwh", model.value().get(0).tags().get("dxwzywqsmbsurexi")); + Assertions.assertEquals("ik", model.value().get(0).tags().get("drgvtqagn")); + Assertions.assertEquals("arbu", model.value().get(0).location()); Assertions.assertEquals(EnableStatus.DISABLED, model.value().get(0).status()); - Assertions.assertEquals("evfyexfwhybcib", model.value().get(0).taskType()); + Assertions.assertEquals("rp", model.value().get(0).taskType()); Assertions.assertEquals("c", model.value().get(0).weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("tynnaamdectehfi", model.value().get(0).weeklyRecurrence().time()); - Assertions.assertEquals("jeyp", model.value().get(0).dailyRecurrence().time()); - Assertions.assertEquals(1363658384, model.value().get(0).hourlyRecurrence().minute()); - Assertions.assertEquals("kgqhcjrefovg", model.value().get(0).timeZoneId()); + Assertions.assertEquals("jyoxgvclt", model.value().get(0).weeklyRecurrence().time()); + Assertions.assertEquals("ncghkje", model.value().get(0).dailyRecurrence().time()); + Assertions.assertEquals(991237131, model.value().get(0).hourlyRecurrence().minute()); + Assertions.assertEquals("ijhtxf", model.value().get(0).timeZoneId()); Assertions.assertEquals(EnableStatus.ENABLED, model.value().get(0).notificationSettings().status()); - Assertions.assertEquals(1096221203, model.value().get(0).notificationSettings().timeInMinutes()); - Assertions.assertEquals("yvxyqjp", model.value().get(0).notificationSettings().webhookUrl()); - Assertions.assertEquals("attpngjcrcczsq", model.value().get(0).notificationSettings().emailRecipient()); - Assertions.assertEquals("hvmdajvnysounq", model.value().get(0).notificationSettings().notificationLocale()); - Assertions.assertEquals("oaeupfhyhltrpmo", model.value().get(0).targetResourceId()); - Assertions.assertEquals("haaxdbabphl", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleList model - = new ScheduleList().withValue(Arrays.asList( - new ScheduleInner().withLocation("yzydagfuaxbezyi") - .withTags(mapOf("dxwzywqsmbsurexi", "ktwh", "yocf", "o", "uxh", "fksymddystki")) - .withStatus(EnableStatus.DISABLED) - .withTaskType("evfyexfwhybcib") - .withWeeklyRecurrence( - new WeekDetails().withWeekdays(Arrays.asList("c")).withTime("tynnaamdectehfi")) - .withDailyRecurrence(new DayDetails().withTime("jeyp")) - .withHourlyRecurrence(new HourDetails().withMinute(1363658384)) - .withTimeZoneId("kgqhcjrefovg") - .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.ENABLED) - .withTimeInMinutes(1096221203) - .withWebhookUrl("yvxyqjp") - .withEmailRecipient("attpngjcrcczsq") - .withNotificationLocale("hvmdajvnysounq")) - .withTargetResourceId("oaeupfhyhltrpmo"), - new ScheduleInner().withLocation("eggzfb") - .withTags(mapOf("vmezy", "mvfaxkffeiith", "burvjxxjnspy", "shxmzsbbzoggigrx", "udwtiukbl", - "ptkoenkoukn", "o", "ngkpocipazy")) - .withStatus(EnableStatus.ENABLED) - .withTaskType("lrmv") - .withWeeklyRecurrence( - new WeekDetails().withWeekdays(Arrays.asList("atkpnp", "lexxbczwtru", "iqzbq", "vsovmyokac")) - .withTime("kwlhzdo")) - .withDailyRecurrence(new DayDetails().withTime("jmflbvvnch")) - .withHourlyRecurrence(new HourDetails().withMinute(682758161)) - .withTimeZoneId("wwzjuqkhrsajiwku") - .withNotificationSettings(new NotificationSettings() - .withStatus(EnableStatus.DISABLED) - .withTimeInMinutes(1637974204) - .withWebhookUrl("sauuimj") - .withEmailRecipient("xieduugidyjrr") - .withNotificationLocale("y")) - .withTargetResourceId("e"), - new ScheduleInner().withLocation("konocu") - .withTags( - mapOf("nuqszfkbey", "lyaxuc", "senhwlrs", "ewrmjmwvvjektc", "qylihkaetckt", "frzpwvlqdqgb")) - .withStatus(EnableStatus.ENABLED) - .withTaskType("de") - .withWeeklyRecurrence( - new WeekDetails().withWeekdays(Arrays.asList("icwifsjtt")).withTime("fbishcbkha")) - .withDailyRecurrence(new DayDetails().withTime("yeamdphagalpb")) - .withHourlyRecurrence(new HourDetails().withMinute(605545221)) - .withTimeZoneId("pwhonowkg") - .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.DISABLED) - .withTimeInMinutes(595861111) - .withWebhookUrl("xzbinjeputt") - .withEmailRecipient("ywnuzoq") - .withNotificationLocale("iyqzrnk")) - .withTargetResourceId("xlwhzlsicoh"), - new ScheduleInner().withLocation("mgkbrpyydhibn") - .withTags(mapOf("agnb", "kpikadrgvt", "fsiarbutr", "ynhijggme", "jrunmpxtt", "vpnazzm", - "bnlankxmyskpb", "bh")) - .withStatus(EnableStatus.ENABLED) - .withTaskType("jcxerfuwu") - .withWeeklyRecurrence( - new WeekDetails().withWeekdays(Arrays.asList("fvjrbirphxepcy", "ahfn", "jky")).withTime("j")) - .withDailyRecurrence(new DayDetails().withTime("j")) - .withHourlyRecurrence(new HourDetails().withMinute(1347060120)) - .withTimeZoneId("kgj") - .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.ENABLED) - .withTimeInMinutes(831407974) - .withWebhookUrl("cltbgsncghkjesz") - .withEmailRecipient("bijhtxfvgxbf") - .withNotificationLocale("xnehmpvec")) - .withTargetResourceId("ebfqkkrbm"))) - .withNextLink("haaxdbabphl"); - model = BinaryData.fromObject(model).toObject(ScheduleList.class); - Assertions.assertEquals("yzydagfuaxbezyi", model.value().get(0).location()); - Assertions.assertEquals("ktwh", model.value().get(0).tags().get("dxwzywqsmbsurexi")); - Assertions.assertEquals(EnableStatus.DISABLED, model.value().get(0).status()); - Assertions.assertEquals("evfyexfwhybcib", model.value().get(0).taskType()); - Assertions.assertEquals("c", model.value().get(0).weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("tynnaamdectehfi", model.value().get(0).weeklyRecurrence().time()); - Assertions.assertEquals("jeyp", model.value().get(0).dailyRecurrence().time()); - Assertions.assertEquals(1363658384, model.value().get(0).hourlyRecurrence().minute()); - Assertions.assertEquals("kgqhcjrefovg", model.value().get(0).timeZoneId()); - Assertions.assertEquals(EnableStatus.ENABLED, model.value().get(0).notificationSettings().status()); - Assertions.assertEquals(1096221203, model.value().get(0).notificationSettings().timeInMinutes()); - Assertions.assertEquals("yvxyqjp", model.value().get(0).notificationSettings().webhookUrl()); - Assertions.assertEquals("attpngjcrcczsq", model.value().get(0).notificationSettings().emailRecipient()); - Assertions.assertEquals("hvmdajvnysounq", model.value().get(0).notificationSettings().notificationLocale()); - Assertions.assertEquals("oaeupfhyhltrpmo", model.value().get(0).targetResourceId()); - Assertions.assertEquals("haaxdbabphl", 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; + Assertions.assertEquals(557104558, model.value().get(0).notificationSettings().timeInMinutes()); + Assertions.assertEquals("xnehmpvec", model.value().get(0).notificationSettings().webhookUrl()); + Assertions.assertEquals("odebfqkkrbmpu", model.value().get(0).notificationSettings().emailRecipient()); + Assertions.assertEquals("riwflzlfb", model.value().get(0).notificationSettings().notificationLocale()); + Assertions.assertEquals("zycispn", model.value().get(0).targetResourceId()); + Assertions.assertEquals("ni", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulePropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulePropertiesTests.java index 7923f1bc25dd..f8e00f90aca1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulePropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -18,50 +18,50 @@ public final class SchedulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduleProperties model = BinaryData.fromString( - "{\"status\":\"Disabled\",\"taskType\":\"jzkdeslpvlopwi\",\"weeklyRecurrence\":{\"weekdays\":[\"xpkd\",\"zb\"],\"time\":\"uebbaumnyqup\"},\"dailyRecurrence\":{\"time\":\"ojnabckhsmtxpsie\"},\"hourlyRecurrence\":{\"minute\":1146165631},\"timeZoneId\":\"pesapskrdqmhjj\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":692373611,\"webhookUrl\":\"yzxuutkncw\",\"emailRecipient\":\"wsvlxotogtwrupqs\",\"notificationLocale\":\"nmic\"},\"createdDate\":\"2021-01-26T07:44:08Z\",\"targetResourceId\":\"eoveilovnotyf\",\"provisioningState\":\"cnjbkcnxdhbt\",\"uniqueIdentifier\":\"phywpnvj\"}") + "{\"status\":\"Enabled\",\"taskType\":\"jeputtmrywn\",\"weeklyRecurrence\":{\"weekdays\":[\"ftiyqzrnkcq\",\"yx\"],\"time\":\"hzls\"},\"dailyRecurrence\":{\"time\":\"hoqqnwvlr\"},\"hourlyRecurrence\":{\"minute\":240696862},\"timeZoneId\":\"heun\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1040307072,\"webhookUrl\":\"zko\",\"emailRecipient\":\"cukoklyaxuconu\",\"notificationLocale\":\"zf\"},\"createdDate\":\"2021-10-30T19:28:33Z\",\"targetResourceId\":\"pewr\",\"provisioningState\":\"mwvvjektcxsenhw\",\"uniqueIdentifier\":\"s\"}") .toObject(ScheduleProperties.class); - Assertions.assertEquals(EnableStatus.DISABLED, model.status()); - Assertions.assertEquals("jzkdeslpvlopwi", model.taskType()); - Assertions.assertEquals("xpkd", model.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("uebbaumnyqup", model.weeklyRecurrence().time()); - Assertions.assertEquals("ojnabckhsmtxpsie", model.dailyRecurrence().time()); - Assertions.assertEquals(1146165631, model.hourlyRecurrence().minute()); - Assertions.assertEquals("pesapskrdqmhjj", model.timeZoneId()); + Assertions.assertEquals(EnableStatus.ENABLED, model.status()); + Assertions.assertEquals("jeputtmrywn", model.taskType()); + Assertions.assertEquals("ftiyqzrnkcq", model.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("hzls", model.weeklyRecurrence().time()); + Assertions.assertEquals("hoqqnwvlr", model.dailyRecurrence().time()); + Assertions.assertEquals(240696862, model.hourlyRecurrence().minute()); + Assertions.assertEquals("heun", model.timeZoneId()); Assertions.assertEquals(EnableStatus.DISABLED, model.notificationSettings().status()); - Assertions.assertEquals(692373611, model.notificationSettings().timeInMinutes()); - Assertions.assertEquals("yzxuutkncw", model.notificationSettings().webhookUrl()); - Assertions.assertEquals("wsvlxotogtwrupqs", model.notificationSettings().emailRecipient()); - Assertions.assertEquals("nmic", model.notificationSettings().notificationLocale()); - Assertions.assertEquals("eoveilovnotyf", model.targetResourceId()); + Assertions.assertEquals(1040307072, model.notificationSettings().timeInMinutes()); + Assertions.assertEquals("zko", model.notificationSettings().webhookUrl()); + Assertions.assertEquals("cukoklyaxuconu", model.notificationSettings().emailRecipient()); + Assertions.assertEquals("zf", model.notificationSettings().notificationLocale()); + Assertions.assertEquals("pewr", model.targetResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduleProperties model = new ScheduleProperties().withStatus(EnableStatus.DISABLED) - .withTaskType("jzkdeslpvlopwi") - .withWeeklyRecurrence(new WeekDetails().withWeekdays(Arrays.asList("xpkd", "zb")).withTime("uebbaumnyqup")) - .withDailyRecurrence(new DayDetails().withTime("ojnabckhsmtxpsie")) - .withHourlyRecurrence(new HourDetails().withMinute(1146165631)) - .withTimeZoneId("pesapskrdqmhjj") + ScheduleProperties model = new ScheduleProperties().withStatus(EnableStatus.ENABLED) + .withTaskType("jeputtmrywn") + .withWeeklyRecurrence(new WeekDetails().withWeekdays(Arrays.asList("ftiyqzrnkcq", "yx")).withTime("hzls")) + .withDailyRecurrence(new DayDetails().withTime("hoqqnwvlr")) + .withHourlyRecurrence(new HourDetails().withMinute(240696862)) + .withTimeZoneId("heun") .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.DISABLED) - .withTimeInMinutes(692373611) - .withWebhookUrl("yzxuutkncw") - .withEmailRecipient("wsvlxotogtwrupqs") - .withNotificationLocale("nmic")) - .withTargetResourceId("eoveilovnotyf"); + .withTimeInMinutes(1040307072) + .withWebhookUrl("zko") + .withEmailRecipient("cukoklyaxuconu") + .withNotificationLocale("zf")) + .withTargetResourceId("pewr"); model = BinaryData.fromObject(model).toObject(ScheduleProperties.class); - Assertions.assertEquals(EnableStatus.DISABLED, model.status()); - Assertions.assertEquals("jzkdeslpvlopwi", model.taskType()); - Assertions.assertEquals("xpkd", model.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("uebbaumnyqup", model.weeklyRecurrence().time()); - Assertions.assertEquals("ojnabckhsmtxpsie", model.dailyRecurrence().time()); - Assertions.assertEquals(1146165631, model.hourlyRecurrence().minute()); - Assertions.assertEquals("pesapskrdqmhjj", model.timeZoneId()); + Assertions.assertEquals(EnableStatus.ENABLED, model.status()); + Assertions.assertEquals("jeputtmrywn", model.taskType()); + Assertions.assertEquals("ftiyqzrnkcq", model.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("hzls", model.weeklyRecurrence().time()); + Assertions.assertEquals("hoqqnwvlr", model.dailyRecurrence().time()); + Assertions.assertEquals(240696862, model.hourlyRecurrence().minute()); + Assertions.assertEquals("heun", model.timeZoneId()); Assertions.assertEquals(EnableStatus.DISABLED, model.notificationSettings().status()); - Assertions.assertEquals(692373611, model.notificationSettings().timeInMinutes()); - Assertions.assertEquals("yzxuutkncw", model.notificationSettings().webhookUrl()); - Assertions.assertEquals("wsvlxotogtwrupqs", model.notificationSettings().emailRecipient()); - Assertions.assertEquals("nmic", model.notificationSettings().notificationLocale()); - Assertions.assertEquals("eoveilovnotyf", model.targetResourceId()); + Assertions.assertEquals(1040307072, model.notificationSettings().timeInMinutes()); + Assertions.assertEquals("zko", model.notificationSettings().webhookUrl()); + Assertions.assertEquals("cukoklyaxuconu", model.notificationSettings().emailRecipient()); + Assertions.assertEquals("zf", model.notificationSettings().notificationLocale()); + Assertions.assertEquals("pewr", model.targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateWithResponseMockTests.java index ceb4976e8c5c..f2cf173051fd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; @@ -30,50 +30,50 @@ public final class SchedulesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"mhk\",\"weeklyRecurrence\":{\"weekdays\":[\"dsuxheqdgcrux\"],\"time\":\"inymmqgwokmikp\"},\"dailyRecurrence\":{\"time\":\"bmjxuvjipf\"},\"hourlyRecurrence\":{\"minute\":484105170},\"timeZoneId\":\"dvwz\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1996815086,\"webhookUrl\":\"hdklmvetatl\",\"emailRecipient\":\"fqoixwgiksbbvt\",\"notificationLocale\":\"xrpo\"},\"createdDate\":\"2021-10-23T21:24:46Z\",\"targetResourceId\":\"chgjtnhtukfacih\",\"provisioningState\":\"fntumeezbxvqx\",\"uniqueIdentifier\":\"uvwc\"},\"location\":\"asgom\",\"tags\":{\"wwztj\":\"zwxuqgovsx\",\"cgrllc\":\"mkkhtgfredml\",\"vjowazhpabac\":\"na\",\"wsxnsrqor\":\"mlyotg\"},\"id\":\"genmvceb\",\"name\":\"eetqujxcxxq\",\"type\":\"dcqjkedwqurc\"}"; + = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"mkxwxdcvjwcyziak\",\"weeklyRecurrence\":{\"weekdays\":[\"chxrtuicdsiwdfm\",\"p\",\"hzzwvywrgyngy\"],\"time\":\"rpxncaki\"},\"dailyRecurrence\":{\"time\":\"ndjrkclamggl\"},\"hourlyRecurrence\":{\"minute\":1160945137},\"timeZoneId\":\"jdoq\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":92108742,\"webhookUrl\":\"gxhqfgqkayejs\",\"emailRecipient\":\"lgflwfg\",\"notificationLocale\":\"iucijjcea\"},\"createdDate\":\"2021-04-09T05:32:43Z\",\"targetResourceId\":\"jjrtv\",\"provisioningState\":\"caszk\",\"uniqueIdentifier\":\"kvccxetyvkunmig\"},\"tags\":{\"jwpindedvabbxbh\":\"ikkgqo\"},\"location\":\"dei\",\"id\":\"jywfcfxzirzzih\",\"name\":\"wypusuvjsl\",\"type\":\"zwci\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Schedule response = manager.schedules() - .createOrUpdateWithResponse("zzwjcayerzrran", "ybylpol", "zrghsrleink", - new ScheduleInner().withLocation("pnptw") - .withTags(mapOf("jo", "xgpazwugxyqv")) - .withStatus(EnableStatus.DISABLED) - .withTaskType("fncjwvua") + .createOrUpdateWithResponse("qba", "qicqchygt", "xbyja", + new ScheduleInner().withTags(mapOf("rpdltbq", "z", "zdgvpyigdaqqilz", "tqjfgxxsaet")) + .withLocation("d") + .withStatus(EnableStatus.ENABLED) + .withTaskType("bdpkxyqvgx") .withWeeklyRecurrence( - new WeekDetails().withWeekdays(Arrays.asList("tltng", "m", "e", "ptrklzmija")).withTime("olxf")) - .withDailyRecurrence(new DayDetails().withTime("ghmp")) - .withHourlyRecurrence(new HourDetails().withMinute(710088620)) - .withTimeZoneId("lr") + new WeekDetails().withWeekdays(Arrays.asList("etvohkxdxuwsaifm")).withTime("nosbz")) + .withDailyRecurrence(new DayDetails().withTime("gcv")) + .withHourlyRecurrence(new HourDetails().withMinute(1277974913)) + .withTimeZoneId("jolgjyyxpvels") .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.DISABLED) - .withTimeInMinutes(920278919) - .withWebhookUrl("vbx") - .withEmailRecipient("a") - .withNotificationLocale("nssovyxpav")) - .withTargetResourceId("ev"), + .withTimeInMinutes(1714897962) + .withWebhookUrl("xoqeintxwalj") + .withEmailRecipient("zoblq") + .withNotificationLocale("afrqulhm")) + .withTargetResourceId("hdvafjrqpjiyrqjc"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("asgom", response.location()); - Assertions.assertEquals("zwxuqgovsx", response.tags().get("wwztj")); + Assertions.assertEquals("ikkgqo", response.tags().get("jwpindedvabbxbh")); + Assertions.assertEquals("dei", response.location()); Assertions.assertEquals(EnableStatus.DISABLED, response.status()); - Assertions.assertEquals("mhk", response.taskType()); - Assertions.assertEquals("dsuxheqdgcrux", response.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("inymmqgwokmikp", response.weeklyRecurrence().time()); - Assertions.assertEquals("bmjxuvjipf", response.dailyRecurrence().time()); - Assertions.assertEquals(484105170, response.hourlyRecurrence().minute()); - Assertions.assertEquals("dvwz", response.timeZoneId()); + Assertions.assertEquals("mkxwxdcvjwcyziak", response.taskType()); + Assertions.assertEquals("chxrtuicdsiwdfm", response.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("rpxncaki", response.weeklyRecurrence().time()); + Assertions.assertEquals("ndjrkclamggl", response.dailyRecurrence().time()); + Assertions.assertEquals(1160945137, response.hourlyRecurrence().minute()); + Assertions.assertEquals("jdoq", response.timeZoneId()); Assertions.assertEquals(EnableStatus.DISABLED, response.notificationSettings().status()); - Assertions.assertEquals(1996815086, response.notificationSettings().timeInMinutes()); - Assertions.assertEquals("hdklmvetatl", response.notificationSettings().webhookUrl()); - Assertions.assertEquals("fqoixwgiksbbvt", response.notificationSettings().emailRecipient()); - Assertions.assertEquals("xrpo", response.notificationSettings().notificationLocale()); - Assertions.assertEquals("chgjtnhtukfacih", response.targetResourceId()); + Assertions.assertEquals(92108742, response.notificationSettings().timeInMinutes()); + Assertions.assertEquals("gxhqfgqkayejs", response.notificationSettings().webhookUrl()); + Assertions.assertEquals("lgflwfg", response.notificationSettings().emailRecipient()); + Assertions.assertEquals("iucijjcea", response.notificationSettings().notificationLocale()); + Assertions.assertEquals("jjrtv", response.targetResourceId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteWithResponseMockTests.java index 314df292a650..40c16b8a2764 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDeleteWithResponse() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.schedules() - .deleteWithResponse("ojmrvvxwjongzse", "qqrsil", "chskxxka", com.azure.core.util.Context.NONE); + manager.schedules().deleteWithResponse("pezkis", "qjm", "g", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteMockTests.java index 6ac5478a34a2..d28df01e86af 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testExecute() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.schedules().execute("qepdx", "ltuubw", "vpjbowcpjqduq", com.azure.core.util.Context.NONE); + manager.schedules().execute("mgnlqxsjxtel", "xhvuqbozool", "qocarkuzlbc", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetWithResponseMockTests.java index 673214dc2d82..a48aa818a09b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -22,33 +22,33 @@ public final class SchedulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"ey\",\"weeklyRecurrence\":{\"weekdays\":[\"fop\",\"z\",\"azgbsqgpe\"],\"time\":\"c\"},\"dailyRecurrence\":{\"time\":\"mdpv\"},\"hourlyRecurrence\":{\"minute\":337381733},\"timeZoneId\":\"jbkn\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1208504733,\"webhookUrl\":\"eyowmndcovd\",\"emailRecipient\":\"qauxzan\",\"notificationLocale\":\"kvfruwkudr\"},\"createdDate\":\"2021-06-03T17:46:18Z\",\"targetResourceId\":\"txudqyeme\",\"provisioningState\":\"naucmcirtnee\",\"uniqueIdentifier\":\"jauwcgxefnohaitr\"},\"location\":\"nizerwg\",\"tags\":{\"ngfcocefhpriyl\":\"smxubvf\",\"culregpqt\":\"mpztraudsvhlc\",\"nvgyshqrdgrtwme\":\"ojhvrz\"},\"id\":\"jz\",\"name\":\"py\",\"type\":\"cf\"}"; + = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"xhmtfhocnxzc\",\"weeklyRecurrence\":{\"weekdays\":[\"gxnoqrxtdis\",\"jevhdlmydidw\"],\"time\":\"pfwwt\"},\"dailyRecurrence\":{\"time\":\"o\"},\"hourlyRecurrence\":{\"minute\":946942042},\"timeZoneId\":\"mwcdbcky\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":588101197,\"webhookUrl\":\"negknjzrb\",\"emailRecipient\":\"me\",\"notificationLocale\":\"vukaobrlbpgsnb\"},\"createdDate\":\"2021-03-10T05:08:56Z\",\"targetResourceId\":\"hjhgem\",\"provisioningState\":\"wakywalhjymxcgq\",\"uniqueIdentifier\":\"gdrclssolj\"},\"tags\":{\"gjiiytssiki\":\"vtfycnlbvgjcodk\"},\"location\":\"cufqbvntnrgmqs\",\"id\":\"hcekxgnlykm\",\"name\":\"cpwzv\",\"type\":\"doksqdtiwlwxlbon\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Schedule response = manager.schedules() - .getWithResponse("kurrdreyzjwh", "etw", "jwzzqseuzu", "kykcyqhyqqzz", com.azure.core.util.Context.NONE) + .getWithResponse("utrpbr", "uyu", "atvlmbjwcolbm", "lbnwtpcpahp", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("nizerwg", response.location()); - Assertions.assertEquals("smxubvf", response.tags().get("ngfcocefhpriyl")); - Assertions.assertEquals(EnableStatus.ENABLED, response.status()); - Assertions.assertEquals("ey", response.taskType()); - Assertions.assertEquals("fop", response.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("c", response.weeklyRecurrence().time()); - Assertions.assertEquals("mdpv", response.dailyRecurrence().time()); - Assertions.assertEquals(337381733, response.hourlyRecurrence().minute()); - Assertions.assertEquals("jbkn", response.timeZoneId()); + Assertions.assertEquals("vtfycnlbvgjcodk", response.tags().get("gjiiytssiki")); + Assertions.assertEquals("cufqbvntnrgmqs", response.location()); + Assertions.assertEquals(EnableStatus.DISABLED, response.status()); + Assertions.assertEquals("xhmtfhocnxzc", response.taskType()); + Assertions.assertEquals("gxnoqrxtdis", response.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("pfwwt", response.weeklyRecurrence().time()); + Assertions.assertEquals("o", response.dailyRecurrence().time()); + Assertions.assertEquals(946942042, response.hourlyRecurrence().minute()); + Assertions.assertEquals("mwcdbcky", response.timeZoneId()); Assertions.assertEquals(EnableStatus.DISABLED, response.notificationSettings().status()); - Assertions.assertEquals(1208504733, response.notificationSettings().timeInMinutes()); - Assertions.assertEquals("eyowmndcovd", response.notificationSettings().webhookUrl()); - Assertions.assertEquals("qauxzan", response.notificationSettings().emailRecipient()); - Assertions.assertEquals("kvfruwkudr", response.notificationSettings().notificationLocale()); - Assertions.assertEquals("txudqyeme", response.targetResourceId()); + Assertions.assertEquals(588101197, response.notificationSettings().timeInMinutes()); + Assertions.assertEquals("negknjzrb", response.notificationSettings().webhookUrl()); + Assertions.assertEquals("me", response.notificationSettings().emailRecipient()); + Assertions.assertEquals("vukaobrlbpgsnb", response.notificationSettings().notificationLocale()); + Assertions.assertEquals("hjhgem", response.targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableMockTests.java index b2d1aa08af35..1a5a8e525f36 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -23,32 +23,33 @@ public final class SchedulesListApplicableMockTests { @Test public void testListApplicable() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"ftcvbii\",\"weeklyRecurrence\":{\"weekdays\":[\"dwgdn\",\"efgmwdhcebuv\",\"zldbglzoutbaaqg\",\"ekaj\"],\"time\":\"yzgsnorbjgmnz\"},\"dailyRecurrence\":{\"time\":\"vmrxkhlobvvjbh\"},\"hourlyRecurrence\":{\"minute\":1801825955},\"timeZoneId\":\"ayfluiyuosnu\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":793027662,\"webhookUrl\":\"yibdrqrswhbuu\",\"emailRecipient\":\"y\",\"notificationLocale\":\"wtjoxz\"},\"createdDate\":\"2021-07-15T14:18:57Z\",\"targetResourceId\":\"qchvczevjn\",\"provisioningState\":\"tagfyvrtpqp\",\"uniqueIdentifier\":\"hzcgkrepdqhqyhwq\"},\"location\":\"e\",\"tags\":{\"greohtwhlpuzjp\":\"qabckmzeoxin\",\"angp\":\"eezn\",\"phmsexroq\":\"bfaxyxzlbc\"},\"id\":\"ndktxfv\",\"name\":\"nfee\",\"type\":\"gpkrie\"}]}"; + = "{\"value\":[{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"ckywymxga\",\"weeklyRecurrence\":{\"weekdays\":[\"dtfohfaog\",\"vkiwrsiwdyjqu\",\"ykcrraue\"],\"time\":\"csuehogddac\"},\"dailyRecurrence\":{\"time\":\"gydlqidywm\"},\"hourlyRecurrence\":{\"minute\":1748207974},\"timeZoneId\":\"ril\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":240028422,\"webhookUrl\":\"xvztpbnfnqtxj\",\"emailRecipient\":\"m\",\"notificationLocale\":\"swbnfddepldwqjns\"},\"createdDate\":\"2021-09-29T00:00:27Z\",\"targetResourceId\":\"leexahvmywh\",\"provisioningState\":\"rcarycsjj\",\"uniqueIdentifier\":\"voaqajuvehzptdmk\"},\"tags\":{\"be\":\"hmpful\",\"ununm\":\"gybpmfb\",\"kdschlzvfictnkjj\":\"zkrvfyi\",\"hbkgfyrt\":\"gcwn\"},\"location\":\"mhmjpjs\",\"id\":\"fp\",\"name\":\"qwtygevgwmseharx\",\"type\":\"fv\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.schedules().listApplicable("ixexkydfbwljavhu", "rkjd", "vrg", com.azure.core.util.Context.NONE); + = manager.schedules().listApplicable("ndtsnxawqytll", "dyz", "yckzex", com.azure.core.util.Context.NONE); - Assertions.assertEquals("e", response.iterator().next().location()); - Assertions.assertEquals("qabckmzeoxin", response.iterator().next().tags().get("greohtwhlpuzjp")); + Assertions.assertEquals("hmpful", response.iterator().next().tags().get("be")); + Assertions.assertEquals("mhmjpjs", response.iterator().next().location()); Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().status()); - Assertions.assertEquals("ftcvbii", response.iterator().next().taskType()); - Assertions.assertEquals("dwgdn", response.iterator().next().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("yzgsnorbjgmnz", response.iterator().next().weeklyRecurrence().time()); - Assertions.assertEquals("vmrxkhlobvvjbh", response.iterator().next().dailyRecurrence().time()); - Assertions.assertEquals(1801825955, response.iterator().next().hourlyRecurrence().minute()); - Assertions.assertEquals("ayfluiyuosnu", response.iterator().next().timeZoneId()); - Assertions.assertEquals(EnableStatus.DISABLED, response.iterator().next().notificationSettings().status()); - Assertions.assertEquals(793027662, response.iterator().next().notificationSettings().timeInMinutes()); - Assertions.assertEquals("yibdrqrswhbuu", response.iterator().next().notificationSettings().webhookUrl()); - Assertions.assertEquals("y", response.iterator().next().notificationSettings().emailRecipient()); - Assertions.assertEquals("wtjoxz", response.iterator().next().notificationSettings().notificationLocale()); - Assertions.assertEquals("qchvczevjn", response.iterator().next().targetResourceId()); + Assertions.assertEquals("ckywymxga", response.iterator().next().taskType()); + Assertions.assertEquals("dtfohfaog", response.iterator().next().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("csuehogddac", response.iterator().next().weeklyRecurrence().time()); + Assertions.assertEquals("gydlqidywm", response.iterator().next().dailyRecurrence().time()); + Assertions.assertEquals(1748207974, response.iterator().next().hourlyRecurrence().minute()); + Assertions.assertEquals("ril", response.iterator().next().timeZoneId()); + Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().notificationSettings().status()); + Assertions.assertEquals(240028422, response.iterator().next().notificationSettings().timeInMinutes()); + Assertions.assertEquals("xvztpbnfnqtxj", response.iterator().next().notificationSettings().webhookUrl()); + Assertions.assertEquals("m", response.iterator().next().notificationSettings().emailRecipient()); + Assertions.assertEquals("swbnfddepldwqjns", + response.iterator().next().notificationSettings().notificationLocale()); + Assertions.assertEquals("leexahvmywh", response.iterator().next().targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListMockTests.java index df00dadf5caa..25ccdf3a0af5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -23,33 +23,34 @@ public final class SchedulesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"zzdzzqjmuezayov\",\"weeklyRecurrence\":{\"weekdays\":[\"lotokh\",\"vwta\"],\"time\":\"kcqwwxwjyofgwh\"},\"dailyRecurrence\":{\"time\":\"tlwljssmcts\"},\"hourlyRecurrence\":{\"minute\":1476698814},\"timeZoneId\":\"wolgisubxbt\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":2067090364,\"webhookUrl\":\"ij\",\"emailRecipient\":\"kw\",\"notificationLocale\":\"fksxqce\"},\"createdDate\":\"2021-10-21T17:51:03Z\",\"targetResourceId\":\"xgnmqvzvluyq\",\"provisioningState\":\"ios\",\"uniqueIdentifier\":\"cyvaifppuacvfy\"},\"location\":\"owpsfxt\",\"tags\":{\"hpvtyqftteh\":\"soy\",\"kfvvdshxcde\":\"pboujs\",\"xcgjtf\":\"suenyg\"},\"id\":\"nquktrfnslnlrxs\",\"name\":\"ylt\",\"type\":\"wntfmtbgwjdxwna\"}]}"; + = "{\"value\":[{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"khgsnxuwwkpphefs\",\"weeklyRecurrence\":{\"weekdays\":[\"bzxomeik\",\"clwzacnmwpfsu\",\"t\"],\"time\":\"zyqbxyxoyfpuq\"},\"dailyRecurrence\":{\"time\":\"ezxlhdjzqdca\"},\"hourlyRecurrence\":{\"minute\":146751507},\"timeZoneId\":\"ozjiihj\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":488504405,\"webhookUrl\":\"oepnxwdv\",\"emailRecipient\":\"jkgv\",\"notificationLocale\":\"mxaursqftibtyi\"},\"createdDate\":\"2021-03-13T10:09:20Z\",\"targetResourceId\":\"pir\",\"provisioningState\":\"jpnqnoowsbeden\",\"uniqueIdentifier\":\"xkxbhxvu\"},\"tags\":{\"ajsvk\":\"lgmnhjevdyzn\"},\"location\":\"mqozzkivy\",\"id\":\"rl\",\"name\":\"izjixlq\",\"type\":\"hefkwabsolronqq\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.schedules() - .list("sgzlrqhb", "nq", "gdxwbsfpyxx", "jlf", 1758860426, "cominxojjluxx", + .list("syparybjufp", "bjczjnciuiyqvlda", "wvppi", "qqzlgcndhz", 420360922, "rfc", com.azure.core.util.Context.NONE); - Assertions.assertEquals("owpsfxt", response.iterator().next().location()); - Assertions.assertEquals("soy", response.iterator().next().tags().get("hpvtyqftteh")); + Assertions.assertEquals("lgmnhjevdyzn", response.iterator().next().tags().get("ajsvk")); + Assertions.assertEquals("mqozzkivy", response.iterator().next().location()); Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().status()); - Assertions.assertEquals("zzdzzqjmuezayov", response.iterator().next().taskType()); - Assertions.assertEquals("lotokh", response.iterator().next().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("kcqwwxwjyofgwh", response.iterator().next().weeklyRecurrence().time()); - Assertions.assertEquals("tlwljssmcts", response.iterator().next().dailyRecurrence().time()); - Assertions.assertEquals(1476698814, response.iterator().next().hourlyRecurrence().minute()); - Assertions.assertEquals("wolgisubxbt", response.iterator().next().timeZoneId()); - Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().notificationSettings().status()); - Assertions.assertEquals(2067090364, response.iterator().next().notificationSettings().timeInMinutes()); - Assertions.assertEquals("ij", response.iterator().next().notificationSettings().webhookUrl()); - Assertions.assertEquals("kw", response.iterator().next().notificationSettings().emailRecipient()); - Assertions.assertEquals("fksxqce", response.iterator().next().notificationSettings().notificationLocale()); - Assertions.assertEquals("xgnmqvzvluyq", response.iterator().next().targetResourceId()); + Assertions.assertEquals("khgsnxuwwkpphefs", response.iterator().next().taskType()); + Assertions.assertEquals("bzxomeik", response.iterator().next().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("zyqbxyxoyfpuq", response.iterator().next().weeklyRecurrence().time()); + Assertions.assertEquals("ezxlhdjzqdca", response.iterator().next().dailyRecurrence().time()); + Assertions.assertEquals(146751507, response.iterator().next().hourlyRecurrence().minute()); + Assertions.assertEquals("ozjiihj", response.iterator().next().timeZoneId()); + Assertions.assertEquals(EnableStatus.DISABLED, response.iterator().next().notificationSettings().status()); + Assertions.assertEquals(488504405, response.iterator().next().notificationSettings().timeInMinutes()); + Assertions.assertEquals("oepnxwdv", response.iterator().next().notificationSettings().webhookUrl()); + Assertions.assertEquals("jkgv", response.iterator().next().notificationSettings().emailRecipient()); + Assertions.assertEquals("mxaursqftibtyi", + response.iterator().next().notificationSettings().notificationLocale()); + Assertions.assertEquals("pir", response.iterator().next().targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateWithResponseMockTests.java index 48bda542f815..5db1a74c52ef 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -25,36 +25,36 @@ public final class SchedulesUpdateWithResponseMockTests { @Test public void testUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"rdhabsr\",\"weeklyRecurrence\":{\"weekdays\":[\"rhpqatiwkkvya\",\"xkvvcs\",\"msvuvdjkqxetq\"],\"time\":\"livrjjxnwx\"},\"dailyRecurrence\":{\"time\":\"p\"},\"hourlyRecurrence\":{\"minute\":502816571},\"timeZoneId\":\"hzlxpgfquw\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1697047368,\"webhookUrl\":\"lwcerwkwb\",\"emailRecipient\":\"xljtxbusqtbxxn\",\"notificationLocale\":\"i\"},\"createdDate\":\"2021-10-10T00:35:57Z\",\"targetResourceId\":\"gbdgzp\",\"provisioningState\":\"secnadbuwqrgxf\",\"uniqueIdentifier\":\"mqiyn\"},\"location\":\"zoellnkkiiwvmtum\",\"tags\":{\"rguncanldu\":\"mdjfuaxroqvqpi\",\"x\":\"zorxsb\"},\"id\":\"qk\",\"name\":\"xym\",\"type\":\"kqv\"}"; + = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"simjceagbjqvlsu\",\"weeklyRecurrence\":{\"weekdays\":[\"ashxgonoyjfqi\"],\"time\":\"b\"},\"dailyRecurrence\":{\"time\":\"clkfkee\"},\"hourlyRecurrence\":{\"minute\":1507605571},\"timeZoneId\":\"e\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1767063825,\"webhookUrl\":\"l\",\"emailRecipient\":\"gqa\",\"notificationLocale\":\"igflqqbtnyjp\"},\"createdDate\":\"2021-01-17T06:36:15Z\",\"targetResourceId\":\"bf\",\"provisioningState\":\"bmvmsxba\",\"uniqueIdentifier\":\"wjcnkottl\"},\"tags\":{\"jzakzwjiqull\":\"vajmailfem\",\"rnyeofltfnnxrk\":\"xbdmvrscmqernd\",\"ynnfmuiii\":\"dj\",\"bcbrwjiutgnjizbe\":\"ipfohykfkx\"},\"location\":\"oiymrvzbjuyrsrzi\",\"id\":\"tixgbd\",\"name\":\"uifr\",\"type\":\"vka\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Schedule response = manager.schedules() - .updateWithResponse("sbvr", "aqgvto", "rulfuct", - new ScheduleFragment().withTags(mapOf("hxlyubqjrostvrje", "thcfj", "ztr", "mtzzbeq")), + .updateWithResponse("djsllfr", "vdmvxadqa", "frgnawbabgfbktyj", + new ScheduleFragment().withTags(mapOf("qmje", "zlfsyqkfrbzgowo", "yqgxhlus", "jcx")), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("zoellnkkiiwvmtum", response.location()); - Assertions.assertEquals("mdjfuaxroqvqpi", response.tags().get("rguncanldu")); + Assertions.assertEquals("vajmailfem", response.tags().get("jzakzwjiqull")); + Assertions.assertEquals("oiymrvzbjuyrsrzi", response.location()); Assertions.assertEquals(EnableStatus.DISABLED, response.status()); - Assertions.assertEquals("rdhabsr", response.taskType()); - Assertions.assertEquals("rhpqatiwkkvya", response.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("livrjjxnwx", response.weeklyRecurrence().time()); - Assertions.assertEquals("p", response.dailyRecurrence().time()); - Assertions.assertEquals(502816571, response.hourlyRecurrence().minute()); - Assertions.assertEquals("hzlxpgfquw", response.timeZoneId()); + Assertions.assertEquals("simjceagbjqvlsu", response.taskType()); + Assertions.assertEquals("ashxgonoyjfqi", response.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("b", response.weeklyRecurrence().time()); + Assertions.assertEquals("clkfkee", response.dailyRecurrence().time()); + Assertions.assertEquals(1507605571, response.hourlyRecurrence().minute()); + Assertions.assertEquals("e", response.timeZoneId()); Assertions.assertEquals(EnableStatus.DISABLED, response.notificationSettings().status()); - Assertions.assertEquals(1697047368, response.notificationSettings().timeInMinutes()); - Assertions.assertEquals("lwcerwkwb", response.notificationSettings().webhookUrl()); - Assertions.assertEquals("xljtxbusqtbxxn", response.notificationSettings().emailRecipient()); - Assertions.assertEquals("i", response.notificationSettings().notificationLocale()); - Assertions.assertEquals("gbdgzp", response.targetResourceId()); + Assertions.assertEquals(1767063825, response.notificationSettings().timeInMinutes()); + Assertions.assertEquals("l", response.notificationSettings().webhookUrl()); + Assertions.assertEquals("gqa", response.notificationSettings().emailRecipient()); + Assertions.assertEquals("igflqqbtnyjp", response.notificationSettings().notificationLocale()); + Assertions.assertEquals("bf", response.targetResourceId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretFragmentTests.java index bd540161d486..09a388428304 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,15 +14,15 @@ public final class SecretFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecretFragment model - = BinaryData.fromString("{\"tags\":{\"qgqqihedsvqwthmk\":\"tpvopvpbdb\"}}").toObject(SecretFragment.class); - Assertions.assertEquals("tpvopvpbdb", model.tags().get("qgqqihedsvqwthmk")); + = BinaryData.fromString("{\"tags\":{\"lhslnelxieixyn\":\"xrizkzobgop\"}}").toObject(SecretFragment.class); + Assertions.assertEquals("xrizkzobgop", model.tags().get("lhslnelxieixyn")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SecretFragment model = new SecretFragment().withTags(mapOf("qgqqihedsvqwthmk", "tpvopvpbdb")); + SecretFragment model = new SecretFragment().withTags(mapOf("lhslnelxieixyn", "xrizkzobgop")); model = BinaryData.fromObject(model).toObject(SecretFragment.class); - Assertions.assertEquals("tpvopvpbdb", model.tags().get("qgqqihedsvqwthmk")); + Assertions.assertEquals("xrizkzobgop", model.tags().get("lhslnelxieixyn")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretInnerTests.java index 17d8dddd7ce4..9d9a7340af7d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,22 +14,23 @@ public final class SecretInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecretInner model = BinaryData.fromString( - "{\"properties\":{\"value\":\"oqltfae\",\"provisioningState\":\"inmfgvxirp\",\"uniqueIdentifier\":\"riypoqeyhlqhyk\"},\"location\":\"rlpyznuciqdsmexi\",\"tags\":{\"stgnl\":\"fuxtyasiibmiybnn\",\"vmqfoud\":\"hnmgixhcm\"},\"id\":\"rhc\",\"name\":\"yyprotwyp\",\"type\":\"ndm\"}") + "{\"properties\":{\"value\":\"yaipidsda\",\"provisioningState\":\"tx\",\"uniqueIdentifier\":\"jumfqwazlnq\"},\"tags\":{\"qdqx\":\"jng\",\"zsvtuikzhajqgl\":\"bjwgnyfus\",\"l\":\"fh\",\"nzrdpsovwxz\":\"qryxyn\"},\"location\":\"tgoe\",\"id\":\"bbabp\",\"name\":\"hv\",\"type\":\"slkvntjl\"}") .toObject(SecretInner.class); - Assertions.assertEquals("rlpyznuciqdsmexi", model.location()); - Assertions.assertEquals("fuxtyasiibmiybnn", model.tags().get("stgnl")); - Assertions.assertEquals("oqltfae", model.value()); + Assertions.assertEquals("jng", model.tags().get("qdqx")); + Assertions.assertEquals("tgoe", model.location()); + Assertions.assertEquals("yaipidsda", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SecretInner model = new SecretInner().withLocation("rlpyznuciqdsmexi") - .withTags(mapOf("stgnl", "fuxtyasiibmiybnn", "vmqfoud", "hnmgixhcm")) - .withValue("oqltfae"); + SecretInner model = new SecretInner() + .withTags(mapOf("qdqx", "jng", "zsvtuikzhajqgl", "bjwgnyfus", "l", "fh", "nzrdpsovwxz", "qryxyn")) + .withLocation("tgoe") + .withValue("yaipidsda"); model = BinaryData.fromObject(model).toObject(SecretInner.class); - Assertions.assertEquals("rlpyznuciqdsmexi", model.location()); - Assertions.assertEquals("fuxtyasiibmiybnn", model.tags().get("stgnl")); - Assertions.assertEquals("oqltfae", model.value()); + Assertions.assertEquals("jng", model.tags().get("qdqx")); + Assertions.assertEquals("tgoe", model.location()); + Assertions.assertEquals("yaipidsda", model.value()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretListTests.java index f8cf1ac4f09b..9b11d08c11d5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretListTests.java @@ -1,50 +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.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.SecretInner; -import com.azure.resourcemanager.devtestlabs.models.SecretList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.devtestlabs.implementation.models.SecretList; import org.junit.jupiter.api.Assertions; public final class SecretListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecretList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"value\":\"tfnmdx\",\"provisioningState\":\"ngfdgugeyzihgrky\",\"uniqueIdentifier\":\"zabs\"},\"location\":\"mfp\",\"tags\":{\"yhyhsgzfczb\":\"jee\",\"tnluankrr\":\"omfgbeglqgleohib\"},\"id\":\"xeeebtijvacvbmqz\",\"name\":\"qqxlajr\",\"type\":\"wxacevehj\"}],\"nextLink\":\"yxoaf\"}") + "{\"value\":[{\"properties\":{\"value\":\"ecwcrojphslhcawj\",\"provisioningState\":\"i\",\"uniqueIdentifier\":\"wfmvigorqjbt\"},\"tags\":{\"fhonqjujeickpzvc\":\"raglk\"},\"location\":\"pmxelnwcltyje\",\"id\":\"xxmlfmkqscazua\",\"name\":\"xtzx\",\"type\":\"uamwabzxrvxc\"},{\"properties\":{\"value\":\"hsphaivmxyas\",\"provisioningState\":\"vgsgzwywakoihkn\",\"uniqueIdentifier\":\"jblmljhlnymz\"},\"tags\":{\"qqvxmvwfgtayxons\":\"yryuzcb\",\"cvsql\":\"peujlzqn\",\"yqo\":\"nzoibgsxgnx\",\"o\":\"mpqoxw\"},\"location\":\"bxiqxeiiqbimht\",\"id\":\"winhehfqpo\",\"name\":\"vwbcblembnkbwv\",\"type\":\"vxkdivqihebwtswb\"},{\"properties\":{\"value\":\"wfmdurage\",\"provisioningState\":\"zvcjfelisdjubggb\",\"uniqueIdentifier\":\"gkxkbsazgakg\"},\"tags\":{\"ylnio\":\"rcmjdmspofapvuh\",\"bzjedmstk\":\"rz\",\"nktwfansnvpdibmi\":\"nlvxbcuii\",\"qnyophzfyls\":\"ostbzbkiwb\"},\"location\":\"rpfbcunezz\",\"id\":\"zelfwyfwl\",\"name\":\"xjwet\",\"type\":\"psihcla\"},{\"properties\":{\"value\":\"va\",\"provisioningState\":\"pt\",\"uniqueIdentifier\":\"qqwzt\"},\"tags\":{\"cxwaxfewz\":\"qkc\"},\"location\":\"jexfdeqvhp\",\"id\":\"lkkshkbffmbmx\",\"name\":\"jrgywwpgjxsn\",\"type\":\"tf\"}],\"nextLink\":\"gicgaaoepttaq\"}") .toObject(SecretList.class); - Assertions.assertEquals("mfp", model.value().get(0).location()); - Assertions.assertEquals("jee", model.value().get(0).tags().get("yhyhsgzfczb")); - Assertions.assertEquals("tfnmdx", model.value().get(0).value()); - Assertions.assertEquals("yxoaf", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecretList model = new SecretList().withValue(Arrays.asList(new SecretInner().withLocation("mfp") - .withTags(mapOf("yhyhsgzfczb", "jee", "tnluankrr", "omfgbeglqgleohib")) - .withValue("tfnmdx"))).withNextLink("yxoaf"); - model = BinaryData.fromObject(model).toObject(SecretList.class); - Assertions.assertEquals("mfp", model.value().get(0).location()); - Assertions.assertEquals("jee", model.value().get(0).tags().get("yhyhsgzfczb")); - Assertions.assertEquals("tfnmdx", model.value().get(0).value()); - Assertions.assertEquals("yxoaf", 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; + Assertions.assertEquals("raglk", model.value().get(0).tags().get("fhonqjujeickpzvc")); + Assertions.assertEquals("pmxelnwcltyje", model.value().get(0).location()); + Assertions.assertEquals("ecwcrojphslhcawj", model.value().get(0).value()); + Assertions.assertEquals("gicgaaoepttaq", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretPropertiesTests.java index 80af27a52b98..749f2a171bfd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,15 +13,15 @@ public final class SecretPropertiesTests { public void testDeserialize() throws Exception { SecretProperties model = BinaryData .fromString( - "{\"value\":\"hu\",\"provisioningState\":\"mjkavlgorbmft\",\"uniqueIdentifier\":\"dtzfjltfvnzcy\"}") + "{\"value\":\"gjkskyrioov\",\"provisioningState\":\"dsxwaab\",\"uniqueIdentifier\":\"ifrygzn\"}") .toObject(SecretProperties.class); - Assertions.assertEquals("hu", model.value()); + Assertions.assertEquals("gjkskyrioov", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SecretProperties model = new SecretProperties().withValue("hu"); + SecretProperties model = new SecretProperties().withValue("gjkskyrioov"); model = BinaryData.fromObject(model).toObject(SecretProperties.class); - Assertions.assertEquals("hu", model.value()); + Assertions.assertEquals("gjkskyrioov", model.value()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateMockTests.java index ee1fdf399480..b20de8728fbc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Secret; @@ -23,26 +23,27 @@ public final class SecretsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"value\":\"snvlaqd\",\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"kokb\"},\"location\":\"zothym\",\"tags\":{\"msn\":\"l\",\"aaneakhtmhobcya\":\"gwi\",\"gxkfnaoaqymhccto\":\"rfvqtvkhgvo\",\"czygxv\":\"uowyrnskbyhqu\"},\"id\":\"ajpxecxqnwhscoza\",\"name\":\"mvgxsmpknpwir\",\"type\":\"ljfewxqo\"}"; + = "{\"properties\":{\"value\":\"jtsmuydqf\",\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"hlo\"},\"tags\":{\"bfdjhyaaknyukibx\":\"mhzic\",\"tej\":\"glhphzwx\",\"nxkbylhyyxgf\":\"iilhvtozyagj\"},\"location\":\"lvqzrwtrdgscnv\",\"id\":\"on\",\"name\":\"gnwxl\",\"type\":\"mezyo\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Secret response = manager.secrets() - .define("kczynuhhoqeqsh") - .withRegion("jmlfuyfjbp") - .withExistingUser("fjzc", "aaxoialahfxwcc", "kdxkuk") - .withTags(mapOf("fuiocuselq", "dhlrufzcqyjmq", "qmdtffi", "rsazrhxud", "khmwdmd", "jmr")) - .withValue("ljqkxyrqolnthbb") + .define("xvsc") + .withExistingUser("rigrjdljlkq", "vkrbzkuastaxklpr", "ulhgltoiz") + .withRegion("jvlirk") + .withTags(mapOf("hpdhwynctaczcnjf", "zrt", "iklsmni", "bbfnvjxitzovnkr", "bgbudav", "qlcoqksyiibhyx", + "rbccqcdht", "d")) + .withValue("gfyys") .create(); - Assertions.assertEquals("zothym", response.location()); - Assertions.assertEquals("l", response.tags().get("msn")); - Assertions.assertEquals("snvlaqd", response.value()); + Assertions.assertEquals("mhzic", response.tags().get("bfdjhyaaknyukibx")); + Assertions.assertEquals("lvqzrwtrdgscnv", response.location()); + Assertions.assertEquals("jtsmuydqf", response.value()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteWithResponseMockTests.java index 1beea1c8ad4c..5e60f975dbfd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.secrets() - .deleteWithResponse("xjqifhujjsbc", "lzaahzbhuroolk", "lirh", "mojusuz", com.azure.core.util.Context.NONE); + .deleteWithResponse("htncwmhjobzrfp", "iz", "cqhyftcvbz", "gwhgkgsoau", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetWithResponseMockTests.java index 623345be7843..d78c3dad9397 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Secret; @@ -21,21 +21,21 @@ public final class SecretsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"value\":\"jnosdkv\",\"provisioningState\":\"fasgm\",\"uniqueIdentifier\":\"rnzpducdaak\"},\"location\":\"ujktzb\",\"tags\":{\"wkppnwyytfvp\":\"yfpqd\"},\"id\":\"tfjikffffgkuh\",\"name\":\"nwhvuldbkkejj\",\"type\":\"jigawgaz\"}"; + = "{\"properties\":{\"value\":\"yrguyfazbk\",\"provisioningState\":\"bygvthrmx\",\"uniqueIdentifier\":\"cjwwdx\"},\"tags\":{\"pkeboozflyac\":\"aw\",\"lm\":\"gaedaoiq\",\"cooyvhtuqb\":\"dtwgabdxfkuzbwj\"},\"location\":\"lniibncg\",\"id\":\"dvcdq\",\"name\":\"ftzb\",\"type\":\"yfaofdf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Secret response = manager.secrets() - .getWithResponse("lvgecpwgoljtz", "nm", "sdobygoogxq", "pjxvazyjf", "csa", com.azure.core.util.Context.NONE) + .getWithResponse("owkdnjr", "gkr", "wiehycpn", "wawonoehrguql", "fwafbjz", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ujktzb", response.location()); - Assertions.assertEquals("yfpqd", response.tags().get("wkppnwyytfvp")); - Assertions.assertEquals("jnosdkv", response.value()); + Assertions.assertEquals("aw", response.tags().get("pkeboozflyac")); + Assertions.assertEquals("lniibncg", response.location()); + Assertions.assertEquals("yrguyfazbk", response.value()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListMockTests.java index ffb01813758f..8f767d9e24e7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Secret; @@ -22,21 +22,21 @@ public final class SecretsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"value\":\"bdjnxume\",\"provisioningState\":\"qontwhymxymulw\",\"uniqueIdentifier\":\"qtow\"},\"location\":\"h\",\"tags\":{\"squbfajcywh\":\"coybaj\",\"up\":\"qwmchqohtfxc\",\"vwtiwsmosa\":\"kiymjzpwd\",\"ltassaekewna\":\"nhqnampp\"},\"id\":\"eajbkajlcyizyddc\",\"name\":\"xo\",\"type\":\"krvfsxxbydes\"}]}"; + = "{\"value\":[{\"properties\":{\"value\":\"dqknh\",\"provisioningState\":\"motpuwnnoh\",\"uniqueIdentifier\":\"zngocfrjuypwyiul\"},\"tags\":{\"ttpfsmwgsgh\":\"osugkfha\"},\"location\":\"cum\",\"id\":\"dau\",\"name\":\"ml\",\"type\":\"feothxu\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.secrets() - .list("eypdvrbk", "rdkdkgaw", "wjxildfkcefeyg", "q", "jo", 1682420680, "fmn", + .list("orssatfyb", "pufdmxuqbdqn", "sttuxv", "fqayopbtsix", "gvbhxmndztgs", 635232448, "ayqmarxneibpgbrh", com.azure.core.util.Context.NONE); - Assertions.assertEquals("h", response.iterator().next().location()); - Assertions.assertEquals("coybaj", response.iterator().next().tags().get("squbfajcywh")); - Assertions.assertEquals("bdjnxume", response.iterator().next().value()); + Assertions.assertEquals("osugkfha", response.iterator().next().tags().get("ttpfsmwgsgh")); + Assertions.assertEquals("cum", response.iterator().next().location()); + Assertions.assertEquals("dqknh", response.iterator().next().value()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricFragmentTests.java index b31675c0cd6a..57d0a0dc94c2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,16 +13,16 @@ public final class ServiceFabricFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ServiceFabricFragment model = BinaryData.fromString("{\"tags\":{\"usxjbaqehg\":\"uewmrswnjlxuzrhw\"}}") + ServiceFabricFragment model = BinaryData.fromString("{\"tags\":{\"udbchaqdtv\":\"unin\",\"qct\":\"ec\"}}") .toObject(ServiceFabricFragment.class); - Assertions.assertEquals("uewmrswnjlxuzrhw", model.tags().get("usxjbaqehg")); + Assertions.assertEquals("unin", model.tags().get("udbchaqdtv")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceFabricFragment model = new ServiceFabricFragment().withTags(mapOf("usxjbaqehg", "uewmrswnjlxuzrhw")); + ServiceFabricFragment model = new ServiceFabricFragment().withTags(mapOf("udbchaqdtv", "unin", "qct", "ec")); model = BinaryData.fromObject(model).toObject(ServiceFabricFragment.class); - Assertions.assertEquals("uewmrswnjlxuzrhw", model.tags().get("usxjbaqehg")); + Assertions.assertEquals("unin", model.tags().get("udbchaqdtv")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricInnerTests.java index aa9cd0be4bf6..407ab855fcd0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,25 +14,26 @@ public final class ServiceFabricInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceFabricInner model = BinaryData.fromString( - "{\"properties\":{\"externalServiceFabricId\":\"xieixynllxec\",\"environmentId\":\"rojphslhcawjutif\",\"applicableSchedule\":{\"properties\":{\"labVmsShutdown\":{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"gorqjbttzh\",\"weeklyRecurrence\":{},\"dailyRecurrence\":{},\"hourlyRecurrence\":{},\"timeZoneId\":\"afhonqj\",\"notificationSettings\":{},\"createdDate\":\"2021-09-12T07:04:40Z\",\"targetResourceId\":\"kpzvcpopmxelnwc\",\"provisioningState\":\"yjede\",\"uniqueIdentifier\":\"mlfmkqs\"},\"location\":\"azuawx\",\"tags\":{\"xcushs\":\"puamwabzxr\"},\"id\":\"haivm\",\"name\":\"yasflvgsgzwy\",\"type\":\"akoi\"},\"labVmsStartup\":{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"jblmljhlnymz\",\"weeklyRecurrence\":{},\"dailyRecurrence\":{},\"hourlyRecurrence\":{},\"timeZoneId\":\"yuzcbmqqvxmvw\",\"notificationSettings\":{},\"createdDate\":\"2021-09-15T05:34:37Z\",\"targetResourceId\":\"xo\",\"provisioningState\":\"upeujlzqnhcvsq\",\"uniqueIdentifier\":\"nzoibgsxgnx\"},\"location\":\"yqo\",\"tags\":{\"fdbxiqxeiiqbim\":\"qoxwd\"},\"id\":\"tmwwi\",\"name\":\"h\",\"type\":\"hfqpofv\"}},\"location\":\"bcblemb\",\"tags\":{\"xk\":\"wvq\",\"tswbzuwfmd\":\"ivqiheb\",\"vcjfelisdjubggb\":\"ragegi\"},\"id\":\"igkxkbsazga\",\"name\":\"gacyrcmjdmspo\",\"type\":\"apvu\"},\"provisioningState\":\"ylnio\",\"uniqueIdentifier\":\"zgb\"},\"location\":\"jed\",\"tags\":{\"f\":\"kvnlvxbcuiiznkt\",\"bmikost\":\"nsnvpd\",\"kiwbuqnyoph\":\"z\",\"sgcrpfbcunezzce\":\"fy\"},\"id\":\"elfwy\",\"name\":\"wl\",\"type\":\"xjwet\"}") + "{\"properties\":{\"externalServiceFabricId\":\"dewemxswv\",\"environmentId\":\"unzzjgehk\",\"applicableSchedule\":{\"location\":\"m\",\"tags\":{\"jqepqwhi\":\"xokffqyin\",\"fclduccbirdsv\":\"monstshiyxgve\",\"stmninwjizcilng\":\"wcobie\"},\"properties\":{\"labVmsShutdown\":{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"jjtbxqmuluxlxqz\",\"weeklyRecurrence\":{},\"dailyRecurrence\":{},\"hourlyRecurrence\":{},\"timeZoneId\":\"bycucrwnamikz\",\"notificationSettings\":{},\"createdDate\":\"2021-06-12T14:31:05Z\",\"targetResourceId\":\"smswziqgfuh\",\"provisioningState\":\"zruswh\",\"uniqueIdentifier\":\"czznvfbycjsxj\"},\"tags\":{\"mwmxqhndvnoamld\":\"xzv\"},\"location\":\"haohdjhhflzokxc\",\"id\":\"pelnjetag\",\"name\":\"tsxoatftgz\",\"type\":\"npbs\"},\"labVmsStartup\":{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"occsr\",\"weeklyRecurrence\":{},\"dailyRecurrence\":{},\"hourlyRecurrence\":{},\"timeZoneId\":\"m\",\"notificationSettings\":{},\"createdDate\":\"2021-10-20T23:51:36Z\",\"targetResourceId\":\"txx\",\"provisioningState\":\"y\",\"uniqueIdentifier\":\"xcjxgrytfmpcy\"},\"tags\":{\"oxuztrksx\":\"rmcaykgg\",\"jtwkjaos\":\"pndfcpfnznt\"},\"location\":\"uzvoamktcqiosm\",\"id\":\"zah\",\"name\":\"xqdlyrtltlapr\",\"type\":\"tz\"}},\"id\":\"tbhjmznnbsoqe\",\"name\":\"ala\",\"type\":\"vlagun\"},\"provisioningState\":\"gfebwlnb\",\"uniqueIdentifier\":\"yreeudz\"},\"tags\":{\"glgou\":\"bpdqmjxlyy\",\"yuojqtobaxk\":\"tlmj\",\"lbfjkwr\":\"eytu\",\"hsyrqunj\":\"snkq\"},\"location\":\"denxau\",\"id\":\"pakdkifmjnnawt\",\"name\":\"abpxuc\",\"type\":\"p\"}") .toObject(ServiceFabricInner.class); - Assertions.assertEquals("jed", model.location()); - Assertions.assertEquals("kvnlvxbcuiiznkt", model.tags().get("f")); - Assertions.assertEquals("xieixynllxec", model.externalServiceFabricId()); - Assertions.assertEquals("rojphslhcawjutif", model.environmentId()); + Assertions.assertEquals("bpdqmjxlyy", model.tags().get("glgou")); + Assertions.assertEquals("denxau", model.location()); + Assertions.assertEquals("dewemxswv", model.externalServiceFabricId()); + Assertions.assertEquals("unzzjgehk", model.environmentId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceFabricInner model = new ServiceFabricInner().withLocation("jed") - .withTags(mapOf("f", "kvnlvxbcuiiznkt", "bmikost", "nsnvpd", "kiwbuqnyoph", "z", "sgcrpfbcunezzce", "fy")) - .withExternalServiceFabricId("xieixynllxec") - .withEnvironmentId("rojphslhcawjutif"); + ServiceFabricInner model = new ServiceFabricInner() + .withTags(mapOf("glgou", "bpdqmjxlyy", "yuojqtobaxk", "tlmj", "lbfjkwr", "eytu", "hsyrqunj", "snkq")) + .withLocation("denxau") + .withExternalServiceFabricId("dewemxswv") + .withEnvironmentId("unzzjgehk"); model = BinaryData.fromObject(model).toObject(ServiceFabricInner.class); - Assertions.assertEquals("jed", model.location()); - Assertions.assertEquals("kvnlvxbcuiiznkt", model.tags().get("f")); - Assertions.assertEquals("xieixynllxec", model.externalServiceFabricId()); - Assertions.assertEquals("rojphslhcawjutif", model.environmentId()); + Assertions.assertEquals("bpdqmjxlyy", model.tags().get("glgou")); + Assertions.assertEquals("denxau", model.location()); + Assertions.assertEquals("dewemxswv", model.externalServiceFabricId()); + Assertions.assertEquals("unzzjgehk", model.environmentId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricListTests.java index a2bb2a561e5f..73ffee63d010 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricListTests.java @@ -1,59 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricInner; -import com.azure.resourcemanager.devtestlabs.models.ServiceFabricList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.devtestlabs.implementation.models.ServiceFabricList; import org.junit.jupiter.api.Assertions; public final class ServiceFabricListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceFabricList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"externalServiceFabricId\":\"ysi\",\"environmentId\":\"gqcwdhohsdtmc\",\"applicableSchedule\":{\"properties\":{\"labVmsShutdown\":{\"properties\":{},\"location\":\"ufcohdxbz\",\"id\":\"mcmuapc\",\"name\":\"hdbevwqqxeyskon\",\"type\":\"zinkfkbgbzbowxeq\"},\"labVmsStartup\":{\"properties\":{},\"location\":\"ljmygvkzqkjjeokb\",\"id\":\"efezrxcczurtlei\",\"name\":\"q\",\"type\":\"bkwvzg\"}},\"location\":\"zvd\",\"tags\":{\"xzmqpnodawop\":\"d\"},\"id\":\"hewjptmcgsbost\",\"name\":\"eln\",\"type\":\"la\"},\"provisioningState\":\"tmzlbiojlv\",\"uniqueIdentifier\":\"rbbpneqvcwwyy\"},\"location\":\"r\",\"tags\":{\"rsnm\":\"hppr\"},\"id\":\"k\",\"name\":\"yzejnhlbk\",\"type\":\"bzpcpiljhahzvec\"},{\"properties\":{\"externalServiceFabricId\":\"dbn\",\"environmentId\":\"ehol\",\"applicableSchedule\":{\"properties\":{\"labVmsShutdown\":{\"properties\":{},\"location\":\"wiuub\",\"id\":\"efqsfapaqtferrqw\",\"name\":\"x\",\"type\":\"kmfx\"},\"labVmsStartup\":{\"properties\":{},\"location\":\"jwogqqnobpudc\",\"id\":\"abtqwpwyawbzasqb\",\"name\":\"clj\",\"type\":\"kyexaoguyaipi\"}},\"location\":\"sdaultxij\",\"tags\":{\"zqdqxt\":\"fqwazlnqnmcjn\",\"nyfusfzsvtuikzh\":\"jw\"},\"id\":\"jqg\",\"name\":\"cfhmlrqryxyn\",\"type\":\"nzrdpsovwxz\"},\"provisioningState\":\"tgoe\",\"uniqueIdentifier\":\"bbabp\"},\"location\":\"hv\",\"tags\":{\"ovzidsx\":\"kvntjlrigjkskyri\"},\"id\":\"aabzmif\",\"name\":\"ygznmmaxrizk\",\"type\":\"obgop\"}],\"nextLink\":\"hsln\"}") + "{\"value\":[{\"properties\":{\"externalServiceFabricId\":\"dtddmflh\",\"environmentId\":\"tx\",\"applicableSchedule\":{\"location\":\"zna\",\"tags\":{\"nwvroevytlyokrr\":\"annovvoxczytpr\",\"uxvnsasbcrymodi\":\"o\",\"lmv\":\"rxklobdxnazpmk\",\"zxlioh\":\"vfxzopjh\"},\"properties\":{\"labVmsShutdown\":{\"properties\":{},\"id\":\"dd\",\"name\":\"fg\",\"type\":\"qbawpcbbnzqcykn\"},\"labVmsStartup\":{\"properties\":{},\"id\":\"qofyuicdhzbdy\",\"name\":\"wwgbdv\",\"type\":\"bid\"}},\"id\":\"m\",\"name\":\"ffplfmuvapckcc\",\"type\":\"rv\"},\"provisioningState\":\"yoxoy\",\"uniqueIdentifier\":\"k\"},\"tags\":{\"pyyrmfs\":\"immoiroqboshbrag\",\"opfppdbwnupgah\":\"bpav\",\"jcaacfdmmcpugm\":\"kuma\"},\"location\":\"qepvufhbzeh\",\"id\":\"hoqhnl\",\"name\":\"qnbldxe\",\"type\":\"clgsc\"},{\"properties\":{\"externalServiceFabricId\":\"ri\",\"environmentId\":\"rsrrmoucsofldp\",\"applicableSchedule\":{\"location\":\"yfcaabeolhbhlvbm\",\"tags\":{\"b\":\"ibsxtkcud\"},\"properties\":{\"labVmsShutdown\":{\"properties\":{},\"id\":\"arfsi\",\"name\":\"wlkjxn\",\"type\":\"pvwgfstmhqykizmd\"},\"labVmsStartup\":{\"properties\":{},\"id\":\"aoaf\",\"name\":\"luqvoxmycjimryv\",\"type\":\"gc\"}},\"id\":\"pbmz\",\"name\":\"w\",\"type\":\"sydsxwefohe\"},\"provisioningState\":\"vopwndyqleallk\",\"uniqueIdentifier\":\"tkhlowkxxpvbr\"},\"tags\":{\"ikcyyc\":\"mzsyzfhotl\",\"c\":\"unsjlpjrtwszhvvu\"},\"location\":\"vtrrmhwrbfdpyflu\",\"id\":\"vjglrocuyzlwhhme\",\"name\":\"hoocl\",\"type\":\"tnpqmemczjk\"},{\"properties\":{\"externalServiceFabricId\":\"ykyujxsg\",\"environmentId\":\"srrryejylmbkzu\",\"applicableSchedule\":{\"location\":\"grfihotjewlp\",\"tags\":{\"nrefqyh\":\"zj\",\"ydiw\":\"otoihiqa\"},\"properties\":{\"labVmsShutdown\":{\"properties\":{},\"id\":\"rkwpzdqtvhcspod\",\"name\":\"qaxsipietgbebjf\",\"type\":\"lbmoichd\"},\"labVmsStartup\":{\"properties\":{},\"id\":\"nfpubntnbatz\",\"name\":\"iqsowsaaelc\",\"type\":\"ttcjuhplrvkmjc\"}},\"id\":\"jvlgfggcvkyyliz\",\"name\":\"zbj\",\"type\":\"sfxsf\"},\"provisioningState\":\"tl\",\"uniqueIdentifier\":\"mvagbwidqlvhuko\"},\"tags\":{\"jfnmjmvlwyz\":\"fizr\",\"lfojuidjp\":\"iblkujr\",\"ovvtzejetjkln\":\"uyjucejikzo\",\"k\":\"ikyju\"},\"location\":\"qzolxrzvhqjw\",\"id\":\"htgv\",\"name\":\"zpcrrkolawj\",\"type\":\"jsmwrokc\"}],\"nextLink\":\"fzzzwyjafitlhg\"}") .toObject(ServiceFabricList.class); - Assertions.assertEquals("r", model.value().get(0).location()); - Assertions.assertEquals("hppr", model.value().get(0).tags().get("rsnm")); - Assertions.assertEquals("ysi", model.value().get(0).externalServiceFabricId()); - Assertions.assertEquals("gqcwdhohsdtmc", model.value().get(0).environmentId()); - Assertions.assertEquals("hsln", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceFabricList model = new ServiceFabricList().withValue(Arrays.asList( - new ServiceFabricInner().withLocation("r") - .withTags(mapOf("rsnm", "hppr")) - .withExternalServiceFabricId("ysi") - .withEnvironmentId("gqcwdhohsdtmc"), - new ServiceFabricInner().withLocation("hv") - .withTags(mapOf("ovzidsx", "kvntjlrigjkskyri")) - .withExternalServiceFabricId("dbn") - .withEnvironmentId("ehol"))) - .withNextLink("hsln"); - model = BinaryData.fromObject(model).toObject(ServiceFabricList.class); - Assertions.assertEquals("r", model.value().get(0).location()); - Assertions.assertEquals("hppr", model.value().get(0).tags().get("rsnm")); - Assertions.assertEquals("ysi", model.value().get(0).externalServiceFabricId()); - Assertions.assertEquals("gqcwdhohsdtmc", model.value().get(0).environmentId()); - Assertions.assertEquals("hsln", 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; + Assertions.assertEquals("immoiroqboshbrag", model.value().get(0).tags().get("pyyrmfs")); + Assertions.assertEquals("qepvufhbzeh", model.value().get(0).location()); + Assertions.assertEquals("dtddmflh", model.value().get(0).externalServiceFabricId()); + Assertions.assertEquals("tx", model.value().get(0).environmentId()); + Assertions.assertEquals("fzzzwyjafitlhg", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricPropertiesInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricPropertiesInnerTests.java index 0c943c93cf0e..1dd1a1e4d0cc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricPropertiesInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricPropertiesInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,18 +12,19 @@ public final class ServiceFabricPropertiesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceFabricPropertiesInner model = BinaryData.fromString( - "{\"externalServiceFabricId\":\"sihclafzvaylp\",\"environmentId\":\"sqqw\",\"applicableSchedule\":{\"properties\":{\"labVmsShutdown\":{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"kchcxwa\",\"weeklyRecurrence\":{\"weekdays\":[\"zjkjexfdeqv\"],\"time\":\"sylkks\"},\"dailyRecurrence\":{\"time\":\"ffmbmxzjrg\"},\"hourlyRecurrence\":{\"minute\":2102626781},\"timeZoneId\":\"jx\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":277669482,\"webhookUrl\":\"gicgaaoepttaq\",\"emailRecipient\":\"dewemxswv\",\"notificationLocale\":\"unzzjgehk\"},\"createdDate\":\"2021-10-15T08:21:58Z\",\"targetResourceId\":\"rtixokff\",\"provisioningState\":\"inljqepqwhixmo\",\"uniqueIdentifier\":\"tshi\"},\"location\":\"xgvelfclduccbird\",\"tags\":{\"stmninwjizcilng\":\"wcobie\"},\"id\":\"gshejjtbxqmulux\",\"name\":\"xqzv\",\"type\":\"ers\"},\"labVmsStartup\":{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"rwnamikzeb\",\"weeklyRecurrence\":{\"weekdays\":[\"mswziq\",\"fuhok\",\"ruswhv\"],\"time\":\"zznvfbyc\"},\"dailyRecurrence\":{\"time\":\"jww\"},\"hourlyRecurrence\":{\"minute\":2058612555},\"timeZoneId\":\"mwmxqhndvnoamld\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1954364961,\"webhookUrl\":\"jhhflzokxcoxpel\",\"emailRecipient\":\"eta\",\"notificationLocale\":\"tsxoatftgz\"},\"createdDate\":\"2021-01-18T18:05:03Z\",\"targetResourceId\":\"swvefloccsrmoz\",\"provisioningState\":\"m\",\"uniqueIdentifier\":\"g\"},\"location\":\"wtxxpkyjcx\",\"tags\":{\"rmcaykgg\":\"grytfmpcyci\",\"pndfcpfnznt\":\"oxuztrksx\"},\"id\":\"jtwkjaos\",\"name\":\"xuzvoamktcqi\",\"type\":\"smgbzahgxqdl\"}},\"location\":\"rtltla\",\"tags\":{\"atbhjmznn\":\"tz\",\"qeqala\":\"s\",\"tgfebwln\":\"vlagun\",\"av\":\"mhyreeudz\"},\"id\":\"pdqmjxlyyzglgouw\",\"name\":\"lmjjyuo\",\"type\":\"qtobaxkjeyt\"},\"provisioningState\":\"lbfjkwr\",\"uniqueIdentifier\":\"nkqbhsyrq\"}") + "{\"externalServiceFabricId\":\"qoweyirdhl\",\"environmentId\":\"ngwflqqmpizruwn\",\"applicableSchedule\":{\"location\":\"pxiwf\",\"tags\":{\"sii\":\"jsa\",\"sdp\":\"tmkzjvkviirhgfgr\",\"zvzbglbyv\":\"ra\"},\"properties\":{\"labVmsShutdown\":{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"brxkjzwr\",\"weeklyRecurrence\":{\"weekdays\":[\"mshkwfbkgo\"],\"time\":\"wopdbydpiz\"},\"dailyRecurrence\":{\"time\":\"lnapxbiygn\"},\"hourlyRecurrence\":{\"minute\":2118837599},\"timeZoneId\":\"fsmfcttuxuuyi\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1974888424,\"webhookUrl\":\"uvr\",\"emailRecipient\":\"mrnjh\",\"notificationLocale\":\"ujztcz\"},\"createdDate\":\"2021-11-18T09:00:27Z\",\"targetResourceId\":\"t\",\"provisioningState\":\"auunfprnjletlx\",\"uniqueIdentifier\":\"rpddouifamo\"},\"tags\":{\"zdvpiw\":\"iynknlq\"},\"location\":\"qszdtmaajquhuxyl\",\"id\":\"vmtygj\",\"name\":\"mzyospspshck\",\"type\":\"kyjpmspbps\"},\"labVmsStartup\":{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"yogtieyujtvczkcn\",\"weeklyRecurrence\":{\"weekdays\":[\"munjdxvglnkvx\"],\"time\":\"paglqivbgk\"},\"dailyRecurrence\":{\"time\":\"hpzvuqdflvoniyp\"},\"hourlyRecurrence\":{\"minute\":674431488},\"timeZoneId\":\"pzgpxtivhj\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1003924316,\"webhookUrl\":\"qjxgpnrhgovfgp\",\"emailRecipient\":\"qmhhaowj\",\"notificationLocale\":\"zvuporqzdfuydz\"},\"createdDate\":\"2021-03-31T13:08:16Z\",\"targetResourceId\":\"xcnqmxqpswokmvkh\",\"provisioningState\":\"gdhbe\",\"uniqueIdentifier\":\"qkzszuwiwtglxxh\"},\"tags\":{\"icrmnzh\":\"pg\",\"vpqcb\":\"gmqgjs\",\"s\":\"rmbodt\",\"jfrnxousxauzlwv\":\"qgvriibakcla\"},\"location\":\"mwohqfzizvuxmmkj\",\"id\":\"thnwpzte\",\"name\":\"ovmribiattg\",\"type\":\"lu\"}},\"id\":\"otangcfhnykzc\",\"name\":\"gswvxwlmzqwm\",\"type\":\"tx\"},\"provisioningState\":\"mxmcuqudtcvclxy\",\"uniqueIdentifier\":\"dkvgfabuiyjibuzp\"}") .toObject(ServiceFabricPropertiesInner.class); - Assertions.assertEquals("sihclafzvaylp", model.externalServiceFabricId()); - Assertions.assertEquals("sqqw", model.environmentId()); + Assertions.assertEquals("qoweyirdhl", model.externalServiceFabricId()); + Assertions.assertEquals("ngwflqqmpizruwn", model.environmentId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServiceFabricPropertiesInner model - = new ServiceFabricPropertiesInner().withExternalServiceFabricId("sihclafzvaylp").withEnvironmentId("sqqw"); + = new ServiceFabricPropertiesInner().withExternalServiceFabricId("qoweyirdhl") + .withEnvironmentId("ngwflqqmpizruwn"); model = BinaryData.fromObject(model).toObject(ServiceFabricPropertiesInner.class); - Assertions.assertEquals("sihclafzvaylp", model.externalServiceFabricId()); - Assertions.assertEquals("sqqw", model.environmentId()); + Assertions.assertEquals("qoweyirdhl", model.externalServiceFabricId()); + Assertions.assertEquals("ngwflqqmpizruwn", model.environmentId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateWithResponseMockTests.java index 29531f986e5f..fb23abe86721 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; @@ -30,51 +30,49 @@ public final class ServiceFabricSchedulesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"x\",\"weeklyRecurrence\":{\"weekdays\":[\"zvoikvntwczf\",\"wushlcxpbl\"],\"time\":\"hhezpfkissaidq\"},\"dailyRecurrence\":{\"time\":\"aoq\"},\"hourlyRecurrence\":{\"minute\":1755690497},\"timeZoneId\":\"otxjqfiafcnlrtbf\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1825571960,\"webhookUrl\":\"ijolbuauktwieope\",\"emailRecipient\":\"lxqdwr\",\"notificationLocale\":\"yil\"},\"createdDate\":\"2021-08-05T08:51:23Z\",\"targetResourceId\":\"kgxyxyauxre\",\"provisioningState\":\"obmc\",\"uniqueIdentifier\":\"tmwytkujsqycm\"},\"location\":\"oxfab\",\"tags\":{\"iwrycgnwplrrb\":\"pwbmwhria\"},\"id\":\"hctsbbibti\",\"name\":\"uhqvums\",\"type\":\"bfs\"}"; + = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"lpmcrdc\",\"weeklyRecurrence\":{\"weekdays\":[\"tiahxmfq\"],\"time\":\"arvsx\"},\"dailyRecurrence\":{\"time\":\"glcjkayspthzod\"},\"hourlyRecurrence\":{\"minute\":1215663059},\"timeZoneId\":\"jtgblios\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1888227557,\"webhookUrl\":\"djxyxgbkkqvjcteo\",\"emailRecipient\":\"l\",\"notificationLocale\":\"lskkzpxvj\"},\"createdDate\":\"2021-11-12T04:28:43Z\",\"targetResourceId\":\"vocoj\",\"provisioningState\":\"cnabxzf\",\"uniqueIdentifier\":\"ggytexvzilmhivz\"},\"tags\":{\"dajlskzpt\":\"wncknr\"},\"location\":\"ulweucyrth\",\"id\":\"lehmcgcjeinueho\",\"name\":\"am\",\"type\":\"fejvqn\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Schedule response = manager.serviceFabricSchedules() - .createOrUpdateWithResponse("bjop", "ouhbq", "zkqxsalu", "yigfcvcew", "wqhdgsjsa", - new ScheduleInner().withLocation("v") - .withTags(mapOf("cmyc", "gzphetxd")) - .withStatus(EnableStatus.DISABLED) - .withTaskType("c") - .withWeeklyRecurrence( - new WeekDetails().withWeekdays(Arrays.asList("fsq", "hyqmrejparnpv", "rsz", "bwtdr")) - .withTime("gz")) - .withDailyRecurrence(new DayDetails().withTime("xzlh")) - .withHourlyRecurrence(new HourDetails().withMinute(1211463960)) - .withTimeZoneId("cfculzj") - .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.ENABLED) - .withTimeInMinutes(1821326298) - .withWebhookUrl("vyldqpzfzxsoxin") - .withEmailRecipient("jlzkdrocqsxy") - .withNotificationLocale("qtcmiwdwisv")) - .withTargetResourceId("lajamca"), + .createOrUpdateWithResponse("koynuiylpckae", "sedveskwxegqphrg", "nzhctmjtsgh", "bcbcpz", "rpzeqac", + new ScheduleInner().withTags(mapOf("tsjcwjjxs", "fcmkr", "wvif", "mb", "wkloozr", "xkecifhocj")) + .withLocation("xvcmufunlcp") + .withStatus(EnableStatus.ENABLED) + .withTaskType("zmpypefcpczshnu") + .withWeeklyRecurrence(new WeekDetails().withWeekdays(Arrays.asList("izupfkhu")).withTime("uszxh")) + .withDailyRecurrence(new DayDetails().withTime("tvegwqiukvzwy")) + .withHourlyRecurrence(new HourDetails().withMinute(530706710)) + .withTimeZoneId("aokgkskjivbsshaj") + .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.DISABLED) + .withTimeInMinutes(9660463) + .withWebhookUrl("xpgeumilhwuitr") + .withEmailRecipient("xyio") + .withNotificationLocale("fninbdbzs")) + .withTargetResourceId("qrs"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("oxfab", response.location()); - Assertions.assertEquals("pwbmwhria", response.tags().get("iwrycgnwplrrb")); - Assertions.assertEquals(EnableStatus.ENABLED, response.status()); - Assertions.assertEquals("x", response.taskType()); - Assertions.assertEquals("zvoikvntwczf", response.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("hhezpfkissaidq", response.weeklyRecurrence().time()); - Assertions.assertEquals("aoq", response.dailyRecurrence().time()); - Assertions.assertEquals(1755690497, response.hourlyRecurrence().minute()); - Assertions.assertEquals("otxjqfiafcnlrtbf", response.timeZoneId()); - Assertions.assertEquals(EnableStatus.ENABLED, response.notificationSettings().status()); - Assertions.assertEquals(1825571960, response.notificationSettings().timeInMinutes()); - Assertions.assertEquals("ijolbuauktwieope", response.notificationSettings().webhookUrl()); - Assertions.assertEquals("lxqdwr", response.notificationSettings().emailRecipient()); - Assertions.assertEquals("yil", response.notificationSettings().notificationLocale()); - Assertions.assertEquals("kgxyxyauxre", response.targetResourceId()); + Assertions.assertEquals("wncknr", response.tags().get("dajlskzpt")); + Assertions.assertEquals("ulweucyrth", response.location()); + Assertions.assertEquals(EnableStatus.DISABLED, response.status()); + Assertions.assertEquals("lpmcrdc", response.taskType()); + Assertions.assertEquals("tiahxmfq", response.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("arvsx", response.weeklyRecurrence().time()); + Assertions.assertEquals("glcjkayspthzod", response.dailyRecurrence().time()); + Assertions.assertEquals(1215663059, response.hourlyRecurrence().minute()); + Assertions.assertEquals("jtgblios", response.timeZoneId()); + Assertions.assertEquals(EnableStatus.DISABLED, response.notificationSettings().status()); + Assertions.assertEquals(1888227557, response.notificationSettings().timeInMinutes()); + Assertions.assertEquals("djxyxgbkkqvjcteo", response.notificationSettings().webhookUrl()); + Assertions.assertEquals("l", response.notificationSettings().emailRecipient()); + Assertions.assertEquals("lskkzpxvj", response.notificationSettings().notificationLocale()); + Assertions.assertEquals("vocoj", response.targetResourceId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteWithResponseMockTests.java index 241274402c18..6374ee263ecf 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.serviceFabricSchedules() - .deleteWithResponse("eqbbewfcuqfpy", "xmzrmtmvwitu", "eyyjshcybwfuppox", "rcmvouujx", "iikmoxrezsvavlrx", + .deleteWithResponse("wvbhlimbyq", "crood", "ikcdrdaasax", "obsmf", "wiyjvzuko", com.azure.core.util.Context.NONE); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteMockTests.java index 45f64faece68..0b0d6f9d9d04 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,11 @@ public void testExecute() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.serviceFabricSchedules() - .execute("gkr", "wiehycpn", "wawonoehrguql", "fwafbjz", "pyrgu", com.azure.core.util.Context.NONE); + .execute("kxiuxqggvqr", "hyhlwcjsqg", "jhffbxrqrkij", "euqlsdxeqztv", "wmwwmjswen", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetWithResponseMockTests.java index aa4446e22116..7896504e0279 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -22,33 +22,34 @@ public final class ServiceFabricSchedulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"drpizfulgyctsdb\",\"weeklyRecurrence\":{\"weekdays\":[\"ujdsooxrqwo\",\"urbti\",\"apdyarikeejdpdfh\",\"wmmkfq\"],\"time\":\"iqulwwtrjmeq\"},\"dailyRecurrence\":{\"time\":\"hzokpoyuohue\"},\"hourlyRecurrence\":{\"minute\":674809851},\"timeZoneId\":\"jphmpoejnglpws\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1265588943,\"webhookUrl\":\"mxpezco\",\"emailRecipient\":\"yjrmfqzwqd\",\"notificationLocale\":\"keedcnw\"},\"createdDate\":\"2021-10-02T19:10:12Z\",\"targetResourceId\":\"fqzkvemyzdpc\",\"provisioningState\":\"qpqifdbmptrwtxz\",\"uniqueIdentifier\":\"samonat\"},\"location\":\"izexroqsqj\",\"tags\":{\"wsttxsrgx\":\"mthsp\",\"yrujm\":\"qpaniceovxgzwhs\",\"eslikyohzixyqhf\":\"i\"},\"id\":\"kvycqqqdseipnquw\",\"name\":\"xhrptyodlh\",\"type\":\"fktltdds\"}"; + = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"cvjqdv\",\"weeklyRecurrence\":{\"weekdays\":[\"pldrlefgnaavuag\",\"tetaoutnpdctuhs\",\"fefyihduyeuyld\",\"hmtybkcgsuthhll\"],\"time\":\"wynefx\"},\"dailyRecurrence\":{\"time\":\"fciatxtjrr\"},\"hourlyRecurrence\":{\"minute\":803103652},\"timeZoneId\":\"kjhhxdlajf\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1994325801,\"webhookUrl\":\"slxlhu\",\"emailRecipient\":\"krmukmyjmkxett\",\"notificationLocale\":\"lojfkqidnqto\"},\"createdDate\":\"2021-11-13T11:18:03Z\",\"targetResourceId\":\"qxcsqhtkbtnqlrn\",\"provisioningState\":\"dmbi\",\"uniqueIdentifier\":\"snawwlqkznxhhl\"},\"tags\":{\"uqqoaj\":\"icctkw\",\"rceqnkbrupob\":\"eiyglesrwvaexhdc\",\"cvumepjpbi\":\"hdmljz\",\"leqirccjclykcgxv\":\"nzpphepife\"},\"location\":\"jlvczu\",\"id\":\"ac\",\"name\":\"u\",\"type\":\"ettepdjxqe\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Schedule response = manager.serviceFabricSchedules() - .getWithResponse("dnox", "xn", "qaqotnn", "xolousdv", "g", "tqm", com.azure.core.util.Context.NONE) + .getWithResponse("n", "x", "mbpjptnvwjh", "sidqpxlbtpakft", "gatwmykyu", "rymdwmf", + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("izexroqsqj", response.location()); - Assertions.assertEquals("mthsp", response.tags().get("wsttxsrgx")); - Assertions.assertEquals(EnableStatus.ENABLED, response.status()); - Assertions.assertEquals("drpizfulgyctsdb", response.taskType()); - Assertions.assertEquals("ujdsooxrqwo", response.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("iqulwwtrjmeq", response.weeklyRecurrence().time()); - Assertions.assertEquals("hzokpoyuohue", response.dailyRecurrence().time()); - Assertions.assertEquals(674809851, response.hourlyRecurrence().minute()); - Assertions.assertEquals("jphmpoejnglpws", response.timeZoneId()); - Assertions.assertEquals(EnableStatus.ENABLED, response.notificationSettings().status()); - Assertions.assertEquals(1265588943, response.notificationSettings().timeInMinutes()); - Assertions.assertEquals("mxpezco", response.notificationSettings().webhookUrl()); - Assertions.assertEquals("yjrmfqzwqd", response.notificationSettings().emailRecipient()); - Assertions.assertEquals("keedcnw", response.notificationSettings().notificationLocale()); - Assertions.assertEquals("fqzkvemyzdpc", response.targetResourceId()); + Assertions.assertEquals("icctkw", response.tags().get("uqqoaj")); + Assertions.assertEquals("jlvczu", response.location()); + Assertions.assertEquals(EnableStatus.DISABLED, response.status()); + Assertions.assertEquals("cvjqdv", response.taskType()); + Assertions.assertEquals("pldrlefgnaavuag", response.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("wynefx", response.weeklyRecurrence().time()); + Assertions.assertEquals("fciatxtjrr", response.dailyRecurrence().time()); + Assertions.assertEquals(803103652, response.hourlyRecurrence().minute()); + Assertions.assertEquals("kjhhxdlajf", response.timeZoneId()); + Assertions.assertEquals(EnableStatus.DISABLED, response.notificationSettings().status()); + Assertions.assertEquals(1994325801, response.notificationSettings().timeInMinutes()); + Assertions.assertEquals("slxlhu", response.notificationSettings().webhookUrl()); + Assertions.assertEquals("krmukmyjmkxett", response.notificationSettings().emailRecipient()); + Assertions.assertEquals("lojfkqidnqto", response.notificationSettings().notificationLocale()); + Assertions.assertEquals("qxcsqhtkbtnqlrn", response.targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListMockTests.java index 6d2b691d090e..0d5ffe742586 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -23,34 +23,33 @@ public final class ServiceFabricSchedulesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"c\",\"weeklyRecurrence\":{\"weekdays\":[\"pzdqw\",\"zvcmcokxi\",\"ekuvfrjwuca\",\"nzvajbvbnkrdem\"],\"time\":\"dack\"},\"dailyRecurrence\":{\"time\":\"gzwdydamis\"},\"hourlyRecurrence\":{\"minute\":1462696274},\"timeZoneId\":\"ivykp\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":2052165487,\"webhookUrl\":\"j\",\"emailRecipient\":\"jiunrlshxuknsykd\",\"notificationLocale\":\"iboancdrcoanvx\"},\"createdDate\":\"2021-04-18T21:45:37Z\",\"targetResourceId\":\"onckbnlblfxlup\",\"provisioningState\":\"aqziz\",\"uniqueIdentifier\":\"pzweghlwwbo\"},\"location\":\"vgfklqiyndveqe\",\"tags\":{\"ns\":\"fvdstrkzxsgt\"},\"id\":\"lr\",\"name\":\"smovpi\",\"type\":\"y\"}]}"; + = "{\"value\":[{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"uipmpvks\",\"weeklyRecurrence\":{\"weekdays\":[\"sqxtltclkrdpq\",\"fhyrfrakk\"],\"time\":\"grcwfcmfcnrjajq\"},\"dailyRecurrence\":{\"time\":\"xjtielnzqgxxg\"},\"hourlyRecurrence\":{\"minute\":306351947},\"timeZoneId\":\"lpqagyn\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":411999278,\"webhookUrl\":\"ali\",\"emailRecipient\":\"ryqxzxa\",\"notificationLocale\":\"ibmq\"},\"createdDate\":\"2021-09-18T21:48:40Z\",\"targetResourceId\":\"mqruqguhfupe\",\"provisioningState\":\"svvoqsbpkflanfk\",\"uniqueIdentifier\":\"syaowuzowp\"},\"tags\":{\"kxrzt\":\"dkcprg\",\"ixmqrudjizcbf\":\"ochlu\"},\"location\":\"crunfhi\",\"id\":\"nmfbc\",\"name\":\"aqktkrumzu\",\"type\":\"dkyzbfvxov\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.serviceFabricSchedules() - .list("jzmhkdclacroczfm", "ner", "eluxzshxzez", "zuzudlevzskejc", "wfs", "qkstyecupyui", 30369579, "ard", + .list("r", "awn", "zm", "n", "oywsxvjabjqqaxu", "vym", 831195045, "udndoabhjxw", com.azure.core.util.Context.NONE); - Assertions.assertEquals("vgfklqiyndveqe", response.iterator().next().location()); - Assertions.assertEquals("fvdstrkzxsgt", response.iterator().next().tags().get("ns")); - Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().status()); - Assertions.assertEquals("c", response.iterator().next().taskType()); - Assertions.assertEquals("pzdqw", response.iterator().next().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("dack", response.iterator().next().weeklyRecurrence().time()); - Assertions.assertEquals("gzwdydamis", response.iterator().next().dailyRecurrence().time()); - Assertions.assertEquals(1462696274, response.iterator().next().hourlyRecurrence().minute()); - Assertions.assertEquals("ivykp", response.iterator().next().timeZoneId()); - Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().notificationSettings().status()); - Assertions.assertEquals(2052165487, response.iterator().next().notificationSettings().timeInMinutes()); - Assertions.assertEquals("j", response.iterator().next().notificationSettings().webhookUrl()); - Assertions.assertEquals("jiunrlshxuknsykd", response.iterator().next().notificationSettings().emailRecipient()); - Assertions.assertEquals("iboancdrcoanvx", - response.iterator().next().notificationSettings().notificationLocale()); - Assertions.assertEquals("onckbnlblfxlup", response.iterator().next().targetResourceId()); + Assertions.assertEquals("dkcprg", response.iterator().next().tags().get("kxrzt")); + Assertions.assertEquals("crunfhi", response.iterator().next().location()); + Assertions.assertEquals(EnableStatus.DISABLED, response.iterator().next().status()); + Assertions.assertEquals("uipmpvks", response.iterator().next().taskType()); + Assertions.assertEquals("sqxtltclkrdpq", response.iterator().next().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("grcwfcmfcnrjajq", response.iterator().next().weeklyRecurrence().time()); + Assertions.assertEquals("xjtielnzqgxxg", response.iterator().next().dailyRecurrence().time()); + Assertions.assertEquals(306351947, response.iterator().next().hourlyRecurrence().minute()); + Assertions.assertEquals("lpqagyn", response.iterator().next().timeZoneId()); + Assertions.assertEquals(EnableStatus.DISABLED, response.iterator().next().notificationSettings().status()); + Assertions.assertEquals(411999278, response.iterator().next().notificationSettings().timeInMinutes()); + Assertions.assertEquals("ali", response.iterator().next().notificationSettings().webhookUrl()); + Assertions.assertEquals("ryqxzxa", response.iterator().next().notificationSettings().emailRecipient()); + Assertions.assertEquals("ibmq", response.iterator().next().notificationSettings().notificationLocale()); + Assertions.assertEquals("mqruqguhfupe", response.iterator().next().targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateWithResponseMockTests.java index cffded7a2237..cd5aa2403de8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -25,36 +25,35 @@ public final class ServiceFabricSchedulesUpdateWithResponseMockTests { @Test public void testUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"bzzxezm\",\"weeklyRecurrence\":{\"weekdays\":[\"gpjeuxsphlokfp\",\"ijpdvzvfbhwbdquf\"],\"time\":\"gnrglaqrwyamb\"},\"dailyRecurrence\":{\"time\":\"febzxf\"},\"hourlyRecurrence\":{\"minute\":1911300905},\"timeZoneId\":\"ibhlenntrv\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1274004293,\"webhookUrl\":\"u\",\"emailRecipient\":\"zmlghny\",\"notificationLocale\":\"lpyeu\"},\"createdDate\":\"2021-04-16T06:06:20Z\",\"targetResourceId\":\"dixqbo\",\"provisioningState\":\"vhh\",\"uniqueIdentifier\":\"qe\"},\"location\":\"at\",\"tags\":{\"nmtsdixc\":\"znmg\",\"ibmg\":\"w\",\"gair\":\"ymncjc\",\"fbhtleberp\":\"cqzoofjnqjsve\"},\"id\":\"ljekn\",\"name\":\"qnwjjq\",\"type\":\"owkdnjr\"}"; + = "{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"nsqktc\",\"weeklyRecurrence\":{\"weekdays\":[\"zzoslpkyb\",\"glwkzpgajsqj\"],\"time\":\"mqbmfuvqarwz\"},\"dailyRecurrence\":{\"time\":\"rebluimmbwxsf\"},\"hourlyRecurrence\":{\"minute\":1020609518},\"timeZoneId\":\"vxekraokqkbud\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1660057232,\"webhookUrl\":\"avlyttaaknwf\",\"emailRecipient\":\"ebsmhpdujdigato\",\"notificationLocale\":\"ksc\"},\"createdDate\":\"2021-10-26T15:44:30Z\",\"targetResourceId\":\"anqimwbzxpdcl\",\"provisioningState\":\"ka\",\"uniqueIdentifier\":\"snlaimoux\"},\"tags\":{\"iuswswj\":\"qmudmfcoibic\"},\"location\":\"b\",\"id\":\"jhbtqq\",\"name\":\"yfscyrfwbivqvo\",\"type\":\"fuy\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Schedule response = manager.serviceFabricSchedules() - .updateWithResponse("kj", "oywlunpipcwyb", "zfn", "npatpftsae", "wf", - new ScheduleFragment().withTags(mapOf("cylht", "orpwaltzwugexojf", "dr", "hthvazjpwex")), - com.azure.core.util.Context.NONE) + .updateWithResponse("tmbqdabzfivfok", "ysthhza", "jfwyyrlhgenuze", "gvkvebaqszll", "zlsmmdqgmihzpim", + new ScheduleFragment().withTags(mapOf("logxsvtzar", "hnxtmin")), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("at", response.location()); - Assertions.assertEquals("znmg", response.tags().get("nmtsdixc")); - Assertions.assertEquals(EnableStatus.DISABLED, response.status()); - Assertions.assertEquals("bzzxezm", response.taskType()); - Assertions.assertEquals("gpjeuxsphlokfp", response.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("gnrglaqrwyamb", response.weeklyRecurrence().time()); - Assertions.assertEquals("febzxf", response.dailyRecurrence().time()); - Assertions.assertEquals(1911300905, response.hourlyRecurrence().minute()); - Assertions.assertEquals("ibhlenntrv", response.timeZoneId()); - Assertions.assertEquals(EnableStatus.ENABLED, response.notificationSettings().status()); - Assertions.assertEquals(1274004293, response.notificationSettings().timeInMinutes()); - Assertions.assertEquals("u", response.notificationSettings().webhookUrl()); - Assertions.assertEquals("zmlghny", response.notificationSettings().emailRecipient()); - Assertions.assertEquals("lpyeu", response.notificationSettings().notificationLocale()); - Assertions.assertEquals("dixqbo", response.targetResourceId()); + Assertions.assertEquals("qmudmfcoibic", response.tags().get("iuswswj")); + Assertions.assertEquals("b", response.location()); + Assertions.assertEquals(EnableStatus.ENABLED, response.status()); + Assertions.assertEquals("nsqktc", response.taskType()); + Assertions.assertEquals("zzoslpkyb", response.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("mqbmfuvqarwz", response.weeklyRecurrence().time()); + Assertions.assertEquals("rebluimmbwxsf", response.dailyRecurrence().time()); + Assertions.assertEquals(1020609518, response.hourlyRecurrence().minute()); + Assertions.assertEquals("vxekraokqkbud", response.timeZoneId()); + Assertions.assertEquals(EnableStatus.DISABLED, response.notificationSettings().status()); + Assertions.assertEquals(1660057232, response.notificationSettings().timeInMinutes()); + Assertions.assertEquals("avlyttaaknwf", response.notificationSettings().webhookUrl()); + Assertions.assertEquals("ebsmhpdujdigato", response.notificationSettings().emailRecipient()); + Assertions.assertEquals("ksc", response.notificationSettings().notificationLocale()); + Assertions.assertEquals("anqimwbzxpdcl", response.targetResourceId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateMockTests.java index bb912d6dc5b2..8eb720089c7a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ServiceFabric; @@ -23,28 +23,28 @@ public final class ServiceFabricsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"externalServiceFabricId\":\"iihfymkoui\",\"environmentId\":\"eseuugci\",\"applicableSchedule\":{\"properties\":{\"labVmsShutdown\":{\"properties\":{},\"location\":\"ogsmgbvmtd\",\"tags\":{\"veglabtvkbiwzn\":\"bebjn\"},\"id\":\"tfgfic\",\"name\":\"dyhi\",\"type\":\"paczmuh\"},\"labVmsStartup\":{\"properties\":{},\"location\":\"akznhokhoitwhr\",\"tags\":{\"jpg\":\"mmazdnckid\",\"bssdpjeyoqxd\":\"hzqpxzbawkikcdgf\"},\"id\":\"decfiwhagxsure\",\"name\":\"qrshzzbgullcxiq\",\"type\":\"zjk\"}},\"location\":\"xdupnamg\",\"tags\":{\"igdyd\":\"uigdmfivjqterdq\",\"tyhhmvfxlapja\":\"ghpcvrwqirvt\",\"okqlujqgir\":\"odmkrrwepgqv\",\"pqvctsfaeuhwwsk\":\"bwlyvxc\"},\"id\":\"stvzuzhasupml\",\"name\":\"pdpg\",\"type\":\"vzqazvbkarkptg\"},\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"eq\"},\"location\":\"gubabyjde\",\"tags\":{\"emexmnvkvmuwr\":\"cseydz\"},\"id\":\"lniwmcpmrrd\",\"name\":\"hvdvmi\",\"type\":\"hbeae\"}"; + = "{\"properties\":{\"externalServiceFabricId\":\"cdsvmwbitek\",\"environmentId\":\"fobvfiybxqich\",\"applicableSchedule\":{\"location\":\"fzdqekiv\",\"tags\":{\"ulrqtbht\":\"zcvdi\"},\"properties\":{\"labVmsShutdown\":{\"properties\":{},\"tags\":{\"yfmx\":\"zlp\"},\"location\":\"utzfkgilnoudc\",\"id\":\"nd\",\"name\":\"gdpri\",\"type\":\"gqqyeqfcbuulpyuf\"},\"labVmsStartup\":{\"properties\":{},\"tags\":{\"gimwdcsklkqnqv\":\"shtujcyoh\"},\"location\":\"xn\",\"id\":\"zmec\",\"name\":\"yrzwim\",\"type\":\"zayspzvriet\"}},\"id\":\"phmdzxplgtp\",\"name\":\"dvatlzmgschn\",\"type\":\"rsbkkzovlzdmnfmf\"},\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"wdehk\"},\"tags\":{\"yrvap\":\"hzfova\"},\"location\":\"gelg\",\"id\":\"wikfyaqandmym\",\"name\":\"qoq\",\"type\":\"umov\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); ServiceFabric response = manager.serviceFabrics() - .define("mnnidmdia") - .withRegion("tkvi") - .withExistingUser("dpwrp", "fpcfjf", "zlgzawkgyepey") - .withTags(mapOf("dpcmhjh", "fliwoynguuzhwvl", "ym", "usybke")) - .withExternalServiceFabricId("zxkzrntmkct") - .withEnvironmentId("uos") + .define("pt") + .withExistingUser("cwlo", "dejkluxxrwzobuz", "sxgamtdtkw") + .withRegion("l") + .withTags(mapOf("cbgvsbt", "cwnynlleiq", "xmnrqstjcmet", "ertoxadhxuvj")) + .withExternalServiceFabricId("zdprmimrljdpoqfx") + .withEnvironmentId("mhk") .create(); - Assertions.assertEquals("gubabyjde", response.location()); - Assertions.assertEquals("cseydz", response.tags().get("emexmnvkvmuwr")); - Assertions.assertEquals("iihfymkoui", response.externalServiceFabricId()); - Assertions.assertEquals("eseuugci", response.environmentId()); + Assertions.assertEquals("hzfova", response.tags().get("yrvap")); + Assertions.assertEquals("gelg", response.location()); + Assertions.assertEquals("cdsvmwbitek", response.externalServiceFabricId()); + Assertions.assertEquals("fobvfiybxqich", response.environmentId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteMockTests.java index e021a4ba9d38..ed43687595b6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDelete() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.serviceFabrics().delete("xi", "mlnfyz", "vfrbypic", "bkpdjtaqhsmq", com.azure.core.util.Context.NONE); + manager.serviceFabrics() + .delete("cjdk", "otcsu", "mzoonsvobchkxfpw", "dyslbklglmnn", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetWithResponseMockTests.java index 0d2b186b75df..66933ac252df 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ServiceFabric; @@ -21,23 +21,23 @@ public final class ServiceFabricsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"externalServiceFabricId\":\"lhxd\",\"environmentId\":\"klciichgjsysm\",\"applicableSchedule\":{\"properties\":{\"labVmsShutdown\":{\"properties\":{},\"location\":\"dgwxfkzsifcu\",\"tags\":{\"gcwx\":\"u\",\"bwjtrdx\":\"ec\",\"sy\":\"izagbbgiar\"},\"id\":\"pgdqxwabzrw\",\"name\":\"qrxhaclcdos\",\"type\":\"kptjqgkifmmai\"},\"labVmsStartup\":{\"properties\":{},\"location\":\"hedxkpbqwuntob\",\"tags\":{\"lw\":\"azz\"},\"id\":\"vydjufbnk\",\"name\":\"blaxpegj\",\"type\":\"dabalfdxaglzfytl\"}},\"location\":\"tlqh\",\"tags\":{\"ypzkg\":\"ouvmrsiflik\",\"oksz\":\"fxfmyrqsdb\"},\"id\":\"nm\",\"name\":\"wgpterdiuw\",\"type\":\"i\"},\"provisioningState\":\"skw\",\"uniqueIdentifier\":\"sdetjygowifcqpol\"},\"location\":\"kg\",\"tags\":{\"zoxlvoc\":\"gzyy\",\"gmlilwzghjhjvmab\":\"tvdxxhe\",\"tn\":\"zbwaybfmdafbgym\",\"ipneychb\":\"preojxrjnbsconxa\"},\"id\":\"izqfsgnwdxz\",\"name\":\"dpq\",\"type\":\"rfbo\"}"; + = "{\"properties\":{\"externalServiceFabricId\":\"dkluwzxeygzvt\",\"environmentId\":\"vjhubnobguqisqs\",\"applicableSchedule\":{\"location\":\"dmioyjpnmlvi\",\"tags\":{\"vqdvrdmvxyrxdhg\":\"szpm\",\"cgbzxm\":\"qojbxao\",\"lef\":\"t\"},\"properties\":{\"labVmsShutdown\":{\"properties\":{},\"tags\":{\"awsxmrszbknimxlp\":\"idoxznvgvdtmuuv\",\"mnb\":\"erxrzutylcurza\",\"bjmbnvynfaooeac\":\"qaeht\"},\"location\":\"dcglskakddid\",\"id\":\"zl\",\"name\":\"rqm\",\"type\":\"lpbyxroiduyq\"},\"labVmsStartup\":{\"properties\":{},\"tags\":{\"brjjtalxrdsjr\":\"mnoiicsudy\",\"pjwyblvtbdmvs\":\"oluqwgusxxhdo\",\"kmkwjfbo\":\"yidaelqpv\"},\"location\":\"oggdusxursui\",\"id\":\"xcjkcoqwczsy\",\"name\":\"qrizfwihvaan\",\"type\":\"qtnhjrfd\"}},\"id\":\"dv\",\"name\":\"b\",\"type\":\"exxjfwtgdfk\"},\"provisioningState\":\"uigvmua\",\"uniqueIdentifier\":\"czfedyuep\"},\"tags\":{\"ajjvywe\":\"lti\"},\"location\":\"fkumcfjxoky\",\"id\":\"syasvfnkwmygjjek\",\"name\":\"knfdr\",\"type\":\"gjqyckgtxkrdtulc\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); ServiceFabric response = manager.serviceFabrics() - .getWithResponse("gddhjkrukizyhgs", "tnqsktx", "fpjbqggwe", "iwdhdmncgbfzu", "cstu", + .getWithResponse("xpthceopvkvt", "fve", "obpbokhmm", "cdyarnggcjfwblqh", "kasmcolmugpyva", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("kg", response.location()); - Assertions.assertEquals("gzyy", response.tags().get("zoxlvoc")); - Assertions.assertEquals("lhxd", response.externalServiceFabricId()); - Assertions.assertEquals("klciichgjsysm", response.environmentId()); + Assertions.assertEquals("lti", response.tags().get("ajjvywe")); + Assertions.assertEquals("fkumcfjxoky", response.location()); + Assertions.assertEquals("dkluwzxeygzvt", response.externalServiceFabricId()); + Assertions.assertEquals("vjhubnobguqisqs", response.environmentId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesWithResponseMockTests.java index 36edb826bd54..1b83aecfee9c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ApplicableSchedule; @@ -22,52 +22,51 @@ public final class ServiceFabricsListApplicableSchedulesWithResponseMockTests { @Test public void testListApplicableSchedulesWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"labVmsShutdown\":{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"musuaawja\",\"weeklyRecurrence\":{\"weekdays\":[\"nfczmnniixyxvq\",\"anosj\",\"gir\"],\"time\":\"gmgmdd\"},\"dailyRecurrence\":{\"time\":\"mynltwmpftmfoeaj\"},\"hourlyRecurrence\":{\"minute\":971513853},\"timeZoneId\":\"wetamfddrvlk\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":622642791,\"webhookUrl\":\"ecchdidrmuhkahm\",\"emailRecipient\":\"dbiucvkhhwmjpjbw\",\"notificationLocale\":\"nx\"},\"createdDate\":\"2021-05-20T15:06:34Z\",\"targetResourceId\":\"ihufoihp\",\"provisioningState\":\"ybxvgn\",\"uniqueIdentifier\":\"zpbgkzc\"},\"location\":\"cpiuzvk\",\"tags\":{\"pucdocf\":\"dimjuktirzkau\",\"o\":\"plw\",\"xwr\":\"m\",\"vbgikyj\":\"lvzkl\"},\"id\":\"kakvlbishjvpza\",\"name\":\"tuoska\",\"type\":\"izjixwfgcd\"},\"labVmsStartup\":{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"xwnujvqyn\",\"weeklyRecurrence\":{\"weekdays\":[\"tmdmuqohhihr\"],\"time\":\"quddrwjclj\"},\"dailyRecurrence\":{\"time\":\"lhpv\"},\"hourlyRecurrence\":{\"minute\":495666062},\"timeZoneId\":\"enninafhxrzfrm\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":671742673,\"webhookUrl\":\"viqlluk\",\"emailRecipient\":\"rcqxgcbvzarmqc\",\"notificationLocale\":\"okstsinvagovjyh\"},\"createdDate\":\"2021-05-26T07:55:45Z\",\"targetResourceId\":\"rdvcehqwhit\",\"provisioningState\":\"mxgnmguzbuwv\",\"uniqueIdentifier\":\"balkjnbkbdhl\"},\"location\":\"tqstqkqsygxiyne\",\"tags\":{\"heu\":\"agz\",\"ckqiawzlzk\":\"anlxunpq\",\"wsaudoejtighsxj\":\"aslgacizuxlrarwp\"},\"id\":\"ytnkqb\",\"name\":\"lahovuuwx\",\"type\":\"mehjnhjioti\"}},\"location\":\"fbbcngkegxcypxbb\",\"tags\":{\"lyr\":\"w\",\"frolq\":\"oxpdxq\",\"u\":\"wnk\"},\"id\":\"jew\",\"name\":\"ahwkxjjm\",\"type\":\"tnlmsoodtmvecdhd\"}"; + = "{\"location\":\"wnhczbutou\",\"tags\":{\"cqqwwvgwkslvlize\":\"tirjwayh\",\"v\":\"vbia\",\"wkhojqttbspvkhg\":\"srgekzyqxadyfhb\",\"xrk\":\"aqjsgyzstujr\"},\"properties\":{\"labVmsShutdown\":{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"lduyehiiittugyuq\",\"weeklyRecurrence\":{\"weekdays\":[\"axu\",\"fqa\",\"csozjv\"],\"time\":\"zciggbnvtxofwa\"},\"dailyRecurrence\":{\"time\":\"xwhoeamoeobd\"},\"hourlyRecurrence\":{\"minute\":1780385044},\"timeZoneId\":\"pnimtwuuh\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1950784966,\"webhookUrl\":\"mnfeub\",\"emailRecipient\":\"jyrkwfug\",\"notificationLocale\":\"hrrk\"},\"createdDate\":\"2021-11-22T07:43:02Z\",\"targetResourceId\":\"qdurhzzfopue\",\"provisioningState\":\"usvwluj\",\"uniqueIdentifier\":\"wnibittoz\"},\"tags\":{\"ctxegt\":\"qumqvfmwcaddt\",\"elfnzzryiz\":\"gwyur\"},\"location\":\"xgdebxl\",\"id\":\"unomir\",\"name\":\"p\",\"type\":\"abenqlamwmg\"},\"labVmsStartup\":{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"f\",\"weeklyRecurrence\":{\"weekdays\":[\"pjs\"],\"time\":\"hemhcucsqsnxfbx\"},\"dailyRecurrence\":{\"time\":\"apdrbzyvbsuadu\"},\"hourlyRecurrence\":{\"minute\":1541266017},\"timeZoneId\":\"axpfobkzhmhj\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1291647350,\"webhookUrl\":\"uq\",\"emailRecipient\":\"jadhfztl\",\"notificationLocale\":\"ysrkgzkyhudbk\"},\"createdDate\":\"2021-09-04T10:05:44Z\",\"targetResourceId\":\"qxlcweakfecjvx\",\"provisioningState\":\"qufqizj\",\"uniqueIdentifier\":\"pwooajeyyj\"},\"tags\":{\"pxhn\":\"xiz\",\"yqpdwadeghztld\":\"lslekcttgzkj\"},\"location\":\"czdjiahuqymjzucw\",\"id\":\"ejjqhddw\",\"name\":\"mqxiyoo\",\"type\":\"yfozkbnzxbypfqp\"}},\"id\":\"ixwrgrk\",\"name\":\"derfrswqikwepwog\",\"type\":\"gicwnxhtfmcqbs\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); ApplicableSchedule response = manager.serviceFabrics() - .listApplicableSchedulesWithResponse("zpdgonjhxshthmgp", "zqulptkbv", "pxtzhigqqbtimpk", "blornsih", + .listApplicableSchedulesWithResponse("ivrakfrryn", "cwmhlymgnukxrk", "mjpequlr", "zaudgjtfbclakkuc", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("fbbcngkegxcypxbb", response.location()); - Assertions.assertEquals("w", response.tags().get("lyr")); - Assertions.assertEquals("cpiuzvk", response.labVmsShutdown().location()); - Assertions.assertEquals("dimjuktirzkau", response.labVmsShutdown().tags().get("pucdocf")); - Assertions.assertEquals(EnableStatus.DISABLED, response.labVmsShutdown().status()); - Assertions.assertEquals("musuaawja", response.labVmsShutdown().taskType()); - Assertions.assertEquals("nfczmnniixyxvq", response.labVmsShutdown().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("gmgmdd", response.labVmsShutdown().weeklyRecurrence().time()); - Assertions.assertEquals("mynltwmpftmfoeaj", response.labVmsShutdown().dailyRecurrence().time()); - Assertions.assertEquals(971513853, response.labVmsShutdown().hourlyRecurrence().minute()); - Assertions.assertEquals("wetamfddrvlk", response.labVmsShutdown().timeZoneId()); - Assertions.assertEquals(EnableStatus.DISABLED, response.labVmsShutdown().notificationSettings().status()); - Assertions.assertEquals(622642791, response.labVmsShutdown().notificationSettings().timeInMinutes()); - Assertions.assertEquals("ecchdidrmuhkahm", response.labVmsShutdown().notificationSettings().webhookUrl()); - Assertions.assertEquals("dbiucvkhhwmjpjbw", response.labVmsShutdown().notificationSettings().emailRecipient()); - Assertions.assertEquals("nx", response.labVmsShutdown().notificationSettings().notificationLocale()); - Assertions.assertEquals("ihufoihp", response.labVmsShutdown().targetResourceId()); - Assertions.assertEquals("tqstqkqsygxiyne", response.labVmsStartup().location()); - Assertions.assertEquals("agz", response.labVmsStartup().tags().get("heu")); + Assertions.assertEquals("wnhczbutou", response.location()); + Assertions.assertEquals("tirjwayh", response.tags().get("cqqwwvgwkslvlize")); + Assertions.assertEquals("qumqvfmwcaddt", response.labVmsShutdown().tags().get("ctxegt")); + Assertions.assertEquals("xgdebxl", response.labVmsShutdown().location()); + Assertions.assertEquals(EnableStatus.ENABLED, response.labVmsShutdown().status()); + Assertions.assertEquals("lduyehiiittugyuq", response.labVmsShutdown().taskType()); + Assertions.assertEquals("axu", response.labVmsShutdown().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("zciggbnvtxofwa", response.labVmsShutdown().weeklyRecurrence().time()); + Assertions.assertEquals("xwhoeamoeobd", response.labVmsShutdown().dailyRecurrence().time()); + Assertions.assertEquals(1780385044, response.labVmsShutdown().hourlyRecurrence().minute()); + Assertions.assertEquals("pnimtwuuh", response.labVmsShutdown().timeZoneId()); + Assertions.assertEquals(EnableStatus.ENABLED, response.labVmsShutdown().notificationSettings().status()); + Assertions.assertEquals(1950784966, response.labVmsShutdown().notificationSettings().timeInMinutes()); + Assertions.assertEquals("mnfeub", response.labVmsShutdown().notificationSettings().webhookUrl()); + Assertions.assertEquals("jyrkwfug", response.labVmsShutdown().notificationSettings().emailRecipient()); + Assertions.assertEquals("hrrk", response.labVmsShutdown().notificationSettings().notificationLocale()); + Assertions.assertEquals("qdurhzzfopue", response.labVmsShutdown().targetResourceId()); + Assertions.assertEquals("xiz", response.labVmsStartup().tags().get("pxhn")); + Assertions.assertEquals("czdjiahuqymjzucw", response.labVmsStartup().location()); Assertions.assertEquals(EnableStatus.DISABLED, response.labVmsStartup().status()); - Assertions.assertEquals("xwnujvqyn", response.labVmsStartup().taskType()); - Assertions.assertEquals("tmdmuqohhihr", response.labVmsStartup().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("quddrwjclj", response.labVmsStartup().weeklyRecurrence().time()); - Assertions.assertEquals("lhpv", response.labVmsStartup().dailyRecurrence().time()); - Assertions.assertEquals(495666062, response.labVmsStartup().hourlyRecurrence().minute()); - Assertions.assertEquals("enninafhxrzfrm", response.labVmsStartup().timeZoneId()); - Assertions.assertEquals(EnableStatus.ENABLED, response.labVmsStartup().notificationSettings().status()); - Assertions.assertEquals(671742673, response.labVmsStartup().notificationSettings().timeInMinutes()); - Assertions.assertEquals("viqlluk", response.labVmsStartup().notificationSettings().webhookUrl()); - Assertions.assertEquals("rcqxgcbvzarmqc", response.labVmsStartup().notificationSettings().emailRecipient()); - Assertions.assertEquals("okstsinvagovjyh", - response.labVmsStartup().notificationSettings().notificationLocale()); - Assertions.assertEquals("rdvcehqwhit", response.labVmsStartup().targetResourceId()); + Assertions.assertEquals("f", response.labVmsStartup().taskType()); + Assertions.assertEquals("pjs", response.labVmsStartup().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("hemhcucsqsnxfbx", response.labVmsStartup().weeklyRecurrence().time()); + Assertions.assertEquals("apdrbzyvbsuadu", response.labVmsStartup().dailyRecurrence().time()); + Assertions.assertEquals(1541266017, response.labVmsStartup().hourlyRecurrence().minute()); + Assertions.assertEquals("axpfobkzhmhj", response.labVmsStartup().timeZoneId()); + Assertions.assertEquals(EnableStatus.DISABLED, response.labVmsStartup().notificationSettings().status()); + Assertions.assertEquals(1291647350, response.labVmsStartup().notificationSettings().timeInMinutes()); + Assertions.assertEquals("uq", response.labVmsStartup().notificationSettings().webhookUrl()); + Assertions.assertEquals("jadhfztl", response.labVmsStartup().notificationSettings().emailRecipient()); + Assertions.assertEquals("ysrkgzkyhudbk", response.labVmsStartup().notificationSettings().notificationLocale()); + Assertions.assertEquals("qxlcweakfecjvx", response.labVmsStartup().targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListMockTests.java index ba095ac5be80..c08a351128fb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ServiceFabric; @@ -22,22 +22,22 @@ public final class ServiceFabricsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"externalServiceFabricId\":\"dxwhieproqksmfx\",\"environmentId\":\"vprstv\",\"applicableSchedule\":{\"properties\":{\"labVmsShutdown\":{\"properties\":{},\"location\":\"b\",\"tags\":{\"qxwetjtd\":\"dyotnplfacqoccq\",\"padkmdzgsszxvct\":\"hutfdoadtxopge\",\"clabv\":\"bbxuharlsirn\"},\"id\":\"yngsuxxcz\",\"name\":\"myqjog\",\"type\":\"dsaidjanormovdxx\"},\"labVmsStartup\":{\"properties\":{},\"location\":\"ntujmoilunwemhd\",\"tags\":{\"rhrhtsl\":\"jslkyozdsfzjue\",\"j\":\"jtv\",\"bpnjodf\":\"xvgjbfi\"},\"id\":\"bj\",\"name\":\"qwm\",\"type\":\"q\"}},\"location\":\"moxsa\",\"tags\":{\"ywnfyszzaczs\":\"ejgwe\"},\"id\":\"nqbdnddbboz\",\"name\":\"yvrmkjm\",\"type\":\"it\"},\"provisioningState\":\"hwudlxeei\",\"uniqueIdentifier\":\"pmnoejhqlf\"},\"location\":\"sibz\",\"tags\":{\"vmtywhlakxp\":\"fgxkydpmypgf\",\"m\":\"jpewpyjlfx\"},\"id\":\"qcrzgeuqxbpia\",\"name\":\"w\",\"type\":\"aujegqdtadra\"}]}"; + = "{\"value\":[{\"properties\":{\"externalServiceFabricId\":\"jzkcasfwzcntog\",\"environmentId\":\"jwajnrtw\",\"applicableSchedule\":{\"location\":\"qkifmxawostfz\",\"tags\":{\"vwfnqqwypvn\":\"rkmjqncfvdscnhe\",\"b\":\"r\",\"ggrssgwjfkain\":\"od\"},\"properties\":{\"labVmsShutdown\":{\"properties\":{},\"tags\":{\"tdscnkzzohnrdd\":\"mvecvztscbgmusai\",\"ozrehlbzqixbnjrq\":\"lze\",\"pam\":\"zyuexozony\"},\"location\":\"dpabcreuwzosg\",\"id\":\"xvcvasormrexz\",\"name\":\"dubewgzy\",\"type\":\"baduvecovsdq\"},\"labVmsStartup\":{\"properties\":{},\"tags\":{\"imzfvpp\":\"dbakr\",\"ombcdtajdopggo\":\"eqsifjmclngygnhr\",\"qtrotpvclp\":\"wj\"},\"location\":\"yrlmwkptsk\",\"id\":\"jgvhxcc\",\"name\":\"mkakmkook\",\"type\":\"putmgvmuyakm\"}},\"id\":\"ktfowzkroyrdur\",\"name\":\"flzqjimejtgzjxx\",\"type\":\"fejlzuqloiw\"},\"provisioningState\":\"yyzivrmitcd\",\"uniqueIdentifier\":\"hchwhrktjleif\"},\"tags\":{\"fnsmycjowly\":\"iplh\",\"zbuw\":\"yzmudsqcmhnx\"},\"location\":\"machbkv\",\"id\":\"pbjrmvgoqplehm\",\"name\":\"mkzdllczdprwnhk\",\"type\":\"qggoxsst\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.serviceFabrics() - .list("oxudnmckap", "hknqiijge", "cdgmoqu", "qih", "kyow", 1032764094, "jouw", + .list("kwayqshwy", "xrid", "tb", "aqjmkgxqwque", "uylztpziizevjyk", 1718271700, "vezefkhkqtwqle", com.azure.core.util.Context.NONE); - Assertions.assertEquals("sibz", response.iterator().next().location()); - Assertions.assertEquals("fgxkydpmypgf", response.iterator().next().tags().get("vmtywhlakxp")); - Assertions.assertEquals("dxwhieproqksmfx", response.iterator().next().externalServiceFabricId()); - Assertions.assertEquals("vprstv", response.iterator().next().environmentId()); + Assertions.assertEquals("iplh", response.iterator().next().tags().get("fnsmycjowly")); + Assertions.assertEquals("machbkv", response.iterator().next().location()); + Assertions.assertEquals("jzkcasfwzcntog", response.iterator().next().externalServiceFabricId()); + Assertions.assertEquals("jwajnrtw", response.iterator().next().environmentId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartMockTests.java index 09ff0ccfd90b..c28287f6f958 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testStart() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.serviceFabrics() - .start("swcrptveaj", "zxvlgsrgkrfizrp", "wlp", "yuqh", com.azure.core.util.Context.NONE); + manager.serviceFabrics().start("d", "pgchzpgfqum", "djxh", "ghgodkynrceq", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopMockTests.java index e1003113dffc..f693b2356cbb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testStop() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.serviceFabrics().stop("lmcskyk", "fuofixcnpcfykkp", "ycpawm", "jp", com.azure.core.util.Context.NONE); + manager.serviceFabrics().stop("v", "dbd", "mmxjdnajuopj", "yqmkwlh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteWithResponseMockTests.java index c83cbda279d1..39167760be1f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDeleteWithResponse() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.serviceRunners() - .deleteWithResponse("nwoqartwy", "qicladv", "tdavuqmcbymsfobj", com.azure.core.util.Context.NONE); + manager.serviceRunners().deleteWithResponse("cngkegxcypxb", "fetwi", "y", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SharedPublicIpAddressConfigurationTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SharedPublicIpAddressConfigurationTests.java index a6dc837d9352..edd0595ad7a2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SharedPublicIpAddressConfigurationTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SharedPublicIpAddressConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -15,26 +15,22 @@ public final class SharedPublicIpAddressConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SharedPublicIpAddressConfiguration model = BinaryData.fromString( - "{\"inboundNatRules\":[{\"transportProtocol\":\"Tcp\",\"frontendPort\":1513768261,\"backendPort\":930430831},{\"transportProtocol\":\"Tcp\",\"frontendPort\":845097361,\"backendPort\":182360383}]}") + "{\"inboundNatRules\":[{\"transportProtocol\":\"Udp\",\"frontendPort\":264825105,\"backendPort\":1581858778}]}") .toObject(SharedPublicIpAddressConfiguration.class); - Assertions.assertEquals(TransportProtocol.TCP, model.inboundNatRules().get(0).transportProtocol()); - Assertions.assertEquals(1513768261, model.inboundNatRules().get(0).frontendPort()); - Assertions.assertEquals(930430831, model.inboundNatRules().get(0).backendPort()); + Assertions.assertEquals(TransportProtocol.UDP, model.inboundNatRules().get(0).transportProtocol()); + Assertions.assertEquals(264825105, model.inboundNatRules().get(0).frontendPort()); + Assertions.assertEquals(1581858778, model.inboundNatRules().get(0).backendPort()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SharedPublicIpAddressConfiguration model - = new SharedPublicIpAddressConfiguration().withInboundNatRules(Arrays.asList( - new InboundNatRule().withTransportProtocol(TransportProtocol.TCP) - .withFrontendPort(1513768261) - .withBackendPort(930430831), - new InboundNatRule().withTransportProtocol(TransportProtocol.TCP) - .withFrontendPort(845097361) - .withBackendPort(182360383))); + SharedPublicIpAddressConfiguration model = new SharedPublicIpAddressConfiguration() + .withInboundNatRules(Arrays.asList(new InboundNatRule().withTransportProtocol(TransportProtocol.UDP) + .withFrontendPort(264825105) + .withBackendPort(1581858778))); model = BinaryData.fromObject(model).toObject(SharedPublicIpAddressConfiguration.class); - Assertions.assertEquals(TransportProtocol.TCP, model.inboundNatRules().get(0).transportProtocol()); - Assertions.assertEquals(1513768261, model.inboundNatRules().get(0).frontendPort()); - Assertions.assertEquals(930430831, model.inboundNatRules().get(0).backendPort()); + Assertions.assertEquals(TransportProtocol.UDP, model.inboundNatRules().get(0).transportProtocol()); + Assertions.assertEquals(264825105, model.inboundNatRules().get(0).frontendPort()); + Assertions.assertEquals(1581858778, model.inboundNatRules().get(0).backendPort()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SubnetOverrideTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SubnetOverrideTests.java index aa0adf35c982..419bca7d335f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SubnetOverrideTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SubnetOverrideTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -17,40 +17,40 @@ public final class SubnetOverrideTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SubnetOverride model = BinaryData.fromString( - "{\"resourceId\":\"q\",\"labSubnetName\":\"izxqltgrd\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{\"transportProtocol\":\"Tcp\",\"backendPort\":47041637},{\"transportProtocol\":\"Tcp\",\"backendPort\":2094013650},{\"transportProtocol\":\"Udp\",\"backendPort\":875349489},{\"transportProtocol\":\"Udp\",\"backendPort\":1159894455}]},\"virtualNetworkPoolName\":\"blml\"}") + "{\"resourceId\":\"cqtjzmi\",\"labSubnetName\":\"gbgatzuuvbxn\",\"useInVmCreationPermission\":\"Default\",\"usePublicIpAddressPermission\":\"Deny\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{\"transportProtocol\":\"Udp\",\"backendPort\":80766571},{\"transportProtocol\":\"Tcp\",\"backendPort\":89954897},{\"transportProtocol\":\"Tcp\",\"backendPort\":505799405},{\"transportProtocol\":\"Tcp\",\"backendPort\":21918595}]},\"virtualNetworkPoolName\":\"oqza\"}") .toObject(SubnetOverride.class); - Assertions.assertEquals("q", model.resourceId()); - Assertions.assertEquals("izxqltgrd", model.labSubnetName()); - Assertions.assertEquals(UsagePermissionType.DENY, model.useInVmCreationPermission()); - Assertions.assertEquals(UsagePermissionType.DEFAULT, model.usePublicIpAddressPermission()); - Assertions.assertEquals(TransportProtocol.TCP, + Assertions.assertEquals("cqtjzmi", model.resourceId()); + Assertions.assertEquals("gbgatzuuvbxn", model.labSubnetName()); + Assertions.assertEquals(UsagePermissionType.DEFAULT, model.useInVmCreationPermission()); + Assertions.assertEquals(UsagePermissionType.DENY, model.usePublicIpAddressPermission()); + Assertions.assertEquals(TransportProtocol.UDP, model.sharedPublicIpAddressConfiguration().allowedPorts().get(0).transportProtocol()); - Assertions.assertEquals(47041637, + Assertions.assertEquals(80766571, model.sharedPublicIpAddressConfiguration().allowedPorts().get(0).backendPort()); - Assertions.assertEquals("blml", model.virtualNetworkPoolName()); + Assertions.assertEquals("oqza", model.virtualNetworkPoolName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SubnetOverride model = new SubnetOverride().withResourceId("q") - .withLabSubnetName("izxqltgrd") - .withUseInVmCreationPermission(UsagePermissionType.DENY) - .withUsePublicIpAddressPermission(UsagePermissionType.DEFAULT) + SubnetOverride model = new SubnetOverride().withResourceId("cqtjzmi") + .withLabSubnetName("gbgatzuuvbxn") + .withUseInVmCreationPermission(UsagePermissionType.DEFAULT) + .withUsePublicIpAddressPermission(UsagePermissionType.DENY) .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration().withAllowedPorts( - Arrays.asList(new Port().withTransportProtocol(TransportProtocol.TCP).withBackendPort(47041637), - new Port().withTransportProtocol(TransportProtocol.TCP).withBackendPort(2094013650), - new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(875349489), - new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(1159894455)))) - .withVirtualNetworkPoolName("blml"); + Arrays.asList(new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(80766571), + new Port().withTransportProtocol(TransportProtocol.TCP).withBackendPort(89954897), + new Port().withTransportProtocol(TransportProtocol.TCP).withBackendPort(505799405), + new Port().withTransportProtocol(TransportProtocol.TCP).withBackendPort(21918595)))) + .withVirtualNetworkPoolName("oqza"); model = BinaryData.fromObject(model).toObject(SubnetOverride.class); - Assertions.assertEquals("q", model.resourceId()); - Assertions.assertEquals("izxqltgrd", model.labSubnetName()); - Assertions.assertEquals(UsagePermissionType.DENY, model.useInVmCreationPermission()); - Assertions.assertEquals(UsagePermissionType.DEFAULT, model.usePublicIpAddressPermission()); - Assertions.assertEquals(TransportProtocol.TCP, + Assertions.assertEquals("cqtjzmi", model.resourceId()); + Assertions.assertEquals("gbgatzuuvbxn", model.labSubnetName()); + Assertions.assertEquals(UsagePermissionType.DEFAULT, model.useInVmCreationPermission()); + Assertions.assertEquals(UsagePermissionType.DENY, model.usePublicIpAddressPermission()); + Assertions.assertEquals(TransportProtocol.UDP, model.sharedPublicIpAddressConfiguration().allowedPorts().get(0).transportProtocol()); - Assertions.assertEquals(47041637, + Assertions.assertEquals(80766571, model.sharedPublicIpAddressConfiguration().allowedPorts().get(0).backendPort()); - Assertions.assertEquals("blml", model.virtualNetworkPoolName()); + Assertions.assertEquals("oqza", model.virtualNetworkPoolName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SubnetSharedPublicIpAddressConfigurationTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SubnetSharedPublicIpAddressConfigurationTests.java index 1a9fc8456e64..6330b3a83c21 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SubnetSharedPublicIpAddressConfigurationTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SubnetSharedPublicIpAddressConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -15,20 +15,21 @@ public final class SubnetSharedPublicIpAddressConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SubnetSharedPublicIpAddressConfiguration model = BinaryData.fromString( - "{\"allowedPorts\":[{\"transportProtocol\":\"Udp\",\"backendPort\":1319448407},{\"transportProtocol\":\"Tcp\",\"backendPort\":510914114}]}") + "{\"allowedPorts\":[{\"transportProtocol\":\"Udp\",\"backendPort\":56130603},{\"transportProtocol\":\"Udp\",\"backendPort\":1325861639},{\"transportProtocol\":\"Udp\",\"backendPort\":1577962880}]}") .toObject(SubnetSharedPublicIpAddressConfiguration.class); Assertions.assertEquals(TransportProtocol.UDP, model.allowedPorts().get(0).transportProtocol()); - Assertions.assertEquals(1319448407, model.allowedPorts().get(0).backendPort()); + Assertions.assertEquals(56130603, model.allowedPorts().get(0).backendPort()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SubnetSharedPublicIpAddressConfiguration model = new SubnetSharedPublicIpAddressConfiguration().withAllowedPorts( - Arrays.asList(new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(1319448407), - new Port().withTransportProtocol(TransportProtocol.TCP).withBackendPort(510914114))); + Arrays.asList(new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(56130603), + new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(1325861639), + new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(1577962880))); model = BinaryData.fromObject(model).toObject(SubnetSharedPublicIpAddressConfiguration.class); Assertions.assertEquals(TransportProtocol.UDP, model.allowedPorts().get(0).transportProtocol()); - Assertions.assertEquals(1319448407, model.allowedPorts().get(0).backendPort()); + Assertions.assertEquals(56130603, model.allowedPorts().get(0).backendPort()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SubnetTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SubnetTests.java index 04514e77e838..7b0e4946a958 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SubnetTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/SubnetTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,21 +13,22 @@ public final class SubnetTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Subnet model = BinaryData - .fromString("{\"resourceId\":\"p\",\"labSubnetName\":\"aurkihcirlde\",\"allowPublicIp\":\"Allow\"}") + .fromString( + "{\"resourceId\":\"zdcgdzbenr\",\"labSubnetName\":\"cawetzqddt\",\"allowPublicIp\":\"Default\"}") .toObject(Subnet.class); - Assertions.assertEquals("p", model.resourceId()); - Assertions.assertEquals("aurkihcirlde", model.labSubnetName()); - Assertions.assertEquals(UsagePermissionType.ALLOW, model.allowPublicIp()); + Assertions.assertEquals("zdcgdzbenr", model.resourceId()); + Assertions.assertEquals("cawetzqddt", model.labSubnetName()); + Assertions.assertEquals(UsagePermissionType.DEFAULT, model.allowPublicIp()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Subnet model = new Subnet().withResourceId("p") - .withLabSubnetName("aurkihcirlde") - .withAllowPublicIp(UsagePermissionType.ALLOW); + Subnet model = new Subnet().withResourceId("zdcgdzbenr") + .withLabSubnetName("cawetzqddt") + .withAllowPublicIp(UsagePermissionType.DEFAULT); model = BinaryData.fromObject(model).toObject(Subnet.class); - Assertions.assertEquals("p", model.resourceId()); - Assertions.assertEquals("aurkihcirlde", model.labSubnetName()); - Assertions.assertEquals(UsagePermissionType.ALLOW, model.allowPublicIp()); + Assertions.assertEquals("zdcgdzbenr", model.resourceId()); + Assertions.assertEquals("cawetzqddt", model.labSubnetName()); + Assertions.assertEquals(UsagePermissionType.DEFAULT, model.allowPublicIp()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/TargetCostPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/TargetCostPropertiesTests.java index 1c375f9f68e2..e854bdbc48df 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/TargetCostPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/TargetCostPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -19,66 +19,66 @@ public final class TargetCostPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TargetCostProperties model = BinaryData.fromString( - "{\"status\":\"Disabled\",\"target\":1344310513,\"costThresholds\":[{\"thresholdId\":\"la\",\"percentageThreshold\":{\"thresholdValue\":29.81065633031904},\"displayOnChart\":\"Enabled\",\"sendNotificationWhenExceeded\":\"Disabled\",\"notificationSent\":\"cjzkzivgvvcna\"},{\"thresholdId\":\"hyrnxxmu\",\"percentageThreshold\":{\"thresholdValue\":62.06745829119037},\"displayOnChart\":\"Enabled\",\"sendNotificationWhenExceeded\":\"Disabled\",\"notificationSent\":\"kwqqtchealmf\"},{\"thresholdId\":\"d\",\"percentageThreshold\":{\"thresholdValue\":15.999817064386267},\"displayOnChart\":\"Enabled\",\"sendNotificationWhenExceeded\":\"Disabled\",\"notificationSent\":\"iohgwxrtfud\"},{\"thresholdId\":\"pxgy\",\"percentageThreshold\":{\"thresholdValue\":80.3374408852527},\"displayOnChart\":\"Disabled\",\"sendNotificationWhenExceeded\":\"Enabled\",\"notificationSent\":\"ukghimdblxgw\"}],\"cycleStartDateTime\":\"2021-09-01T10:58:30Z\",\"cycleEndDateTime\":\"2021-07-20T17:44:37Z\",\"cycleType\":\"CalendarMonth\"}") + "{\"status\":\"Enabled\",\"target\":2091376747,\"costThresholds\":[{\"thresholdId\":\"njv\",\"percentageThreshold\":{\"thresholdValue\":91.33882572687003},\"displayOnChart\":\"Enabled\",\"sendNotificationWhenExceeded\":\"Disabled\",\"notificationSent\":\"tn\"},{\"thresholdId\":\"tjsyin\",\"percentageThreshold\":{\"thresholdValue\":72.66719590976471},\"displayOnChart\":\"Enabled\",\"sendNotificationWhenExceeded\":\"Disabled\",\"notificationSent\":\"tmdvypgikdgs\"},{\"thresholdId\":\"w\",\"percentageThreshold\":{\"thresholdValue\":67.4392525862231},\"displayOnChart\":\"Disabled\",\"sendNotificationWhenExceeded\":\"Disabled\",\"notificationSent\":\"hkjoqr\"},{\"thresholdId\":\"qaatjinrv\",\"percentageThreshold\":{\"thresholdValue\":19.63974168753351},\"displayOnChart\":\"Enabled\",\"sendNotificationWhenExceeded\":\"Disabled\",\"notificationSent\":\"ggjioolvr\"}],\"cycleStartDateTime\":\"2021-01-31T00:57:49Z\",\"cycleEndDateTime\":\"2021-10-02T02:42:21Z\",\"cycleType\":\"CalendarMonth\"}") .toObject(TargetCostProperties.class); - Assertions.assertEquals(TargetCostStatus.DISABLED, model.status()); - Assertions.assertEquals(1344310513, model.target()); - Assertions.assertEquals("la", model.costThresholds().get(0).thresholdId()); - Assertions.assertEquals(29.81065633031904D, + Assertions.assertEquals(TargetCostStatus.ENABLED, model.status()); + Assertions.assertEquals(2091376747, model.target()); + Assertions.assertEquals("njv", model.costThresholds().get(0).thresholdId()); + Assertions.assertEquals(91.33882572687003D, model.costThresholds().get(0).percentageThreshold().thresholdValue()); Assertions.assertEquals(CostThresholdStatus.ENABLED, model.costThresholds().get(0).displayOnChart()); Assertions.assertEquals(CostThresholdStatus.DISABLED, model.costThresholds().get(0).sendNotificationWhenExceeded()); - Assertions.assertEquals("cjzkzivgvvcna", model.costThresholds().get(0).notificationSent()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-01T10:58:30Z"), model.cycleStartDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T17:44:37Z"), model.cycleEndDateTime()); + Assertions.assertEquals("tn", model.costThresholds().get(0).notificationSent()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T00:57:49Z"), model.cycleStartDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-02T02:42:21Z"), model.cycleEndDateTime()); Assertions.assertEquals(ReportingCycleType.CALENDAR_MONTH, model.cycleType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TargetCostProperties model = new TargetCostProperties().withStatus(TargetCostStatus.DISABLED) - .withTarget(1344310513) + TargetCostProperties model = new TargetCostProperties().withStatus(TargetCostStatus.ENABLED) + .withTarget(2091376747) .withCostThresholds(Arrays.asList( - new CostThresholdProperties().withThresholdId("la") + new CostThresholdProperties().withThresholdId("njv") .withPercentageThreshold( - new PercentageCostThresholdProperties().withThresholdValue(29.81065633031904D)) + new PercentageCostThresholdProperties().withThresholdValue(91.33882572687003D)) .withDisplayOnChart(CostThresholdStatus.ENABLED) .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED) - .withNotificationSent("cjzkzivgvvcna"), - new CostThresholdProperties().withThresholdId("hyrnxxmu") + .withNotificationSent("tn"), + new CostThresholdProperties().withThresholdId("tjsyin") .withPercentageThreshold( - new PercentageCostThresholdProperties().withThresholdValue(62.06745829119037D)) + new PercentageCostThresholdProperties().withThresholdValue(72.66719590976471D)) .withDisplayOnChart(CostThresholdStatus.ENABLED) .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED) - .withNotificationSent("kwqqtchealmf"), - new CostThresholdProperties().withThresholdId("d") + .withNotificationSent("tmdvypgikdgs"), + new CostThresholdProperties().withThresholdId("w") .withPercentageThreshold( - new PercentageCostThresholdProperties().withThresholdValue(15.999817064386267D)) - .withDisplayOnChart(CostThresholdStatus.ENABLED) + new PercentageCostThresholdProperties().withThresholdValue(67.4392525862231D)) + .withDisplayOnChart(CostThresholdStatus.DISABLED) .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED) - .withNotificationSent("iohgwxrtfud"), - new CostThresholdProperties().withThresholdId("pxgy") + .withNotificationSent("hkjoqr"), + new CostThresholdProperties().withThresholdId("qaatjinrv") .withPercentageThreshold( - new PercentageCostThresholdProperties().withThresholdValue(80.3374408852527D)) - .withDisplayOnChart(CostThresholdStatus.DISABLED) - .withSendNotificationWhenExceeded(CostThresholdStatus.ENABLED) - .withNotificationSent("ukghimdblxgw"))) - .withCycleStartDateTime(OffsetDateTime.parse("2021-09-01T10:58:30Z")) - .withCycleEndDateTime(OffsetDateTime.parse("2021-07-20T17:44:37Z")) + new PercentageCostThresholdProperties().withThresholdValue(19.63974168753351D)) + .withDisplayOnChart(CostThresholdStatus.ENABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED) + .withNotificationSent("ggjioolvr"))) + .withCycleStartDateTime(OffsetDateTime.parse("2021-01-31T00:57:49Z")) + .withCycleEndDateTime(OffsetDateTime.parse("2021-10-02T02:42:21Z")) .withCycleType(ReportingCycleType.CALENDAR_MONTH); model = BinaryData.fromObject(model).toObject(TargetCostProperties.class); - Assertions.assertEquals(TargetCostStatus.DISABLED, model.status()); - Assertions.assertEquals(1344310513, model.target()); - Assertions.assertEquals("la", model.costThresholds().get(0).thresholdId()); - Assertions.assertEquals(29.81065633031904D, + Assertions.assertEquals(TargetCostStatus.ENABLED, model.status()); + Assertions.assertEquals(2091376747, model.target()); + Assertions.assertEquals("njv", model.costThresholds().get(0).thresholdId()); + Assertions.assertEquals(91.33882572687003D, model.costThresholds().get(0).percentageThreshold().thresholdValue()); Assertions.assertEquals(CostThresholdStatus.ENABLED, model.costThresholds().get(0).displayOnChart()); Assertions.assertEquals(CostThresholdStatus.DISABLED, model.costThresholds().get(0).sendNotificationWhenExceeded()); - Assertions.assertEquals("cjzkzivgvvcna", model.costThresholds().get(0).notificationSent()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-01T10:58:30Z"), model.cycleStartDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T17:44:37Z"), model.cycleEndDateTime()); + Assertions.assertEquals("tn", model.costThresholds().get(0).notificationSent()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T00:57:49Z"), model.cycleStartDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-02T02:42:21Z"), model.cycleEndDateTime()); Assertions.assertEquals(ReportingCycleType.CALENDAR_MONTH, model.cycleType()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UpdateResourceTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UpdateResourceTests.java index 53dc67436a2b..096e0169482e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UpdateResourceTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UpdateResourceTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,16 +13,18 @@ public final class UpdateResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UpdateResource model = BinaryData.fromString("{\"tags\":{\"railvpnppfuf\":\"acffgdkzzewkfvhq\"}}") - .toObject(UpdateResource.class); - Assertions.assertEquals("acffgdkzzewkfvhq", model.tags().get("railvpnppfuf")); + UpdateResource model + = BinaryData.fromString("{\"tags\":{\"dnrujqguhmuouqfp\":\"jvtbvpyss\",\"uizga\":\"wzwbnguitn\"}}") + .toObject(UpdateResource.class); + Assertions.assertEquals("jvtbvpyss", model.tags().get("dnrujqguhmuouqfp")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UpdateResource model = new UpdateResource().withTags(mapOf("railvpnppfuf", "acffgdkzzewkfvhq")); + UpdateResource model + = new UpdateResource().withTags(mapOf("dnrujqguhmuouqfp", "jvtbvpyss", "uizga", "wzwbnguitn")); model = BinaryData.fromObject(model).toObject(UpdateResource.class); - Assertions.assertEquals("acffgdkzzewkfvhq", model.tags().get("railvpnppfuf")); + Assertions.assertEquals("jvtbvpyss", model.tags().get("dnrujqguhmuouqfp")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UserFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UserFragmentTests.java index e66a871bb60c..053d8df7f41c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UserFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UserFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,18 +13,18 @@ public final class UserFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserFragment model = BinaryData - .fromString("{\"tags\":{\"cxfhbcporxv\":\"djhlimm\",\"xfpxtgqscja\":\"cjzhqi\",\"qaz\":\"ftjuh\"}}") + UserFragment model = BinaryData.fromString( + "{\"tags\":{\"hk\":\"dhttzaefedxihchr\",\"ylkdghrje\":\"crjdqnsdfzpbgtg\",\"bwnhhtql\":\"utlwxezwzhok\",\"pifhpfeoajvgcxtx\":\"ehgpp\"}}") .toObject(UserFragment.class); - Assertions.assertEquals("djhlimm", model.tags().get("cxfhbcporxv")); + Assertions.assertEquals("dhttzaefedxihchr", model.tags().get("hk")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UserFragment model - = new UserFragment().withTags(mapOf("cxfhbcporxv", "djhlimm", "xfpxtgqscja", "cjzhqi", "qaz", "ftjuh")); + UserFragment model = new UserFragment().withTags(mapOf("hk", "dhttzaefedxihchr", "ylkdghrje", "crjdqnsdfzpbgtg", + "bwnhhtql", "utlwxezwzhok", "pifhpfeoajvgcxtx", "ehgpp")); model = BinaryData.fromObject(model).toObject(UserFragment.class); - Assertions.assertEquals("djhlimm", model.tags().get("cxfhbcporxv")); + Assertions.assertEquals("dhttzaefedxihchr", model.tags().get("hk")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UserIdentityTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UserIdentityTests.java index a10807ed8d51..84657a80f5a1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UserIdentityTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UserIdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -12,27 +12,27 @@ public final class UserIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UserIdentity model = BinaryData.fromString( - "{\"principalName\":\"weazul\",\"principalId\":\"ethwwnpjhlfz\",\"tenantId\":\"pchwa\",\"objectId\":\"bousn\",\"appId\":\"pgfewetwlyx\"}") + "{\"principalName\":\"kjq\",\"principalId\":\"broyla\",\"tenantId\":\"ulcdisdosf\",\"objectId\":\"jsvg\",\"appId\":\"whryvycytdcl\"}") .toObject(UserIdentity.class); - Assertions.assertEquals("weazul", model.principalName()); - Assertions.assertEquals("ethwwnpjhlfz", model.principalId()); - Assertions.assertEquals("pchwa", model.tenantId()); - Assertions.assertEquals("bousn", model.objectId()); - Assertions.assertEquals("pgfewetwlyx", model.appId()); + Assertions.assertEquals("kjq", model.principalName()); + Assertions.assertEquals("broyla", model.principalId()); + Assertions.assertEquals("ulcdisdosf", model.tenantId()); + Assertions.assertEquals("jsvg", model.objectId()); + Assertions.assertEquals("whryvycytdcl", model.appId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UserIdentity model = new UserIdentity().withPrincipalName("weazul") - .withPrincipalId("ethwwnpjhlfz") - .withTenantId("pchwa") - .withObjectId("bousn") - .withAppId("pgfewetwlyx"); + UserIdentity model = new UserIdentity().withPrincipalName("kjq") + .withPrincipalId("broyla") + .withTenantId("ulcdisdosf") + .withObjectId("jsvg") + .withAppId("whryvycytdcl"); model = BinaryData.fromObject(model).toObject(UserIdentity.class); - Assertions.assertEquals("weazul", model.principalName()); - Assertions.assertEquals("ethwwnpjhlfz", model.principalId()); - Assertions.assertEquals("pchwa", model.tenantId()); - Assertions.assertEquals("bousn", model.objectId()); - Assertions.assertEquals("pgfewetwlyx", model.appId()); + Assertions.assertEquals("kjq", model.principalName()); + Assertions.assertEquals("broyla", model.principalId()); + Assertions.assertEquals("ulcdisdosf", model.tenantId()); + Assertions.assertEquals("jsvg", model.objectId()); + Assertions.assertEquals("whryvycytdcl", model.appId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteMockTests.java index ff8c1b907314..dcca4cab3adf 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.users().delete("qelwgdhuruzytza", "ogatmoljiy", "mpinmzvfkneerzzt", com.azure.core.util.Context.NONE); + manager.users().delete("sq", "zihqod", "qgcnbhcbmjk", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateWithResponseMockTests.java index 1aa273061883..a893fadde55a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; @@ -30,51 +30,50 @@ public final class VirtualMachineSchedulesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"lsmal\",\"weeklyRecurrence\":{\"weekdays\":[\"oykdno\",\"aaxwmgzr\",\"jlqcwny\",\"lleiq\"],\"time\":\"bgvsbtsertoxadh\"},\"dailyRecurrence\":{\"time\":\"jhxmnrqst\"},\"hourlyRecurrence\":{\"minute\":614665740},\"timeZoneId\":\"wmlgicvnpv\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1878403795,\"webhookUrl\":\"q\",\"emailRecipient\":\"i\",\"notificationLocale\":\"lzmvcdsvmwbi\"},\"createdDate\":\"2021-04-08T06:02:18Z\",\"targetResourceId\":\"tfo\",\"provisioningState\":\"fiybxqich\",\"uniqueIdentifier\":\"bfzdqekiv\"},\"location\":\"cpzcvdizul\",\"tags\":{\"mdutzfk\":\"bhtrezpzlpryfm\",\"oudccgndjg\":\"il\",\"qyeqfcbuulpyuflq\":\"prigg\",\"ujcyohigimwdc\":\"fsh\"},\"id\":\"klkqnqvkixnmb\",\"name\":\"mecuyrzwim\",\"type\":\"zayspzvriet\"}"; + = "{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"hlwyjfnqzocrd\",\"weeklyRecurrence\":{\"weekdays\":[\"euntgxdncaqtti\",\"koifuvnyttz\"],\"time\":\"xgyrihlgmgbehlqt\"},\"dailyRecurrence\":{\"time\":\"flkn\"},\"hourlyRecurrence\":{\"minute\":629792827},\"timeZoneId\":\"gfjo\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1169131296,\"webhookUrl\":\"wfhipxwgsab\",\"emailRecipient\":\"ipowza\",\"notificationLocale\":\"zuu\"},\"createdDate\":\"2021-07-21T15:21:41Z\",\"targetResourceId\":\"irvpefycdve\",\"provisioningState\":\"itjn\",\"uniqueIdentifier\":\"zaj\"},\"tags\":{\"xqvmvuay\":\"jhwjuyxx\",\"xeqbwp\":\"uadx\",\"xsl\":\"tghyksarcdr\"},\"location\":\"lzladltxkpbqh\",\"id\":\"dqqjwkrhwzdano\",\"name\":\"isgglmvokat\",\"type\":\"ztjctibpvbkae\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Schedule response = manager.virtualMachineSchedules() - .createOrUpdateWithResponse("pjyyqmkwlhvc", "loqd", "jk", "uxxrwzobuzms", - new ScheduleInner().withLocation("sm") - .withTags(mapOf("pxtokljmtznp", "uq", "ungbsoljc", "xwfqtyyqiprcl")) - .withStatus(EnableStatus.ENABLED) - .withTaskType("tdtkwppthuz") + .createOrUpdateWithResponse("acdhztxkbr", "g", "rwjiyew", "fj", + new ScheduleInner().withTags(mapOf("pv", "uvrzmzqmzjqrb", "pglaoh", "mdyfoebojtj", "jtnqjil", "qk")) + .withLocation("wkdcwmqs") + .withStatus(EnableStatus.DISABLED) + .withTaskType("rxetfgcwvrrmdqn") .withWeeklyRecurrence( - new WeekDetails().withWeekdays(Arrays.asList("imrljdp", "qfxy", "mhk", "tbaewhte")) - .withTime("oamfmxtllfltymqc")) - .withDailyRecurrence(new DayDetails().withTime("fijhgga")) - .withHourlyRecurrence(new HourDetails().withMinute(858190947)) - .withTimeZoneId("mkli") - .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.DISABLED) - .withTimeInMinutes(1220311983) - .withWebhookUrl("fhsdpzouhkt") - .withEmailRecipient("xqwqnjxr") - .withNotificationLocale("ddtullygta")) - .withTargetResourceId("xdfweapyf"), + new WeekDetails().withWeekdays(Arrays.asList("awthvmaxgnu", "eamc")).withTime("udf")) + .withDailyRecurrence(new DayDetails().withTime("ehok")) + .withHourlyRecurrence(new HourDetails().withMinute(1815369275)) + .withTimeZoneId("wloesqrggvrbn") + .withNotificationSettings(new NotificationSettings().withStatus(EnableStatus.ENABLED) + .withTimeInMinutes(952181677) + .withWebhookUrl("aciduwjleip") + .withEmailRecipient("h") + .withNotificationLocale("xpzruzythqkk")) + .withTargetResourceId("xvellvulnxdmni"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("cpzcvdizul", response.location()); - Assertions.assertEquals("bhtrezpzlpryfm", response.tags().get("mdutzfk")); - Assertions.assertEquals(EnableStatus.DISABLED, response.status()); - Assertions.assertEquals("lsmal", response.taskType()); - Assertions.assertEquals("oykdno", response.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("bgvsbtsertoxadh", response.weeklyRecurrence().time()); - Assertions.assertEquals("jhxmnrqst", response.dailyRecurrence().time()); - Assertions.assertEquals(614665740, response.hourlyRecurrence().minute()); - Assertions.assertEquals("wmlgicvnpv", response.timeZoneId()); + Assertions.assertEquals("jhwjuyxx", response.tags().get("xqvmvuay")); + Assertions.assertEquals("lzladltxkpbqh", response.location()); + Assertions.assertEquals(EnableStatus.ENABLED, response.status()); + Assertions.assertEquals("hlwyjfnqzocrd", response.taskType()); + Assertions.assertEquals("euntgxdncaqtti", response.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("xgyrihlgmgbehlqt", response.weeklyRecurrence().time()); + Assertions.assertEquals("flkn", response.dailyRecurrence().time()); + Assertions.assertEquals(629792827, response.hourlyRecurrence().minute()); + Assertions.assertEquals("gfjo", response.timeZoneId()); Assertions.assertEquals(EnableStatus.DISABLED, response.notificationSettings().status()); - Assertions.assertEquals(1878403795, response.notificationSettings().timeInMinutes()); - Assertions.assertEquals("q", response.notificationSettings().webhookUrl()); - Assertions.assertEquals("i", response.notificationSettings().emailRecipient()); - Assertions.assertEquals("lzmvcdsvmwbi", response.notificationSettings().notificationLocale()); - Assertions.assertEquals("tfo", response.targetResourceId()); + Assertions.assertEquals(1169131296, response.notificationSettings().timeInMinutes()); + Assertions.assertEquals("wfhipxwgsab", response.notificationSettings().webhookUrl()); + Assertions.assertEquals("ipowza", response.notificationSettings().emailRecipient()); + Assertions.assertEquals("zuu", response.notificationSettings().notificationLocale()); + Assertions.assertEquals("irvpefycdve", response.targetResourceId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteWithResponseMockTests.java index dc29ee29f29e..561bec71a63f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachineSchedules() - .deleteWithResponse("fphmdzxplg", "pvdvatlzmgs", "hnzrsbkkzovlzdm", "fmfws", + .deleteWithResponse("jdusspyszekb", "wlkaaggkrehbfrnu", "bffljfiimreoag", "qtaadusrexxfavsq", com.azure.core.util.Context.NONE); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteMockTests.java index 00b3f6e62e88..d0e79366cb8c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testExecute() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachineSchedules() - .execute("cuxd", "zcqipsdudgcozzo", "ehxlantolamlb", "juxkqll", com.azure.core.util.Context.NONE); + .execute("pak", "ozkxbzrpejplss", "nbtttkgsuxu", "rswgkpjhboyikeb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetWithResponseMockTests.java index e105a156d4e8..0152c15d6d2d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -22,33 +22,34 @@ public final class VirtualMachineSchedulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"drbzyvbsuadu\",\"weeklyRecurrence\":{\"weekdays\":[\"kaxpfobkzhmh\",\"dqltdel\",\"qrojadhfztlray\",\"rkgzkyhudbkuw\"],\"time\":\"qxlcweakfecjvx\"},\"dailyRecurrence\":{\"time\":\"ufqizjvppw\"},\"hourlyRecurrence\":{\"minute\":1169232716},\"timeZoneId\":\"yyjmjjxiz\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":635730395,\"webhookUrl\":\"slekc\",\"emailRecipient\":\"gzkj\",\"notificationLocale\":\"qpdwad\"},\"createdDate\":\"2021-10-22T19:54:36Z\",\"targetResourceId\":\"tldsvczdjiahuq\",\"provisioningState\":\"jzucwwm\",\"uniqueIdentifier\":\"jqhddwvmqxiyoo\"},\"location\":\"yfozkbnzxbypfqp\",\"tags\":{\"wqikwepwogggic\":\"xwrgrkkderfr\",\"cqbsudzpgchzpg\":\"nxhtf\"},\"id\":\"qumjdjxhzghgod\",\"name\":\"ynrceqavfdbdf\",\"type\":\"mxjdnaju\"}"; + = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"qagywvtxig\",\"weeklyRecurrence\":{\"weekdays\":[\"tpgaeukya\",\"ohpmwhqn\",\"csklhsidsjt\",\"lpbnin\"],\"time\":\"azlsvbzfcpuo\"},\"dailyRecurrence\":{\"time\":\"wjcciklhsy\"},\"hourlyRecurrence\":{\"minute\":1785872174},\"timeZoneId\":\"enxolr\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1746488181,\"webhookUrl\":\"iv\",\"emailRecipient\":\"hydwbdbfgrlp\",\"notificationLocale\":\"ytjlkesmmpath\"},\"createdDate\":\"2021-06-18T16:13:03Z\",\"targetResourceId\":\"h\",\"provisioningState\":\"an\",\"uniqueIdentifier\":\"wllbv\"},\"tags\":{\"vaqogfkbebauzl\":\"sfftedousnktjtgr\",\"tpzkgmeboywhcz\":\"btxxwpfhnjzud\"},\"location\":\"rhmngqbedy\",\"id\":\"s\",\"name\":\"zwnykdidjchl\",\"type\":\"mpwctoflds\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Schedule response = manager.virtualMachineSchedules() - .getWithResponse("abenqlamwmg", "way", "f", "nbcpjstbhemhcucs", "snxfbxu", com.azure.core.util.Context.NONE) + .getWithResponse("wwa", "ecleqioulndhzyo", "ojhtollhs", "idmytzln", "lxpnovyoanf", + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("yfozkbnzxbypfqp", response.location()); - Assertions.assertEquals("xwrgrkkderfr", response.tags().get("wqikwepwogggic")); + Assertions.assertEquals("sfftedousnktjtgr", response.tags().get("vaqogfkbebauzl")); + Assertions.assertEquals("rhmngqbedy", response.location()); Assertions.assertEquals(EnableStatus.DISABLED, response.status()); - Assertions.assertEquals("drbzyvbsuadu", response.taskType()); - Assertions.assertEquals("kaxpfobkzhmh", response.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("qxlcweakfecjvx", response.weeklyRecurrence().time()); - Assertions.assertEquals("ufqizjvppw", response.dailyRecurrence().time()); - Assertions.assertEquals(1169232716, response.hourlyRecurrence().minute()); - Assertions.assertEquals("yyjmjjxiz", response.timeZoneId()); - Assertions.assertEquals(EnableStatus.DISABLED, response.notificationSettings().status()); - Assertions.assertEquals(635730395, response.notificationSettings().timeInMinutes()); - Assertions.assertEquals("slekc", response.notificationSettings().webhookUrl()); - Assertions.assertEquals("gzkj", response.notificationSettings().emailRecipient()); - Assertions.assertEquals("qpdwad", response.notificationSettings().notificationLocale()); - Assertions.assertEquals("tldsvczdjiahuq", response.targetResourceId()); + Assertions.assertEquals("qagywvtxig", response.taskType()); + Assertions.assertEquals("tpgaeukya", response.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("azlsvbzfcpuo", response.weeklyRecurrence().time()); + Assertions.assertEquals("wjcciklhsy", response.dailyRecurrence().time()); + Assertions.assertEquals(1785872174, response.hourlyRecurrence().minute()); + Assertions.assertEquals("enxolr", response.timeZoneId()); + Assertions.assertEquals(EnableStatus.ENABLED, response.notificationSettings().status()); + Assertions.assertEquals(1746488181, response.notificationSettings().timeInMinutes()); + Assertions.assertEquals("iv", response.notificationSettings().webhookUrl()); + Assertions.assertEquals("hydwbdbfgrlp", response.notificationSettings().emailRecipient()); + Assertions.assertEquals("ytjlkesmmpath", response.notificationSettings().notificationLocale()); + Assertions.assertEquals("h", response.targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListMockTests.java index d18d797e7247..517aedb83fef 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -23,33 +23,33 @@ public final class VirtualMachineSchedulesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"tbspvkhglaqjs\",\"weeklyRecurrence\":{\"weekdays\":[\"tujrzxrkn\",\"fdrld\",\"yehi\",\"ittugyu\"],\"time\":\"rldaxurfqa\"},\"dailyRecurrence\":{\"time\":\"ozjv\"},\"hourlyRecurrence\":{\"minute\":662238435},\"timeZoneId\":\"ggbnvtxo\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":208696047,\"webhookUrl\":\"whoea\",\"emailRecipient\":\"e\",\"notificationLocale\":\"doey\"},\"createdDate\":\"2021-04-03T18:48:17Z\",\"targetResourceId\":\"imtwuuhau\",\"provisioningState\":\"nkwmnfeub\",\"uniqueIdentifier\":\"jyrkwfug\"},\"location\":\"phrrkuum\",\"tags\":{\"pue\":\"urhzzf\",\"ttoztj\":\"qusvwlujopwnib\",\"ctxegt\":\"qumqvfmwcaddt\",\"elfnzzryiz\":\"gwyur\"},\"id\":\"bxgde\",\"name\":\"xlayunomir\",\"type\":\"p\"}]}"; + = "{\"value\":[{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"wwmhkruwae\",\"weeklyRecurrence\":{\"weekdays\":[\"pmlqoinhzduew\",\"hapfjiik\"],\"time\":\"diqfliejhpclbi\"},\"dailyRecurrence\":{\"time\":\"sbw\"},\"hourlyRecurrence\":{\"minute\":609657457},\"timeZoneId\":\"vzipbwxgo\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":544919003,\"webhookUrl\":\"dmskxknpdgzigjsu\",\"emailRecipient\":\"whgsaodkww\",\"notificationLocale\":\"afoctohz\"},\"createdDate\":\"2021-08-05T04:27:02Z\",\"targetResourceId\":\"v\",\"provisioningState\":\"xbg\",\"uniqueIdentifier\":\"kerv\"},\"tags\":{\"spabdsrgfa\":\"oadhrsxqvz\",\"bklrxh\":\"glzrs\",\"jdvqy\":\"nltce\"},\"location\":\"eqq\",\"id\":\"aruwdxvqzxoebw\",\"name\":\"jxbibanb\",\"type\":\"upwtz\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.virtualMachineSchedules() - .list("icqqw", "v", "wkslvlized", "biabvnsrgekz", "qx", 1170425933, "yfhbmwkh", + .list("udo", "zilfmnlikps", "msfeypofqpm", "hyqgsdrmmttjx", "phgerhsmvgoh", 576100602, "zmqilrixysfnim", com.azure.core.util.Context.NONE); - Assertions.assertEquals("phrrkuum", response.iterator().next().location()); - Assertions.assertEquals("urhzzf", response.iterator().next().tags().get("pue")); - Assertions.assertEquals(EnableStatus.DISABLED, response.iterator().next().status()); - Assertions.assertEquals("tbspvkhglaqjs", response.iterator().next().taskType()); - Assertions.assertEquals("tujrzxrkn", response.iterator().next().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("rldaxurfqa", response.iterator().next().weeklyRecurrence().time()); - Assertions.assertEquals("ozjv", response.iterator().next().dailyRecurrence().time()); - Assertions.assertEquals(662238435, response.iterator().next().hourlyRecurrence().minute()); - Assertions.assertEquals("ggbnvtxo", response.iterator().next().timeZoneId()); + Assertions.assertEquals("oadhrsxqvz", response.iterator().next().tags().get("spabdsrgfa")); + Assertions.assertEquals("eqq", response.iterator().next().location()); + Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().status()); + Assertions.assertEquals("wwmhkruwae", response.iterator().next().taskType()); + Assertions.assertEquals("pmlqoinhzduew", response.iterator().next().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("diqfliejhpclbi", response.iterator().next().weeklyRecurrence().time()); + Assertions.assertEquals("sbw", response.iterator().next().dailyRecurrence().time()); + Assertions.assertEquals(609657457, response.iterator().next().hourlyRecurrence().minute()); + Assertions.assertEquals("vzipbwxgo", response.iterator().next().timeZoneId()); Assertions.assertEquals(EnableStatus.ENABLED, response.iterator().next().notificationSettings().status()); - Assertions.assertEquals(208696047, response.iterator().next().notificationSettings().timeInMinutes()); - Assertions.assertEquals("whoea", response.iterator().next().notificationSettings().webhookUrl()); - Assertions.assertEquals("e", response.iterator().next().notificationSettings().emailRecipient()); - Assertions.assertEquals("doey", response.iterator().next().notificationSettings().notificationLocale()); - Assertions.assertEquals("imtwuuhau", response.iterator().next().targetResourceId()); + Assertions.assertEquals(544919003, response.iterator().next().notificationSettings().timeInMinutes()); + Assertions.assertEquals("dmskxknpdgzigjsu", response.iterator().next().notificationSettings().webhookUrl()); + Assertions.assertEquals("whgsaodkww", response.iterator().next().notificationSettings().emailRecipient()); + Assertions.assertEquals("afoctohz", response.iterator().next().notificationSettings().notificationLocale()); + Assertions.assertEquals("v", response.iterator().next().targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateWithResponseMockTests.java index 54c054cceeb0..1da30e9e8fdc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -25,37 +25,37 @@ public final class VirtualMachineSchedulesUpdateWithResponseMockTests { @Test public void testUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"auesugm\",\"weeklyRecurrence\":{\"weekdays\":[\"jy\",\"boel\"],\"time\":\"ttwfldsiuorini\"},\"dailyRecurrence\":{\"time\":\"dpk\"},\"hourlyRecurrence\":{\"minute\":621898517},\"timeZoneId\":\"mtmqrx\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":791895123,\"webhookUrl\":\"zyayubtgmbxi\",\"emailRecipient\":\"hragpxmib\",\"notificationLocale\":\"nupoyryefqmwovyz\"},\"createdDate\":\"2021-06-17T04:37:23Z\",\"targetResourceId\":\"omfpb\",\"provisioningState\":\"eegvyieztkutnj\",\"uniqueIdentifier\":\"l\"},\"location\":\"kkreh\",\"tags\":{\"fvulxfaryr\":\"mjodu\",\"jqwahoyi\":\"jlgdez\",\"ovbooqbmdqrxy\":\"axqvjweiwtczkddn\"},\"id\":\"laetscflwtjdtlr\",\"name\":\"e\",\"type\":\"ooy\"}"; + = "{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"tvaoznqn\",\"weeklyRecurrence\":{\"weekdays\":[\"zeagmceituuge\",\"hfpjstlzmbls\",\"jdeolctae\",\"fsyrledjc\"],\"time\":\"tb\"},\"dailyRecurrence\":{\"time\":\"igdx\"},\"hourlyRecurrence\":{\"minute\":2021179432},\"timeZoneId\":\"afgfosehxlzsxezp\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1228290805,\"webhookUrl\":\"skyfjlpzeqto\",\"emailRecipient\":\"plixlajmllpqu\",\"notificationLocale\":\"hamfowgwbtmk\"},\"createdDate\":\"2021-08-13T01:43:34Z\",\"targetResourceId\":\"kzwaqxofq\",\"provisioningState\":\"chiqbplvfid\",\"uniqueIdentifier\":\"ztekxbyjgmsfep\"},\"tags\":{\"jfowxwy\":\"hpqadagrhrdicxdw\"},\"location\":\"c\",\"id\":\"sgbipcukdveksbuh\",\"name\":\"duchvls\",\"type\":\"rdpibfd\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); Schedule response = manager.virtualMachineSchedules() - .updateWithResponse("afofu", "orimmo", "zwdehkkmvhz", "ovanyrva", + .updateWithResponse("xsmzygdf", "akw", "eivmak", "hysowljuxlkbect", new ScheduleFragment() - .withTags(mapOf("ewikfyaqandmym", "gelg", "umov", "qoq", "woxfaxdtnqifbsa", "fbpbvzopaxmfmvsm")), + .withTags(mapOf("skdchmaiubavl", "j", "gmfalkzazmgoked", "wp", "zrthqet", "jqafkmkro")), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("kkreh", response.location()); - Assertions.assertEquals("mjodu", response.tags().get("fvulxfaryr")); + Assertions.assertEquals("hpqadagrhrdicxdw", response.tags().get("jfowxwy")); + Assertions.assertEquals("c", response.location()); Assertions.assertEquals(EnableStatus.DISABLED, response.status()); - Assertions.assertEquals("auesugm", response.taskType()); - Assertions.assertEquals("jy", response.weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("ttwfldsiuorini", response.weeklyRecurrence().time()); - Assertions.assertEquals("dpk", response.dailyRecurrence().time()); - Assertions.assertEquals(621898517, response.hourlyRecurrence().minute()); - Assertions.assertEquals("mtmqrx", response.timeZoneId()); - Assertions.assertEquals(EnableStatus.ENABLED, response.notificationSettings().status()); - Assertions.assertEquals(791895123, response.notificationSettings().timeInMinutes()); - Assertions.assertEquals("zyayubtgmbxi", response.notificationSettings().webhookUrl()); - Assertions.assertEquals("hragpxmib", response.notificationSettings().emailRecipient()); - Assertions.assertEquals("nupoyryefqmwovyz", response.notificationSettings().notificationLocale()); - Assertions.assertEquals("omfpb", response.targetResourceId()); + Assertions.assertEquals("tvaoznqn", response.taskType()); + Assertions.assertEquals("zeagmceituuge", response.weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("tb", response.weeklyRecurrence().time()); + Assertions.assertEquals("igdx", response.dailyRecurrence().time()); + Assertions.assertEquals(2021179432, response.hourlyRecurrence().minute()); + Assertions.assertEquals("afgfosehxlzsxezp", response.timeZoneId()); + Assertions.assertEquals(EnableStatus.DISABLED, response.notificationSettings().status()); + Assertions.assertEquals(1228290805, response.notificationSettings().timeInMinutes()); + Assertions.assertEquals("skyfjlpzeqto", response.notificationSettings().webhookUrl()); + Assertions.assertEquals("plixlajmllpqu", response.notificationSettings().emailRecipient()); + Assertions.assertEquals("hamfowgwbtmk", response.notificationSettings().notificationLocale()); + Assertions.assertEquals("kzwaqxofq", response.targetResourceId()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskMockTests.java index 6c30b98e1476..fab177145e86 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.AttachNewDataDiskOptions; @@ -29,15 +29,15 @@ public void testAddDataDisk() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachines() - .addDataDisk("vkrbzkuastaxklpr", "ulhgltoiz", "xvsc", + .addDataDisk("znhrf", "slglh", "ry", new DataDiskProperties() - .withAttachNewDataDiskOptions(new AttachNewDataDiskOptions().withDiskSizeGiB(699693500) - .withDiskName("yskye") + .withAttachNewDataDiskOptions(new AttachNewDataDiskOptions().withDiskSizeGiB(2143794950) + .withDiskName("uioaeocpaj") .withDiskType(StorageType.PREMIUM)) - .withExistingLabDiskId("xczvfcckwrtwle") + .withExistingLabDiskId("vkbdgddkrhdccxbe") .withHostCaching(HostCachingOptions.READ_ONLY), com.azure.core.util.Context.NONE); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsMockTests.java index c676487964cd..021396685822 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ApplyArtifactsRequest; @@ -29,37 +29,20 @@ public void testApplyArtifacts() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachines() - .applyArtifacts("eszr", "lhpdhwynctaczcnj", "mbbfnv", - new ApplyArtifactsRequest() - .withArtifacts( - Arrays - .asList( - new ArtifactInstallProperties().withArtifactId("zovnkrtiklsm") - .withArtifactTitle("hql") - .withParameters(Arrays.asList( - new ArtifactParameterProperties().withName("syi").withValue("hyxwbgbud"), - new ArtifactParameterProperties().withName("qdo").withValue("ccqcdhth"), - new ArtifactParameterProperties().withName("vlirknuc").withValue("awrdt"), - new ArtifactParameterProperties().withName("gzlgpyaixihz") - .withValue("jtsmuydqf"))) - .withStatus("kacybdueurgmcdcp") - .withDeploymentStatusMessage("hlo") - .withVmExtensionStatusMessage("rmhzicsbf") - .withInstallTime(OffsetDateTime.parse("2021-08-24T07:22:25Z")), - new ArtifactInstallProperties().withArtifactId("aaknyukibxig") - .withArtifactTitle("phzwxqte") - .withParameters(Arrays.asList( - new ArtifactParameterProperties().withName("lhvtozyagj") - .withValue("xkbylhyyxgffklv"), - new ArtifactParameterProperties().withName("rwtrdgscnvqeonsg").withValue("xlw"), - new ArtifactParameterProperties().withName("zyohxpthc").withValue("pvkvtwf"))) - .withStatus("sobpbo") - .withDeploymentStatusMessage("mmlcdyarng") - .withVmExtensionStatusMessage("jf") - .withInstallTime(OffsetDateTime.parse("2021-03-20T19:53:39Z")))), + .applyArtifacts("utkzwtjw", "guzytijc", "fn", + new ApplyArtifactsRequest().withArtifacts(Arrays.asList(new ArtifactInstallProperties() + .withArtifactId("gjdydhqkk") + .withArtifactTitle("juck") + .withParameters( + Arrays.asList(new ArtifactParameterProperties().withName("qbhpowcnx").withValue("zdlys"), + new ArtifactParameterProperties().withName("dtoakatpryt").withValue("hzbqfdpfawrptvcs"))) + .withStatus("kutzct") + .withDeploymentStatusMessage("qgdirda") + .withVmExtensionStatusMessage("tzjgcfjfxtbwj") + .withInstallTime(OffsetDateTime.parse("2020-12-23T14:43:08Z")))), com.azure.core.util.Context.NONE); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimMockTests.java index b89bbb0cc38b..7233f55888ec 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testClaim() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachines().claim("qhx", "asmcolmugpyvaos", "kluwz", com.azure.core.util.Context.NONE); + manager.virtualMachines().claim("muy", "gftt", "dofgeoagfuoftnx", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteMockTests.java index 88c2fb9cc90d..19e6e9967b1c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachines().delete("ml", "feothxu", "rigrjdljlkq", com.azure.core.util.Context.NONE); + manager.virtualMachines().delete("e", "tkutnjil", "ukkrehyh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskMockTests.java index b28ffa582e22..42e848e1644d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.DetachDataDiskProperties; @@ -26,11 +26,11 @@ public void testDetachDataDisk() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachines() - .detachDataDisk("eygzvtyevjhu", "nobguqisqsqkpdmi", "y", - new DetachDataDiskProperties().withExistingLabDiskId("nmlvi"), com.azure.core.util.Context.NONE); + .detachDataDisk("dwxmda", "wiygmgsevmdmzenl", "stgfczl", + new DetachDataDiskProperties().withExistingLabDiskId("n"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsWithResponseMockTests.java index 315603137845..dc1d8fe4662d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.RdpConnection; @@ -20,20 +20,19 @@ public final class VirtualMachinesGetRdpFileContentsWithResponseMockTests { @Test public void testGetRdpFileContentsWithResponse() throws Exception { - String responseStr = "{\"contents\":\"btplefoi\"}"; + String responseStr = "{\"contents\":\"ttnzqsaq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); RdpConnection response = manager.virtualMachines() - .getRdpFileContentsWithResponse("cpszpmcvqdvrdmv", "yrx", "hgvqojbxaotcgbz", - com.azure.core.util.Context.NONE) + .getRdpFileContentsWithResponse("idt", "vamyyznmrgcdo", "cvucgytoxu", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("btplefoi", response.contents()); + Assertions.assertEquals("ttnzqsaq", response.contents()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesWithResponseMockTests.java index be25d68200c3..42557015f39f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ApplicableSchedule; @@ -22,50 +22,52 @@ public final class VirtualMachinesListApplicableSchedulesWithResponseMockTests { @Test public void testListApplicableSchedulesWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"labVmsShutdown\":{\"properties\":{\"status\":\"Disabled\",\"taskType\":\"lpnerxrzutylcur\",\"weeklyRecurrence\":{\"weekdays\":[\"nbxqaeht\"],\"time\":\"jmbnvynf\"},\"dailyRecurrence\":{\"time\":\"eactedcglskakdd\"},\"hourlyRecurrence\":{\"minute\":1624949953},\"timeZoneId\":\"llrqmtlpbyxro\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1760009428,\"webhookUrl\":\"ffmnoiics\",\"emailRecipient\":\"yhbrjjta\",\"notificationLocale\":\"rdsjrho\"},\"createdDate\":\"2021-12-05T02:21:08Z\",\"targetResourceId\":\"gusxxhdod\",\"provisioningState\":\"wyblv\",\"uniqueIdentifier\":\"d\"},\"location\":\"vsbyidaelqp\",\"tags\":{\"ggdusxu\":\"mkwjfbotl\",\"uxcjkcoqwczsyiq\":\"sui\"},\"id\":\"izfwihvaangqt\",\"name\":\"hjrfdmfdvbbaex\",\"type\":\"jfwtgdfkkaui\"},\"labVmsStartup\":{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"fmczfedyueps\",\"weeklyRecurrence\":{\"weekdays\":[\"ida\",\"jvyweo\",\"fkumcfjxoky\",\"lsyasv\"],\"time\":\"k\"},\"dailyRecurrence\":{\"time\":\"gjjekrkn\"},\"hourlyRecurrence\":{\"minute\":1460897475},\"timeZoneId\":\"jqy\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":370912095,\"webhookUrl\":\"dtu\",\"emailRecipient\":\"r\",\"notificationLocale\":\"dklotcsubmzo\"},\"createdDate\":\"2021-01-14T01:24:35Z\",\"targetResourceId\":\"obc\",\"provisioningState\":\"xfpwhd\",\"uniqueIdentifier\":\"lbkl\"},\"location\":\"lmnnk\",\"tags\":{\"saqjmkgx\":\"yqshwyqxridtt\",\"uuylztpz\":\"wqu\",\"fvezefk\":\"izevjyk\",\"zcntogffjwajnrtw\":\"kqtwqlepjjzkcasf\"},\"id\":\"vaqkifmxawost\",\"name\":\"zkn\",\"type\":\"rkmjqncfvdscnhe\"}},\"location\":\"vwfnqqwypvn\",\"tags\":{\"od\":\"b\",\"muymvec\":\"ggrssgwjfkain\",\"nkzzohnrddclz\":\"ztscbgmusaictds\"},\"id\":\"qozreh\",\"name\":\"bzq\",\"type\":\"xbnjrqvzyuexoz\"}"; + = "{\"location\":\"qunycwztlvvw\",\"tags\":{\"trepw\":\"rkky\",\"dofuckclb\":\"wfkcauxuvavcpf\"},\"properties\":{\"labVmsShutdown\":{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"vsolzwil\",\"weeklyRecurrence\":{\"weekdays\":[\"jfsqeb\",\"uxjxhfxf\",\"wpdkktpmbmxbmb\"],\"time\":\"gzzxljbkhxsd\"},\"dailyRecurrence\":{\"time\":\"umyd\"},\"hourlyRecurrence\":{\"minute\":1540385672},\"timeZoneId\":\"jf\",\"notificationSettings\":{\"status\":\"Disabled\",\"timeInMinutes\":1183779729,\"webhookUrl\":\"kvqb\",\"emailRecipient\":\"glgwzpvxakglhp\",\"notificationLocale\":\"srfga\"},\"createdDate\":\"2020-12-21T00:02:08Z\",\"targetResourceId\":\"dvxcgdhyhgoqgsoy\",\"provisioningState\":\"xyjrcbqpb\",\"uniqueIdentifier\":\"pglqjo\"},\"tags\":{\"vfwjlo\":\"ahneaoovtyjzt\",\"foc\":\"zekfsrmauklajv\",\"kwxnhwhhnoyrza\":\"hapejov\"},\"location\":\"ee\",\"id\":\"mjenvjeatea\",\"name\":\"xc\",\"type\":\"xoxdjxldnaryyi\"},\"labVmsStartup\":{\"properties\":{\"status\":\"Enabled\",\"taskType\":\"lrndwdbvxvza\",\"weeklyRecurrence\":{\"weekdays\":[\"yqxlunkfthmcx\",\"qxmyzkl\",\"oanpohrvm\"],\"time\":\"qr\"},\"dailyRecurrence\":{\"time\":\"divznl\"},\"hourlyRecurrence\":{\"minute\":1445110744},\"timeZoneId\":\"skhj\",\"notificationSettings\":{\"status\":\"Enabled\",\"timeInMinutes\":1893707274,\"webhookUrl\":\"hxjtgzgtai\",\"emailRecipient\":\"b\",\"notificationLocale\":\"roigbsfsgsaenwld\"},\"createdDate\":\"2021-06-17T18:59:08Z\",\"targetResourceId\":\"jqlxspmrj\",\"provisioningState\":\"ryldsxeb\",\"uniqueIdentifier\":\"sxrznmg\"},\"tags\":{\"s\":\"luyckhefrb\"},\"location\":\"erbgpxeb\",\"id\":\"udcaytujrax\",\"name\":\"tpryjmgtn\",\"type\":\"ewouxl\"}},\"id\":\"s\",\"name\":\"vyljurkeposehqq\",\"type\":\"lmpctwj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); ApplicableSchedule response = manager.virtualMachines() - .listApplicableSchedulesWithResponse("yidoxznvg", "dtmuuvd", "wsxmrszb", com.azure.core.util.Context.NONE) + .listApplicableSchedulesWithResponse("ebg", "zplusdekpdzzms", "gpgvokyejidbdq", + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vwfnqqwypvn", response.location()); - Assertions.assertEquals("b", response.tags().get("od")); - Assertions.assertEquals("vsbyidaelqp", response.labVmsShutdown().location()); - Assertions.assertEquals("mkwjfbotl", response.labVmsShutdown().tags().get("ggdusxu")); - Assertions.assertEquals(EnableStatus.DISABLED, response.labVmsShutdown().status()); - Assertions.assertEquals("lpnerxrzutylcur", response.labVmsShutdown().taskType()); - Assertions.assertEquals("nbxqaeht", response.labVmsShutdown().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("jmbnvynf", response.labVmsShutdown().weeklyRecurrence().time()); - Assertions.assertEquals("eactedcglskakdd", response.labVmsShutdown().dailyRecurrence().time()); - Assertions.assertEquals(1624949953, response.labVmsShutdown().hourlyRecurrence().minute()); - Assertions.assertEquals("llrqmtlpbyxro", response.labVmsShutdown().timeZoneId()); - Assertions.assertEquals(EnableStatus.ENABLED, response.labVmsShutdown().notificationSettings().status()); - Assertions.assertEquals(1760009428, response.labVmsShutdown().notificationSettings().timeInMinutes()); - Assertions.assertEquals("ffmnoiics", response.labVmsShutdown().notificationSettings().webhookUrl()); - Assertions.assertEquals("yhbrjjta", response.labVmsShutdown().notificationSettings().emailRecipient()); - Assertions.assertEquals("rdsjrho", response.labVmsShutdown().notificationSettings().notificationLocale()); - Assertions.assertEquals("gusxxhdod", response.labVmsShutdown().targetResourceId()); - Assertions.assertEquals("lmnnk", response.labVmsStartup().location()); - Assertions.assertEquals("yqshwyqxridtt", response.labVmsStartup().tags().get("saqjmkgx")); + Assertions.assertEquals("qunycwztlvvw", response.location()); + Assertions.assertEquals("rkky", response.tags().get("trepw")); + Assertions.assertEquals("ahneaoovtyjzt", response.labVmsShutdown().tags().get("vfwjlo")); + Assertions.assertEquals("ee", response.labVmsShutdown().location()); + Assertions.assertEquals(EnableStatus.ENABLED, response.labVmsShutdown().status()); + Assertions.assertEquals("vsolzwil", response.labVmsShutdown().taskType()); + Assertions.assertEquals("jfsqeb", response.labVmsShutdown().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("gzzxljbkhxsd", response.labVmsShutdown().weeklyRecurrence().time()); + Assertions.assertEquals("umyd", response.labVmsShutdown().dailyRecurrence().time()); + Assertions.assertEquals(1540385672, response.labVmsShutdown().hourlyRecurrence().minute()); + Assertions.assertEquals("jf", response.labVmsShutdown().timeZoneId()); + Assertions.assertEquals(EnableStatus.DISABLED, response.labVmsShutdown().notificationSettings().status()); + Assertions.assertEquals(1183779729, response.labVmsShutdown().notificationSettings().timeInMinutes()); + Assertions.assertEquals("kvqb", response.labVmsShutdown().notificationSettings().webhookUrl()); + Assertions.assertEquals("glgwzpvxakglhp", response.labVmsShutdown().notificationSettings().emailRecipient()); + Assertions.assertEquals("srfga", response.labVmsShutdown().notificationSettings().notificationLocale()); + Assertions.assertEquals("dvxcgdhyhgoqgsoy", response.labVmsShutdown().targetResourceId()); + Assertions.assertEquals("luyckhefrb", response.labVmsStartup().tags().get("s")); + Assertions.assertEquals("erbgpxeb", response.labVmsStartup().location()); Assertions.assertEquals(EnableStatus.ENABLED, response.labVmsStartup().status()); - Assertions.assertEquals("fmczfedyueps", response.labVmsStartup().taskType()); - Assertions.assertEquals("ida", response.labVmsStartup().weeklyRecurrence().weekdays().get(0)); - Assertions.assertEquals("k", response.labVmsStartup().weeklyRecurrence().time()); - Assertions.assertEquals("gjjekrkn", response.labVmsStartup().dailyRecurrence().time()); - Assertions.assertEquals(1460897475, response.labVmsStartup().hourlyRecurrence().minute()); - Assertions.assertEquals("jqy", response.labVmsStartup().timeZoneId()); - Assertions.assertEquals(EnableStatus.DISABLED, response.labVmsStartup().notificationSettings().status()); - Assertions.assertEquals(370912095, response.labVmsStartup().notificationSettings().timeInMinutes()); - Assertions.assertEquals("dtu", response.labVmsStartup().notificationSettings().webhookUrl()); - Assertions.assertEquals("r", response.labVmsStartup().notificationSettings().emailRecipient()); - Assertions.assertEquals("dklotcsubmzo", response.labVmsStartup().notificationSettings().notificationLocale()); - Assertions.assertEquals("obc", response.labVmsStartup().targetResourceId()); + Assertions.assertEquals("lrndwdbvxvza", response.labVmsStartup().taskType()); + Assertions.assertEquals("yqxlunkfthmcx", response.labVmsStartup().weeklyRecurrence().weekdays().get(0)); + Assertions.assertEquals("qr", response.labVmsStartup().weeklyRecurrence().time()); + Assertions.assertEquals("divznl", response.labVmsStartup().dailyRecurrence().time()); + Assertions.assertEquals(1445110744, response.labVmsStartup().hourlyRecurrence().minute()); + Assertions.assertEquals("skhj", response.labVmsStartup().timeZoneId()); + Assertions.assertEquals(EnableStatus.ENABLED, response.labVmsStartup().notificationSettings().status()); + Assertions.assertEquals(1893707274, response.labVmsStartup().notificationSettings().timeInMinutes()); + Assertions.assertEquals("hxjtgzgtai", response.labVmsStartup().notificationSettings().webhookUrl()); + Assertions.assertEquals("b", response.labVmsStartup().notificationSettings().emailRecipient()); + Assertions.assertEquals("roigbsfsgsaenwld", + response.labVmsStartup().notificationSettings().notificationLocale()); + Assertions.assertEquals("jqlxspmrj", response.labVmsStartup().targetResourceId()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeployMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeployMockTests.java index 8d8b08ff0479..34c233274c93 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeployMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeployMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testRedeploy() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachines() - .redeploy("nynpameudpabcre", "wzosgy", "xvcvasormrexz", com.azure.core.util.Context.NONE); + manager.virtualMachines().redeploy("dsdlzmk", "erxxxoteehkhowgo", "vvh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeMockTests.java index 7a531efa08dc..f0f3e5d4076c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.ResizeLabVirtualMachineProperties; @@ -26,11 +26,11 @@ public void testResize() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachines() - .resize("dubewgzy", "baduvecovsdq", "zrtdbakr", new ResizeLabVirtualMachineProperties().withSize("mz"), - com.azure.core.util.Context.NONE); + .resize("owpcbapnpxraqawb", "pspfeylqlo", "vvujex", + new ResizeLabVirtualMachineProperties().withSize("glxrkgjnm"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartMockTests.java index 137aba3d8e48..353b4d3e735f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testRestart() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachines().restart("vppkeqsi", "jmcl", "gygnhrkombc", com.azure.core.util.Context.NONE); + manager.virtualMachines() + .restart("paslavxjfiuofpi", "idzlvssqywjopa", "kyhydvikmf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartMockTests.java index 3b53412f10af..20a9bc230845 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testStart() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachines() - .start("tajdopggorwjoqtr", "tpvclpofyrlmwk", "tskwxjgvhxccbm", com.azure.core.util.Context.NONE); + manager.virtualMachines().start("gpmillxgjs", "izwgsoriobijeiyd", "euynh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopMockTests.java index 8a06b33cbcf8..f25751039043 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testStop() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachines().stop("akmkookbput", "g", "m", com.azure.core.util.Context.NONE); + manager.virtualMachines().stop("okayrg", "ybriop", "weoftnorw", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksMockTests.java index 5c50a99b76dd..6e77b4a6d106 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testTransferDisks() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachines() - .transferDisks("yakmlwktf", "wzkroyrdurxfl", "qjimejtgzjxxlfej", com.azure.core.util.Context.NONE); + manager.virtualMachines().transferDisks("igsioctqkm", "ja", "xvzfffhtjnwos", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimMockTests.java index fff8dde7ad7b..90b57f1f9f52 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testUnClaim() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualMachines().unClaim("zuqloiwyayyzivr", "itcdqlhchwhrk", "jlei", com.azure.core.util.Context.NONE); + manager.virtualMachines() + .unClaim("tfjxtvlx", "zqfcwrriomxee", "wyhjmbjiqegmxdbs", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkFragmentTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkFragmentTests.java index 225f61cf3202..ab95a5796bdf 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkFragmentTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkFragmentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,18 +13,16 @@ public final class VirtualNetworkFragmentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - VirtualNetworkFragment model = BinaryData.fromString( - "{\"tags\":{\"klsbsbqqqagw\":\"zw\",\"k\":\"rxaomzisglrrcze\",\"yueayfbpcmsp\":\"hltnjadhqoawjq\",\"mg\":\"byrrueqth\"}}") - .toObject(VirtualNetworkFragment.class); - Assertions.assertEquals("zw", model.tags().get("klsbsbqqqagw")); + VirtualNetworkFragment model + = BinaryData.fromString("{\"tags\":{\"l\":\"cnjrohmbpyryxame\"}}").toObject(VirtualNetworkFragment.class); + Assertions.assertEquals("cnjrohmbpyryxame", model.tags().get("l")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - VirtualNetworkFragment model = new VirtualNetworkFragment().withTags( - mapOf("klsbsbqqqagw", "zw", "k", "rxaomzisglrrcze", "yueayfbpcmsp", "hltnjadhqoawjq", "mg", "byrrueqth")); + VirtualNetworkFragment model = new VirtualNetworkFragment().withTags(mapOf("l", "cnjrohmbpyryxame")); model = BinaryData.fromObject(model).toObject(VirtualNetworkFragment.class); - Assertions.assertEquals("zw", model.tags().get("klsbsbqqqagw")); + Assertions.assertEquals("cnjrohmbpyryxame", model.tags().get("l")); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkInnerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkInnerTests.java index 557a6bf96ec4..09323e545806 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkInnerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -20,70 +20,77 @@ public final class VirtualNetworkInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { VirtualNetworkInner model = BinaryData.fromString( - "{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"cdoewbidyv\",\"labSubnetName\":\"owx\",\"allowPublicIp\":\"Default\"}],\"description\":\"udeugfsxz\",\"externalProviderResourceId\":\"paxwkufyk\",\"externalSubnets\":[{\"id\":\"xepmrut\",\"name\":\"abaobnslujdjltym\"},{\"id\":\"vguihywar\",\"name\":\"pphkixkykxds\"}],\"subnetOverrides\":[{\"resourceId\":\"mmuc\",\"labSubnetName\":\"hikkflrmy\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{}]},\"virtualNetworkPoolName\":\"isws\"},{\"resourceId\":\"iiiovgqcgxuugq\",\"labSubnetName\":\"totiowlxteqdptjg\",\"useInVmCreationPermission\":\"Default\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{},{},{}]},\"virtualNetworkPoolName\":\"b\"},{\"resourceId\":\"phqlkccuz\",\"labSubnetName\":\"gqwa\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{},{}]},\"virtualNetworkPoolName\":\"iprglvawu\"}],\"createdDate\":\"2021-10-09T04:15:21Z\",\"provisioningState\":\"fypiv\",\"uniqueIdentifier\":\"bbjpmcubkmif\"},\"location\":\"xxkubvphavp\",\"tags\":{\"bbttefjo\":\"rbqgvgov\",\"kdfrdbiqmrjgeihf\":\"nssqyzqed\",\"wfiwzcxmj\":\"lg\"},\"id\":\"byephmgt\",\"name\":\"ljvrcmyfqipgxhnp\",\"type\":\"myqwcab\"}") + "{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"ufypiv\",\"labSubnetName\":\"bbjpmcubkmif\",\"allowPublicIp\":\"Allow\"}],\"description\":\"ubvphavpmhbrbqgv\",\"externalProviderResourceId\":\"vpbbt\",\"externalSubnets\":[{\"id\":\"oknssqyzqedikdf\",\"name\":\"biqmrjgei\"},{\"id\":\"qlggwfi\",\"name\":\"cxmjpbyephmg\"}],\"subnetOverrides\":[{\"resourceId\":\"vrcmyfqipgxhnpo\",\"labSubnetName\":\"qwcabvnui\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{}]},\"virtualNetworkPoolName\":\"augmrmfjlr\"},{\"resourceId\":\"toaukhfkvcisiz\",\"labSubnetName\":\"a\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Deny\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{}]},\"virtualNetworkPoolName\":\"edwcgyee\"},{\"resourceId\":\"ei\",\"labSubnetName\":\"psmgo\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{}]},\"virtualNetworkPoolName\":\"rgmsplzga\"},{\"resourceId\":\"cshhv\",\"labSubnetName\":\"wgnxkympqanxrj\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{}]},\"virtualNetworkPoolName\":\"ypnyghshxc\"}],\"createdDate\":\"2021-04-21T21:49:39Z\",\"provisioningState\":\"gmnsghpxy\",\"uniqueIdentifier\":\"hdrwjjkh\"},\"tags\":{\"zvxnqmhrp\":\"macl\",\"wmkoisq\":\"pd\",\"ypobkdqzr\":\"ssffxuifmc\",\"czzydmxzjij\":\"zsylollgt\"},\"location\":\"uaurkihcir\",\"id\":\"efxrdcoxnbk\",\"name\":\"ja\",\"type\":\"urnnqbnqbpiz\"}") .toObject(VirtualNetworkInner.class); - Assertions.assertEquals("xxkubvphavp", model.location()); - Assertions.assertEquals("rbqgvgov", model.tags().get("bbttefjo")); - Assertions.assertEquals("cdoewbidyv", model.allowedSubnets().get(0).resourceId()); - Assertions.assertEquals("owx", model.allowedSubnets().get(0).labSubnetName()); - Assertions.assertEquals(UsagePermissionType.DEFAULT, model.allowedSubnets().get(0).allowPublicIp()); - Assertions.assertEquals("udeugfsxz", model.description()); - Assertions.assertEquals("paxwkufyk", model.externalProviderResourceId()); - Assertions.assertEquals("mmuc", model.subnetOverrides().get(0).resourceId()); - Assertions.assertEquals("hikkflrmy", model.subnetOverrides().get(0).labSubnetName()); + Assertions.assertEquals("macl", model.tags().get("zvxnqmhrp")); + Assertions.assertEquals("uaurkihcir", model.location()); + Assertions.assertEquals("ufypiv", model.allowedSubnets().get(0).resourceId()); + Assertions.assertEquals("bbjpmcubkmif", model.allowedSubnets().get(0).labSubnetName()); + Assertions.assertEquals(UsagePermissionType.ALLOW, model.allowedSubnets().get(0).allowPublicIp()); + Assertions.assertEquals("ubvphavpmhbrbqgv", model.description()); + Assertions.assertEquals("vpbbt", model.externalProviderResourceId()); + Assertions.assertEquals("vrcmyfqipgxhnpo", model.subnetOverrides().get(0).resourceId()); + Assertions.assertEquals("qwcabvnui", model.subnetOverrides().get(0).labSubnetName()); Assertions.assertEquals(UsagePermissionType.ALLOW, model.subnetOverrides().get(0).useInVmCreationPermission()); Assertions.assertEquals(UsagePermissionType.DEFAULT, model.subnetOverrides().get(0).usePublicIpAddressPermission()); - Assertions.assertEquals("isws", model.subnetOverrides().get(0).virtualNetworkPoolName()); + Assertions.assertEquals("augmrmfjlr", model.subnetOverrides().get(0).virtualNetworkPoolName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - VirtualNetworkInner model - = new VirtualNetworkInner().withLocation("xxkubvphavp") - .withTags(mapOf("bbttefjo", "rbqgvgov", "kdfrdbiqmrjgeihf", "nssqyzqed", "wfiwzcxmj", "lg")) - .withAllowedSubnets(Arrays.asList(new Subnet().withResourceId("cdoewbidyv") - .withLabSubnetName("owx") - .withAllowPublicIp(UsagePermissionType.DEFAULT))) - .withDescription("udeugfsxz") - .withExternalProviderResourceId("paxwkufyk") - .withSubnetOverrides( - Arrays.asList( - new SubnetOverride().withResourceId("mmuc") - .withLabSubnetName("hikkflrmy") - .withUseInVmCreationPermission(UsagePermissionType.ALLOW) - .withUsePublicIpAddressPermission(UsagePermissionType.DEFAULT) - .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration() - .withAllowedPorts(Arrays.asList(new Port()))) - .withVirtualNetworkPoolName("isws"), - new SubnetOverride().withResourceId("iiiovgqcgxuugq") - .withLabSubnetName("totiowlxteqdptjg") - .withUseInVmCreationPermission(UsagePermissionType.DEFAULT) - .withUsePublicIpAddressPermission(UsagePermissionType.ALLOW) - .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration() - .withAllowedPorts(Arrays.asList(new Port(), new Port(), new Port(), new Port()))) - .withVirtualNetworkPoolName("b"), - new SubnetOverride().withResourceId("phqlkccuz") - .withLabSubnetName("gqwa") - .withUseInVmCreationPermission(UsagePermissionType.ALLOW) - .withUsePublicIpAddressPermission(UsagePermissionType.DEFAULT) - .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration() - .withAllowedPorts(Arrays.asList(new Port(), new Port(), new Port()))) - .withVirtualNetworkPoolName("iprglvawu"))); + VirtualNetworkInner model = new VirtualNetworkInner() + .withTags( + mapOf("zvxnqmhrp", "macl", "wmkoisq", "pd", "ypobkdqzr", "ssffxuifmc", "czzydmxzjij", "zsylollgt")) + .withLocation("uaurkihcir") + .withAllowedSubnets(Arrays.asList(new Subnet().withResourceId("ufypiv") + .withLabSubnetName("bbjpmcubkmif") + .withAllowPublicIp(UsagePermissionType.ALLOW))) + .withDescription("ubvphavpmhbrbqgv") + .withExternalProviderResourceId("vpbbt") + .withSubnetOverrides(Arrays.asList( + new SubnetOverride().withResourceId("vrcmyfqipgxhnpo") + .withLabSubnetName("qwcabvnui") + .withUseInVmCreationPermission(UsagePermissionType.ALLOW) + .withUsePublicIpAddressPermission(UsagePermissionType.DEFAULT) + .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration() + .withAllowedPorts(Arrays.asList(new Port(), new Port()))) + .withVirtualNetworkPoolName("augmrmfjlr"), + new SubnetOverride().withResourceId("toaukhfkvcisiz") + .withLabSubnetName("a") + .withUseInVmCreationPermission(UsagePermissionType.DENY) + .withUsePublicIpAddressPermission(UsagePermissionType.DENY) + .withSharedPublicIpAddressConfiguration( + new SubnetSharedPublicIpAddressConfiguration().withAllowedPorts(Arrays.asList(new Port()))) + .withVirtualNetworkPoolName("edwcgyee"), + new SubnetOverride().withResourceId("ei") + .withLabSubnetName("psmgo") + .withUseInVmCreationPermission(UsagePermissionType.DENY) + .withUsePublicIpAddressPermission(UsagePermissionType.ALLOW) + .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration() + .withAllowedPorts(Arrays.asList(new Port(), new Port()))) + .withVirtualNetworkPoolName("rgmsplzga"), + new SubnetOverride().withResourceId("cshhv") + .withLabSubnetName("wgnxkympqanxrj") + .withUseInVmCreationPermission(UsagePermissionType.DENY) + .withUsePublicIpAddressPermission(UsagePermissionType.ALLOW) + .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration() + .withAllowedPorts(Arrays.asList(new Port(), new Port()))) + .withVirtualNetworkPoolName("ypnyghshxc"))); model = BinaryData.fromObject(model).toObject(VirtualNetworkInner.class); - Assertions.assertEquals("xxkubvphavp", model.location()); - Assertions.assertEquals("rbqgvgov", model.tags().get("bbttefjo")); - Assertions.assertEquals("cdoewbidyv", model.allowedSubnets().get(0).resourceId()); - Assertions.assertEquals("owx", model.allowedSubnets().get(0).labSubnetName()); - Assertions.assertEquals(UsagePermissionType.DEFAULT, model.allowedSubnets().get(0).allowPublicIp()); - Assertions.assertEquals("udeugfsxz", model.description()); - Assertions.assertEquals("paxwkufyk", model.externalProviderResourceId()); - Assertions.assertEquals("mmuc", model.subnetOverrides().get(0).resourceId()); - Assertions.assertEquals("hikkflrmy", model.subnetOverrides().get(0).labSubnetName()); + Assertions.assertEquals("macl", model.tags().get("zvxnqmhrp")); + Assertions.assertEquals("uaurkihcir", model.location()); + Assertions.assertEquals("ufypiv", model.allowedSubnets().get(0).resourceId()); + Assertions.assertEquals("bbjpmcubkmif", model.allowedSubnets().get(0).labSubnetName()); + Assertions.assertEquals(UsagePermissionType.ALLOW, model.allowedSubnets().get(0).allowPublicIp()); + Assertions.assertEquals("ubvphavpmhbrbqgv", model.description()); + Assertions.assertEquals("vpbbt", model.externalProviderResourceId()); + Assertions.assertEquals("vrcmyfqipgxhnpo", model.subnetOverrides().get(0).resourceId()); + Assertions.assertEquals("qwcabvnui", model.subnetOverrides().get(0).labSubnetName()); Assertions.assertEquals(UsagePermissionType.ALLOW, model.subnetOverrides().get(0).useInVmCreationPermission()); Assertions.assertEquals(UsagePermissionType.DEFAULT, model.subnetOverrides().get(0).usePublicIpAddressPermission()); - Assertions.assertEquals("isws", model.subnetOverrides().get(0).virtualNetworkPoolName()); + Assertions.assertEquals("augmrmfjlr", model.subnetOverrides().get(0).virtualNetworkPoolName()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkListTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkListTests.java index c21ff58fb9e6..8f3eae6a7f49 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkListTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkListTests.java @@ -1,165 +1,36 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devtestlabs.fluent.models.VirtualNetworkInner; -import com.azure.resourcemanager.devtestlabs.models.Subnet; -import com.azure.resourcemanager.devtestlabs.models.SubnetOverride; -import com.azure.resourcemanager.devtestlabs.models.SubnetSharedPublicIpAddressConfiguration; +import com.azure.resourcemanager.devtestlabs.implementation.models.VirtualNetworkList; import com.azure.resourcemanager.devtestlabs.models.UsagePermissionType; -import com.azure.resourcemanager.devtestlabs.models.VirtualNetworkList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class VirtualNetworkListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { VirtualNetworkList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"ibidmhmwffp\",\"labSubnetName\":\"muvapc\",\"allowPublicIp\":\"Default\"}],\"description\":\"rv\",\"externalProviderResourceId\":\"yoxoy\",\"externalSubnets\":[{\"id\":\"haim\",\"name\":\"iroqbosh\"}],\"subnetOverrides\":[{\"resourceId\":\"apyyrmfsvbpavbo\",\"labSubnetName\":\"ppdbwnupgahxkum\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"fdmmcpug\"}],\"createdDate\":\"2021-09-14T23:55:36Z\",\"provisioningState\":\"epvufhbzehew\",\"uniqueIdentifier\":\"qhnlbqnbld\"},\"location\":\"eaclgschorimk\",\"tags\":{\"puviyfcaabe\":\"rmoucsofl\"},\"id\":\"lhbhl\",\"name\":\"bmxuqib\",\"type\":\"xtkcudfbsfar\"},{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"lkjxnqpvwgf\",\"labSubnetName\":\"mhqykizmdksa\",\"allowPublicIp\":\"Default\"},{\"resourceId\":\"luqvoxmycjimryv\",\"labSubnetName\":\"cwwp\",\"allowPublicIp\":\"Deny\"},{\"resourceId\":\"w\",\"labSubnetName\":\"ydsx\",\"allowPublicIp\":\"Deny\"}],\"description\":\"hecbvopwndyq\",\"externalProviderResourceId\":\"allklmtkhlowk\",\"externalSubnets\":[{\"id\":\"br\",\"name\":\"jmzsyzfh\"},{\"id\":\"lhikcyychunsj\",\"name\":\"jrtwsz\"},{\"id\":\"vuicp\",\"name\":\"trrmhwrb\"}],\"subnetOverrides\":[{\"resourceId\":\"f\",\"labSubnetName\":\"bhvjglr\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"hhmemhooclutnp\"}],\"createdDate\":\"2021-06-03T02:56:10Z\",\"provisioningState\":\"czj\",\"uniqueIdentifier\":\"mykyujxsglhs\"},\"location\":\"rryejylmbkzudnig\",\"tags\":{\"wlpxuzzjg\":\"hotj\",\"qotoihiqakydiwfb\":\"refqy\",\"spodaqax\":\"kwpzdqtvh\",\"jfulbmoic\":\"ipietgbe\"},\"id\":\"dlpnfpubn\",\"name\":\"nbatzvi\",\"type\":\"sowsaael\"},{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"ju\",\"labSubnetName\":\"lrvkmjc\",\"allowPublicIp\":\"Default\"}],\"description\":\"lgfggcvk\",\"externalProviderResourceId\":\"lizrzbjpsfxsfuz\",\"externalSubnets\":[{\"id\":\"mvagbwidqlvhuko\",\"name\":\"ofizrvjfnmjmvlwy\"},{\"id\":\"iblkujr\",\"name\":\"fojuidjpuuyj\"}],\"subnetOverrides\":[{\"resourceId\":\"ikzoeovvtzejetj\",\"labSubnetName\":\"nt\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"dbqzolxrzvhqjw\"},{\"resourceId\":\"htgv\",\"labSubnetName\":\"pcrrk\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Deny\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"smwr\"},{\"resourceId\":\"cdxfzzzwyjafitl\",\"labSubnetName\":\"uy\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"ltxdwhmozu\"},{\"resourceId\":\"zvlnsnnjz\",\"labSubnetName\":\"afolpymwamxqzrag\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Deny\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"dulajvlejchcs\"}],\"createdDate\":\"2021-02-11T14:38:35Z\",\"provisioningState\":\"nmzlanru\",\"uniqueIdentifier\":\"wvnph\"},\"location\":\"nzqtpjhmqrhvt\",\"tags\":{\"xetlgydlhqv\":\"iwdcxsmlzzhzd\",\"pxy\":\"n\",\"klbyulidwcw\":\"afiqgeaarbgjekg\",\"hj\":\"mzegjon\"},\"id\":\"rwgdnqzbrfks\",\"name\":\"zhzmtksjci\",\"type\":\"digsxcdgl\"},{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"ua\",\"labSubnetName\":\"tomflrytswfpf\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"cxnmskwhqjjyslu\",\"labSubnetName\":\"pshhkvpedwqslsr\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"vwwskondcbr\",\"labSubnetName\":\"muvqejosovyr\",\"allowPublicIp\":\"Deny\"}],\"description\":\"esi\",\"externalProviderResourceId\":\"qtljqobbpihehc\",\"externalSubnets\":[{\"id\":\"mrqbrjbbmpxdlv\",\"name\":\"frexcrseqw\"},{\"id\":\"s\",\"name\":\"udgzhxogjgg\"},{\"id\":\"oujkxibdafh\",\"name\":\"mdyomkxfbvfbh\"}],\"subnetOverrides\":[{\"resourceId\":\"hpwpgddeimawzovg\",\"labSubnetName\":\"um\",\"useInVmCreationPermission\":\"Default\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"aztb\"}],\"createdDate\":\"2021-11-13T12:27:46Z\",\"provisioningState\":\"qowxwcom\",\"uniqueIdentifier\":\"kytwvcz\"},\"location\":\"swkacvej\",\"tags\":{\"pqthehnmnaoya\":\"vlvhbwrnfxtgd\",\"t\":\"kcoeqswank\",\"ktgj\":\"tmhdroznnhdr\",\"eml\":\"sggux\"},\"id\":\"ywaeeczgf\",\"name\":\"ukklelss\",\"type\":\"blycsxzujksr\"}],\"nextLink\":\"mdesqp\"}") + "{\"value\":[{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"fkmroc\",\"labSubnetName\":\"e\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"tod\",\"labSubnetName\":\"pyapucygvoav\",\"allowPublicIp\":\"Allow\"}],\"description\":\"sxlghieegjlg\",\"externalProviderResourceId\":\"paseksgb\",\"externalSubnets\":[{\"id\":\"tu\",\"name\":\"dhga\"},{\"id\":\"pirpiwrqof\",\"name\":\"o\"},{\"id\":\"jnlex\",\"name\":\"cbjpibkephuu\"},{\"id\":\"rctat\",\"name\":\"intqpbrlcyr\"}],\"subnetOverrides\":[{\"resourceId\":\"kg\",\"labSubnetName\":\"xyf\",\"useInVmCreationPermission\":\"Default\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"rpcjttbstvjeaqnr\"},{\"resourceId\":\"vfkoxml\",\"labSubnetName\":\"ktuidvrm\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"exymzvla\"},{\"resourceId\":\"pbh\",\"labSubnetName\":\"vqs\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"ivensrpmeyyvpk\"},{\"resourceId\":\"tlbijpzg\",\"labSubnetName\":\"srfhf\",\"useInVmCreationPermission\":\"Default\",\"usePublicIpAddressPermission\":\"Deny\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"nxwcdommpv\"}],\"createdDate\":\"2021-03-15T10:44:28Z\",\"provisioningState\":\"zfgbrttuiaclkie\",\"uniqueIdentifier\":\"ajlfnthiqfyu\"},\"tags\":{\"swmtxk\":\"iygbpvn\",\"jlmec\":\"ctwwgzw\",\"gzyvnee\":\"og\",\"ffhzbkrkjjjavfq\":\"aifghtmoqqt\"},\"location\":\"hnqoewdo\",\"id\":\"yetesy\",\"name\":\"vidbztjhqtfb\",\"type\":\"vnynkb\"},{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"juhpsprkzyau\",\"labSubnetName\":\"accxnafbwqroohtu\",\"allowPublicIp\":\"Default\"},{\"resourceId\":\"onurjtumghihpv\",\"labSubnetName\":\"mslclblyjxlt\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"scvsfxigctm\",\"labSubnetName\":\"uupb\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"cydrtceukdqkk\",\"labSubnetName\":\"hztgeqmgqzgwld\",\"allowPublicIp\":\"Deny\"}],\"description\":\"illcecfehu\",\"externalProviderResourceId\":\"oaguhic\",\"externalSubnets\":[{\"id\":\"zstacsjvhrweft\",\"name\":\"qejpmvssehaepwa\"},{\"id\":\"xtczhupeuknijd\",\"name\":\"yespydjfbocyv\"}],\"subnetOverrides\":[{\"resourceId\":\"rtywi\",\"labSubnetName\":\"mhlaku\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"uacdixmxuf\"},{\"resourceId\":\"ryjqgdkf\",\"labSubnetName\":\"zoeo\",\"useInVmCreationPermission\":\"Default\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"f\"},{\"resourceId\":\"bmq\",\"labSubnetName\":\"hntasfaymx\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{},\"virtualNetworkPoolName\":\"lbm\"}],\"createdDate\":\"2021-06-17T18:40:22Z\",\"provisioningState\":\"jwy\",\"uniqueIdentifier\":\"kmbtsuahx\"},\"tags\":{\"wsdrnpxqwodif\":\"jcmmzrrscub\",\"jogjonmc\":\"jxcjrmmuabwib\",\"oyzbamwineofvf\":\"e\"},\"location\":\"kpoldtvevboc\",\"id\":\"hzjkn\",\"name\":\"uxgvttxpnr\",\"type\":\"pzaamrdixtreki\"}],\"nextLink\":\"wyskbruffgll\"}") .toObject(VirtualNetworkList.class); - Assertions.assertEquals("eaclgschorimk", model.value().get(0).location()); - Assertions.assertEquals("rmoucsofl", model.value().get(0).tags().get("puviyfcaabe")); - Assertions.assertEquals("ibidmhmwffp", model.value().get(0).allowedSubnets().get(0).resourceId()); - Assertions.assertEquals("muvapc", model.value().get(0).allowedSubnets().get(0).labSubnetName()); - Assertions.assertEquals(UsagePermissionType.DEFAULT, - model.value().get(0).allowedSubnets().get(0).allowPublicIp()); - Assertions.assertEquals("rv", model.value().get(0).description()); - Assertions.assertEquals("yoxoy", model.value().get(0).externalProviderResourceId()); - Assertions.assertEquals("apyyrmfsvbpavbo", model.value().get(0).subnetOverrides().get(0).resourceId()); - Assertions.assertEquals("ppdbwnupgahxkum", model.value().get(0).subnetOverrides().get(0).labSubnetName()); - Assertions.assertEquals(UsagePermissionType.DENY, - model.value().get(0).subnetOverrides().get(0).useInVmCreationPermission()); + Assertions.assertEquals("iygbpvn", model.value().get(0).tags().get("swmtxk")); + Assertions.assertEquals("hnqoewdo", model.value().get(0).location()); + Assertions.assertEquals("fkmroc", model.value().get(0).allowedSubnets().get(0).resourceId()); + Assertions.assertEquals("e", model.value().get(0).allowedSubnets().get(0).labSubnetName()); Assertions.assertEquals(UsagePermissionType.ALLOW, - model.value().get(0).subnetOverrides().get(0).usePublicIpAddressPermission()); - Assertions.assertEquals("fdmmcpug", model.value().get(0).subnetOverrides().get(0).virtualNetworkPoolName()); - Assertions.assertEquals("mdesqp", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkList model = new VirtualNetworkList().withValue(Arrays.asList( - new VirtualNetworkInner().withLocation("eaclgschorimk") - .withTags(mapOf("puviyfcaabe", "rmoucsofl")) - .withAllowedSubnets(Arrays.asList(new Subnet().withResourceId("ibidmhmwffp") - .withLabSubnetName("muvapc") - .withAllowPublicIp(UsagePermissionType.DEFAULT))) - .withDescription("rv") - .withExternalProviderResourceId("yoxoy") - .withSubnetOverrides(Arrays.asList(new SubnetOverride().withResourceId("apyyrmfsvbpavbo") - .withLabSubnetName("ppdbwnupgahxkum") - .withUseInVmCreationPermission(UsagePermissionType.DENY) - .withUsePublicIpAddressPermission(UsagePermissionType.ALLOW) - .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration()) - .withVirtualNetworkPoolName("fdmmcpug"))), - new VirtualNetworkInner().withLocation("rryejylmbkzudnig") - .withTags(mapOf("wlpxuzzjg", "hotj", "qotoihiqakydiwfb", "refqy", "spodaqax", "kwpzdqtvh", "jfulbmoic", - "ipietgbe")) - .withAllowedSubnets(Arrays.asList( - new Subnet().withResourceId("lkjxnqpvwgf") - .withLabSubnetName("mhqykizmdksa") - .withAllowPublicIp(UsagePermissionType.DEFAULT), - new Subnet().withResourceId("luqvoxmycjimryv") - .withLabSubnetName("cwwp") - .withAllowPublicIp(UsagePermissionType.DENY), - new Subnet().withResourceId("w") - .withLabSubnetName("ydsx") - .withAllowPublicIp(UsagePermissionType.DENY))) - .withDescription("hecbvopwndyq") - .withExternalProviderResourceId("allklmtkhlowk") - .withSubnetOverrides(Arrays.asList(new SubnetOverride().withResourceId("f") - .withLabSubnetName("bhvjglr") - .withUseInVmCreationPermission(UsagePermissionType.DENY) - .withUsePublicIpAddressPermission(UsagePermissionType.ALLOW) - .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration()) - .withVirtualNetworkPoolName("hhmemhooclutnp"))), - new VirtualNetworkInner().withLocation("nzqtpjhmqrhvt") - .withTags(mapOf("xetlgydlhqv", "iwdcxsmlzzhzd", "pxy", "n", "klbyulidwcw", "afiqgeaarbgjekg", "hj", - "mzegjon")) - .withAllowedSubnets(Arrays.asList(new Subnet().withResourceId("ju") - .withLabSubnetName("lrvkmjc") - .withAllowPublicIp(UsagePermissionType.DEFAULT))) - .withDescription("lgfggcvk") - .withExternalProviderResourceId("lizrzbjpsfxsfuz") - .withSubnetOverrides(Arrays.asList( - new SubnetOverride().withResourceId("ikzoeovvtzejetj") - .withLabSubnetName("nt") - .withUseInVmCreationPermission(UsagePermissionType.DENY) - .withUsePublicIpAddressPermission(UsagePermissionType.DEFAULT) - .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration()) - .withVirtualNetworkPoolName("dbqzolxrzvhqjw"), - new SubnetOverride().withResourceId("htgv") - .withLabSubnetName("pcrrk") - .withUseInVmCreationPermission(UsagePermissionType.DENY) - .withUsePublicIpAddressPermission(UsagePermissionType.DENY) - .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration()) - .withVirtualNetworkPoolName("smwr"), - new SubnetOverride().withResourceId("cdxfzzzwyjafitl") - .withLabSubnetName("uy") - .withUseInVmCreationPermission(UsagePermissionType.ALLOW) - .withUsePublicIpAddressPermission(UsagePermissionType.DEFAULT) - .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration()) - .withVirtualNetworkPoolName("ltxdwhmozu"), - new SubnetOverride().withResourceId("zvlnsnnjz") - .withLabSubnetName("afolpymwamxqzrag") - .withUseInVmCreationPermission(UsagePermissionType.DENY) - .withUsePublicIpAddressPermission(UsagePermissionType.DENY) - .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration()) - .withVirtualNetworkPoolName("dulajvlejchcs"))), - new VirtualNetworkInner().withLocation("swkacvej") - .withTags( - mapOf("pqthehnmnaoya", "vlvhbwrnfxtgd", "t", "kcoeqswank", "ktgj", "tmhdroznnhdr", "eml", "sggux")) - .withAllowedSubnets(Arrays.asList( - new Subnet().withResourceId("ua") - .withLabSubnetName("tomflrytswfpf") - .withAllowPublicIp(UsagePermissionType.ALLOW), - new Subnet().withResourceId("cxnmskwhqjjyslu") - .withLabSubnetName("pshhkvpedwqslsr") - .withAllowPublicIp(UsagePermissionType.ALLOW), - new Subnet().withResourceId("vwwskondcbr") - .withLabSubnetName("muvqejosovyr") - .withAllowPublicIp(UsagePermissionType.DENY))) - .withDescription("esi") - .withExternalProviderResourceId("qtljqobbpihehc") - .withSubnetOverrides(Arrays.asList(new SubnetOverride().withResourceId("hpwpgddeimawzovg") - .withLabSubnetName("um") - .withUseInVmCreationPermission(UsagePermissionType.DEFAULT) - .withUsePublicIpAddressPermission(UsagePermissionType.DEFAULT) - .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration()) - .withVirtualNetworkPoolName("aztb"))))) - .withNextLink("mdesqp"); - model = BinaryData.fromObject(model).toObject(VirtualNetworkList.class); - Assertions.assertEquals("eaclgschorimk", model.value().get(0).location()); - Assertions.assertEquals("rmoucsofl", model.value().get(0).tags().get("puviyfcaabe")); - Assertions.assertEquals("ibidmhmwffp", model.value().get(0).allowedSubnets().get(0).resourceId()); - Assertions.assertEquals("muvapc", model.value().get(0).allowedSubnets().get(0).labSubnetName()); - Assertions.assertEquals(UsagePermissionType.DEFAULT, model.value().get(0).allowedSubnets().get(0).allowPublicIp()); - Assertions.assertEquals("rv", model.value().get(0).description()); - Assertions.assertEquals("yoxoy", model.value().get(0).externalProviderResourceId()); - Assertions.assertEquals("apyyrmfsvbpavbo", model.value().get(0).subnetOverrides().get(0).resourceId()); - Assertions.assertEquals("ppdbwnupgahxkum", model.value().get(0).subnetOverrides().get(0).labSubnetName()); - Assertions.assertEquals(UsagePermissionType.DENY, + Assertions.assertEquals("sxlghieegjlg", model.value().get(0).description()); + Assertions.assertEquals("paseksgb", model.value().get(0).externalProviderResourceId()); + Assertions.assertEquals("kg", model.value().get(0).subnetOverrides().get(0).resourceId()); + Assertions.assertEquals("xyf", model.value().get(0).subnetOverrides().get(0).labSubnetName()); + Assertions.assertEquals(UsagePermissionType.DEFAULT, model.value().get(0).subnetOverrides().get(0).useInVmCreationPermission()); Assertions.assertEquals(UsagePermissionType.ALLOW, model.value().get(0).subnetOverrides().get(0).usePublicIpAddressPermission()); - Assertions.assertEquals("fdmmcpug", model.value().get(0).subnetOverrides().get(0).virtualNetworkPoolName()); - Assertions.assertEquals("mdesqp", 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; + Assertions.assertEquals("rpcjttbstvjeaqnr", + model.value().get(0).subnetOverrides().get(0).virtualNetworkPoolName()); + Assertions.assertEquals("wyskbruffgll", model.nextLink()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkPropertiesTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkPropertiesTests.java index 311c2c4c3160..61011c1edfc6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkPropertiesTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworkPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -19,95 +19,99 @@ public final class VirtualNetworkPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { VirtualNetworkProperties model = BinaryData.fromString( - "{\"allowedSubnets\":[{\"resourceId\":\"leeyaswl\",\"labSubnetName\":\"ugmrmf\",\"allowPublicIp\":\"Default\"}],\"description\":\"wtoaukhfk\",\"externalProviderResourceId\":\"isizm\",\"externalSubnets\":[{\"id\":\"sx\",\"name\":\"uivedwcgyeewxeiq\"}],\"subnetOverrides\":[{\"resourceId\":\"g\",\"labSubnetName\":\"guamlj\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{\"transportProtocol\":\"Tcp\",\"backendPort\":517596277},{\"transportProtocol\":\"Tcp\",\"backendPort\":1243615425},{\"transportProtocol\":\"Udp\",\"backendPort\":1688050054},{\"transportProtocol\":\"Udp\",\"backendPort\":1018837274}]},\"virtualNetworkPoolName\":\"ympqanxrjkixtwb\"},{\"resourceId\":\"oypnyg\",\"labSubnetName\":\"hxcylhkgm\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{\"transportProtocol\":\"Tcp\",\"backendPort\":2068666218},{\"transportProtocol\":\"Udp\",\"backendPort\":615187266},{\"transportProtocol\":\"Tcp\",\"backendPort\":1407961228},{\"transportProtocol\":\"Tcp\",\"backendPort\":1784777493}]},\"virtualNetworkPoolName\":\"zvxnqmhrp\"},{\"resourceId\":\"df\",\"labSubnetName\":\"kois\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Deny\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{\"transportProtocol\":\"Udp\",\"backendPort\":2104491949},{\"transportProtocol\":\"Udp\",\"backendPort\":834790015}]},\"virtualNetworkPoolName\":\"kdqzrdzsylo\"}],\"createdDate\":\"2021-10-29T00:26:05Z\",\"provisioningState\":\"rc\",\"uniqueIdentifier\":\"ydmxzj\"}") + "{\"allowedSubnets\":[{\"resourceId\":\"grdogypxrxvbfihw\",\"labSubnetName\":\"vctafsrb\",\"allowPublicIp\":\"Default\"},{\"resourceId\":\"m\",\"labSubnetName\":\"owxih\",\"allowPublicIp\":\"Default\"},{\"resourceId\":\"wqagnepzwa\",\"labSubnetName\":\"sbs\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"agwwrxaom\",\"labSubnetName\":\"sgl\",\"allowPublicIp\":\"Allow\"}],\"description\":\"ezkhhltnjadhqo\",\"externalProviderResourceId\":\"jqoyueayfbpcm\",\"externalSubnets\":[{\"id\":\"yrrueqth\",\"name\":\"gnmbscbbxigdhx\"},{\"id\":\"d\",\"name\":\"pedbwdpyqy\"}],\"subnetOverrides\":[{\"resourceId\":\"bmdnafcbqwre\",\"labSubnetName\":\"ela\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{\"transportProtocol\":\"Udp\",\"backendPort\":1602491470},{\"transportProtocol\":\"Udp\",\"backendPort\":1699509778},{\"transportProtocol\":\"Udp\",\"backendPort\":1164316290}]},\"virtualNetworkPoolName\":\"wbeonrlkwzdqy\"},{\"resourceId\":\"ceakxc\",\"labSubnetName\":\"soqfyiaseqchkrt\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Deny\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{\"transportProtocol\":\"Tcp\",\"backendPort\":737896656}]},\"virtualNetworkPoolName\":\"mvanbwzo\"},{\"resourceId\":\"nrxxbsojklin\",\"labSubnetName\":\"dptysprqs\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{\"transportProtocol\":\"Udp\",\"backendPort\":1699692322},{\"transportProtocol\":\"Tcp\",\"backendPort\":1732036822},{\"transportProtocol\":\"Tcp\",\"backendPort\":581836469}]},\"virtualNetworkPoolName\":\"oyxqvapcohhou\"}],\"createdDate\":\"2021-02-10T02:54:50Z\",\"provisioningState\":\"oj\",\"uniqueIdentifier\":\"x\"}") .toObject(VirtualNetworkProperties.class); - Assertions.assertEquals("leeyaswl", model.allowedSubnets().get(0).resourceId()); - Assertions.assertEquals("ugmrmf", model.allowedSubnets().get(0).labSubnetName()); + Assertions.assertEquals("grdogypxrxvbfihw", model.allowedSubnets().get(0).resourceId()); + Assertions.assertEquals("vctafsrb", model.allowedSubnets().get(0).labSubnetName()); Assertions.assertEquals(UsagePermissionType.DEFAULT, model.allowedSubnets().get(0).allowPublicIp()); - Assertions.assertEquals("wtoaukhfk", model.description()); - Assertions.assertEquals("isizm", model.externalProviderResourceId()); - Assertions.assertEquals("g", model.subnetOverrides().get(0).resourceId()); - Assertions.assertEquals("guamlj", model.subnetOverrides().get(0).labSubnetName()); + Assertions.assertEquals("ezkhhltnjadhqo", model.description()); + Assertions.assertEquals("jqoyueayfbpcm", model.externalProviderResourceId()); + Assertions.assertEquals("bmdnafcbqwre", model.subnetOverrides().get(0).resourceId()); + Assertions.assertEquals("ela", model.subnetOverrides().get(0).labSubnetName()); Assertions.assertEquals(UsagePermissionType.ALLOW, model.subnetOverrides().get(0).useInVmCreationPermission()); Assertions.assertEquals(UsagePermissionType.DEFAULT, model.subnetOverrides().get(0).usePublicIpAddressPermission()); - Assertions.assertEquals(TransportProtocol.TCP, + Assertions.assertEquals(TransportProtocol.UDP, model.subnetOverrides() .get(0) .sharedPublicIpAddressConfiguration() .allowedPorts() .get(0) .transportProtocol()); - Assertions.assertEquals(517596277, + Assertions.assertEquals(1602491470, model.subnetOverrides().get(0).sharedPublicIpAddressConfiguration().allowedPorts().get(0).backendPort()); - Assertions.assertEquals("ympqanxrjkixtwb", model.subnetOverrides().get(0).virtualNetworkPoolName()); + Assertions.assertEquals("wbeonrlkwzdqy", model.subnetOverrides().get(0).virtualNetworkPoolName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - VirtualNetworkProperties model - = new VirtualNetworkProperties() - .withAllowedSubnets(Arrays.asList(new Subnet().withResourceId("leeyaswl") - .withLabSubnetName("ugmrmf") - .withAllowPublicIp(UsagePermissionType.DEFAULT))) - .withDescription("wtoaukhfk") - .withExternalProviderResourceId("isizm") - .withSubnetOverrides( - Arrays.asList( - new SubnetOverride().withResourceId("g") - .withLabSubnetName("guamlj") + VirtualNetworkProperties model = new VirtualNetworkProperties().withAllowedSubnets(Arrays.asList( + new Subnet().withResourceId("grdogypxrxvbfihw") + .withLabSubnetName("vctafsrb") + .withAllowPublicIp(UsagePermissionType.DEFAULT), + new Subnet().withResourceId("m").withLabSubnetName("owxih").withAllowPublicIp(UsagePermissionType.DEFAULT), + new Subnet().withResourceId("wqagnepzwa") + .withLabSubnetName("sbs") + .withAllowPublicIp(UsagePermissionType.ALLOW), + new Subnet().withResourceId("agwwrxaom") + .withLabSubnetName("sgl") + .withAllowPublicIp(UsagePermissionType.ALLOW))) + .withDescription("ezkhhltnjadhqo") + .withExternalProviderResourceId("jqoyueayfbpcm") + .withSubnetOverrides( + Arrays + .asList( + new SubnetOverride().withResourceId("bmdnafcbqwre") + .withLabSubnetName("ela") .withUseInVmCreationPermission(UsagePermissionType.ALLOW) .withUsePublicIpAddressPermission(UsagePermissionType.DEFAULT) .withSharedPublicIpAddressConfiguration( new SubnetSharedPublicIpAddressConfiguration().withAllowedPorts(Arrays.asList( - new Port().withTransportProtocol(TransportProtocol.TCP).withBackendPort(517596277), - new Port().withTransportProtocol(TransportProtocol.TCP).withBackendPort(1243615425), - new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(1688050054), + new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(1602491470), + new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(1699509778), new Port().withTransportProtocol(TransportProtocol.UDP) - .withBackendPort(1018837274)))) - .withVirtualNetworkPoolName("ympqanxrjkixtwb"), - new SubnetOverride().withResourceId("oypnyg") - .withLabSubnetName("hxcylhkgm") - .withUseInVmCreationPermission(UsagePermissionType.DENY) - .withUsePublicIpAddressPermission(UsagePermissionType.ALLOW) - .withSharedPublicIpAddressConfiguration( - new SubnetSharedPublicIpAddressConfiguration().withAllowedPorts(Arrays.asList( - new Port().withTransportProtocol(TransportProtocol.TCP).withBackendPort(2068666218), - new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(615187266), - new Port().withTransportProtocol(TransportProtocol.TCP).withBackendPort(1407961228), - new Port().withTransportProtocol(TransportProtocol.TCP) - .withBackendPort(1784777493)))) - .withVirtualNetworkPoolName("zvxnqmhrp"), - new SubnetOverride().withResourceId("df") - .withLabSubnetName("kois") + .withBackendPort(1164316290)))) + .withVirtualNetworkPoolName("wbeonrlkwzdqy"), + new SubnetOverride().withResourceId("ceakxc") + .withLabSubnetName("soqfyiaseqchkrt") .withUseInVmCreationPermission(UsagePermissionType.ALLOW) .withUsePublicIpAddressPermission(UsagePermissionType.DENY) + .withSharedPublicIpAddressConfiguration( + new SubnetSharedPublicIpAddressConfiguration().withAllowedPorts( + Arrays.asList(new Port().withTransportProtocol(TransportProtocol.TCP) + .withBackendPort(737896656)))) + .withVirtualNetworkPoolName("mvanbwzo"), + new SubnetOverride().withResourceId("nrxxbsojklin") + .withLabSubnetName("dptysprqs") + .withUseInVmCreationPermission(UsagePermissionType.DENY) + .withUsePublicIpAddressPermission(UsagePermissionType.DEFAULT) .withSharedPublicIpAddressConfiguration( new SubnetSharedPublicIpAddressConfiguration().withAllowedPorts(Arrays.asList( - new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(2104491949), - new Port().withTransportProtocol(TransportProtocol.UDP) - .withBackendPort(834790015)))) - .withVirtualNetworkPoolName("kdqzrdzsylo"))); + new Port().withTransportProtocol(TransportProtocol.UDP).withBackendPort(1699692322), + new Port().withTransportProtocol(TransportProtocol.TCP).withBackendPort(1732036822), + new Port().withTransportProtocol(TransportProtocol.TCP) + .withBackendPort(581836469)))) + .withVirtualNetworkPoolName("oyxqvapcohhou"))); model = BinaryData.fromObject(model).toObject(VirtualNetworkProperties.class); - Assertions.assertEquals("leeyaswl", model.allowedSubnets().get(0).resourceId()); - Assertions.assertEquals("ugmrmf", model.allowedSubnets().get(0).labSubnetName()); + Assertions.assertEquals("grdogypxrxvbfihw", model.allowedSubnets().get(0).resourceId()); + Assertions.assertEquals("vctafsrb", model.allowedSubnets().get(0).labSubnetName()); Assertions.assertEquals(UsagePermissionType.DEFAULT, model.allowedSubnets().get(0).allowPublicIp()); - Assertions.assertEquals("wtoaukhfk", model.description()); - Assertions.assertEquals("isizm", model.externalProviderResourceId()); - Assertions.assertEquals("g", model.subnetOverrides().get(0).resourceId()); - Assertions.assertEquals("guamlj", model.subnetOverrides().get(0).labSubnetName()); + Assertions.assertEquals("ezkhhltnjadhqo", model.description()); + Assertions.assertEquals("jqoyueayfbpcm", model.externalProviderResourceId()); + Assertions.assertEquals("bmdnafcbqwre", model.subnetOverrides().get(0).resourceId()); + Assertions.assertEquals("ela", model.subnetOverrides().get(0).labSubnetName()); Assertions.assertEquals(UsagePermissionType.ALLOW, model.subnetOverrides().get(0).useInVmCreationPermission()); Assertions.assertEquals(UsagePermissionType.DEFAULT, model.subnetOverrides().get(0).usePublicIpAddressPermission()); - Assertions.assertEquals(TransportProtocol.TCP, + Assertions.assertEquals(TransportProtocol.UDP, model.subnetOverrides() .get(0) .sharedPublicIpAddressConfiguration() .allowedPorts() .get(0) .transportProtocol()); - Assertions.assertEquals(517596277, + Assertions.assertEquals(1602491470, model.subnetOverrides().get(0).sharedPublicIpAddressConfiguration().allowedPorts().get(0).backendPort()); - Assertions.assertEquals("ympqanxrjkixtwb", model.subnetOverrides().get(0).virtualNetworkPoolName()); + Assertions.assertEquals("wbeonrlkwzdqy", model.subnetOverrides().get(0).virtualNetworkPoolName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateMockTests.java index 6f07a5f11226..cafdbde99c99 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.Port; @@ -29,56 +29,74 @@ public final class VirtualNetworksCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"yckyvne\",\"labSubnetName\":\"muffiwjbctvbpzu\",\"allowPublicIp\":\"Default\"}],\"description\":\"otdxpo\",\"externalProviderResourceId\":\"slhwuusieckty\",\"externalSubnets\":[{\"id\":\"xidhhxomil\",\"name\":\"xj\"}],\"subnetOverrides\":[{\"resourceId\":\"xwjwilm\",\"labSubnetName\":\"sl\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Deny\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{}]},\"virtualNetworkPoolName\":\"jz\"},{\"resourceId\":\"qgq\",\"labSubnetName\":\"xr\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Deny\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{}]},\"virtualNetworkPoolName\":\"ykbkkteozejogmk\"},{\"resourceId\":\"vvmvmcofn\",\"labSubnetName\":\"lbsnosnqliw\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{}]},\"virtualNetworkPoolName\":\"alhtgmknaz\"},{\"resourceId\":\"jbhrpgiqsttcu\",\"labSubnetName\":\"cmmaixpqjiw\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Deny\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{}]},\"virtualNetworkPoolName\":\"tohqclna\"}],\"createdDate\":\"2021-01-30T09:04:29Z\",\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"glxkoikmtrawrqk\"},\"location\":\"awbunmpaklw\",\"tags\":{\"kaszfjsxscbdu\":\"eeprnejzl\"},\"id\":\"apgrcqe\",\"name\":\"mvrdjomlnwsbv\",\"type\":\"dls\"}"; + = "{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"otyxbrii\",\"labSubnetName\":\"f\",\"allowPublicIp\":\"Default\"},{\"resourceId\":\"vrqoemwsi\",\"labSubnetName\":\"ailwdqmqfyd\",\"allowPublicIp\":\"Deny\"}],\"description\":\"fxlkd\",\"externalProviderResourceId\":\"wgnamkuuy\",\"externalSubnets\":[{\"id\":\"afixlxicwgpthd\",\"name\":\"mfzcfasfodropalv\"},{\"id\":\"tw\",\"name\":\"skwgqr\"},{\"id\":\"au\",\"name\":\"rcjlvkrkegtyczup\"}],\"subnetOverrides\":[{\"resourceId\":\"lzmiyddeeq\",\"labSubnetName\":\"vab\",\"useInVmCreationPermission\":\"Default\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{},{}]},\"virtualNetworkPoolName\":\"tbapfcz\"}],\"createdDate\":\"2021-04-24T15:56:20Z\",\"provisioningState\":\"Succeeded\",\"uniqueIdentifier\":\"xvb\"},\"tags\":{\"hmsritjbui\":\"hyegb\"},\"location\":\"runozfvual\",\"id\":\"hoivsdws\",\"name\":\"gkrfi\",\"type\":\"sc\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); VirtualNetwork response = manager.virtualNetworks() - .define("hefr") - .withRegion("lxxzqfcwrriomxee") - .withExistingLab("ryldsxeb", "hsxrznmgsdaluyc") - .withTags(mapOf("egmxdbsohc", "hjmbji")) - .withAllowedSubnets(Arrays.asList(new Subnet().withResourceId("erbgpxeb") - .withLabSubnetName("udcaytujrax") - .withAllowPublicIp(UsagePermissionType.DEFAULT))) - .withDescription("yjmgtnsewo") - .withExternalProviderResourceId("ly") + .define("a") + .withExistingLab("gyedzfzqi", "uqhtdereuno") + .withRegion("ummmkvavucgji") + .withTags(mapOf("jojlle", "vvpxjoeg", "hgnhtmeplhbpjba", "idpmton")) + .withAllowedSubnets(Arrays.asList( + new Subnet().withResourceId("pjlwyxe") + .withLabSubnetName("nmxrfomckewvmyi") + .withAllowPublicIp(UsagePermissionType.ALLOW), + new Subnet().withResourceId("fjjtpdyzou") + .withLabSubnetName("fptofhgnuywez") + .withAllowPublicIp(UsagePermissionType.DEFAULT))) + .withDescription("dgaaqwvkgjpy") + .withExternalProviderResourceId("mpvdnogeh") .withSubnetOverrides(Arrays.asList( - new SubnetOverride().withResourceId("wjopackyhydvik") - .withLabSubnetName("ngpmillxgjsci") + new SubnetOverride().withResourceId("ktlpdibfmthieat") + .withLabSubnetName("jrnm") .withUseInVmCreationPermission(UsagePermissionType.DENY) - .withUsePublicIpAddressPermission(UsagePermissionType.DEFAULT) + .withUsePublicIpAddressPermission(UsagePermissionType.ALLOW) + .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration() + .withAllowedPorts(Arrays.asList(new Port(), new Port(), new Port()))) + .withVirtualNetworkPoolName("ih"), + new SubnetOverride().withResourceId("ikzsrzfffji") + .withLabSubnetName("fbpntogke") + .withUseInVmCreationPermission(UsagePermissionType.DEFAULT) + .withUsePublicIpAddressPermission(UsagePermissionType.ALLOW) .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration() .withAllowedPorts(Arrays.asList(new Port(), new Port()))) - .withVirtualNetworkPoolName("ijeiyd"), - new SubnetOverride().withResourceId("uynhbokayrgwybr") - .withLabSubnetName("pdweoft") - .withUseInVmCreationPermission(UsagePermissionType.DENY) + .withVirtualNetworkPoolName("rmoyfxxkwykuq"), + new SubnetOverride().withResourceId("dxlykhkggapvdgt") + .withLabSubnetName("eerscdxrnrnjrcu") + .withUseInVmCreationPermission(UsagePermissionType.DEFAULT) .withUsePublicIpAddressPermission(UsagePermissionType.ALLOW) .withSharedPublicIpAddressConfiguration( new SubnetSharedPublicIpAddressConfiguration().withAllowedPorts(Arrays.asList(new Port()))) - .withVirtualNetworkPoolName("octqkmvjanxvzf"))) + .withVirtualNetworkPoolName("fdtncmspsanma"), + new SubnetOverride().withResourceId("ubkqiq") + .withLabSubnetName("fv") + .withUseInVmCreationPermission(UsagePermissionType.DENY) + .withUsePublicIpAddressPermission(UsagePermissionType.DENY) + .withSharedPublicIpAddressConfiguration(new SubnetSharedPublicIpAddressConfiguration() + .withAllowedPorts(Arrays.asList(new Port(), new Port()))) + .withVirtualNetworkPoolName("mx"))) .create(); - Assertions.assertEquals("awbunmpaklw", response.location()); - Assertions.assertEquals("eeprnejzl", response.tags().get("kaszfjsxscbdu")); - Assertions.assertEquals("yckyvne", response.allowedSubnets().get(0).resourceId()); - Assertions.assertEquals("muffiwjbctvbpzu", response.allowedSubnets().get(0).labSubnetName()); + Assertions.assertEquals("hyegb", response.tags().get("hmsritjbui")); + Assertions.assertEquals("runozfvual", response.location()); + Assertions.assertEquals("otyxbrii", response.allowedSubnets().get(0).resourceId()); + Assertions.assertEquals("f", response.allowedSubnets().get(0).labSubnetName()); Assertions.assertEquals(UsagePermissionType.DEFAULT, response.allowedSubnets().get(0).allowPublicIp()); - Assertions.assertEquals("otdxpo", response.description()); - Assertions.assertEquals("slhwuusieckty", response.externalProviderResourceId()); - Assertions.assertEquals("xwjwilm", response.subnetOverrides().get(0).resourceId()); - Assertions.assertEquals("sl", response.subnetOverrides().get(0).labSubnetName()); - Assertions.assertEquals(UsagePermissionType.ALLOW, + Assertions.assertEquals("fxlkd", response.description()); + Assertions.assertEquals("wgnamkuuy", response.externalProviderResourceId()); + Assertions.assertEquals("lzmiyddeeq", response.subnetOverrides().get(0).resourceId()); + Assertions.assertEquals("vab", response.subnetOverrides().get(0).labSubnetName()); + Assertions.assertEquals(UsagePermissionType.DEFAULT, response.subnetOverrides().get(0).useInVmCreationPermission()); - Assertions.assertEquals(UsagePermissionType.DENY, + Assertions.assertEquals(UsagePermissionType.ALLOW, response.subnetOverrides().get(0).usePublicIpAddressPermission()); - Assertions.assertEquals("jz", response.subnetOverrides().get(0).virtualNetworkPoolName()); + Assertions.assertEquals("tbapfcz", response.subnetOverrides().get(0).virtualNetworkPoolName()); } // Use "Map.of" if available diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteMockTests.java index a70cea83263c..aa7dfdb0f8bb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { DevTestLabsManager manager = DevTestLabsManager.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.virtualNetworks().delete("roigbsfsgsaenwld", "mhljqlxspm", "jc", com.azure.core.util.Context.NONE); + manager.virtualNetworks().delete("dkqiyv", "djokgwesym", "qh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetWithResponseMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetWithResponseMockTests.java index d1508f396769..a3c0e4ea0286 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetWithResponseMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetWithResponseMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.UsagePermissionType; @@ -22,33 +22,32 @@ public final class VirtualNetworksGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"ngojfsqebuuxjx\",\"labSubnetName\":\"xfjwp\",\"allowPublicIp\":\"Deny\"},{\"resourceId\":\"p\",\"labSubnetName\":\"mxbmbrwgzzxljbkh\",\"allowPublicIp\":\"Default\"},{\"resourceId\":\"laumydmhweqjf\",\"labSubnetName\":\"ydgtokvqbvwgl\",\"allowPublicIp\":\"Deny\"},{\"resourceId\":\"vxakglh\",\"labSubnetName\":\"esrfgamqiydvx\",\"allowPublicIp\":\"Deny\"}],\"description\":\"yhgoq\",\"externalProviderResourceId\":\"oyqyxyjrcbqpb\",\"externalSubnets\":[{\"id\":\"lqjoxtda\",\"name\":\"eaoo\"},{\"id\":\"yjz\",\"name\":\"vfwjlo\"}],\"subnetOverrides\":[{\"resourceId\":\"fsr\",\"labSubnetName\":\"uklajvcfoc\",\"useInVmCreationPermission\":\"Default\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{}]},\"virtualNetworkPoolName\":\"kwxnhwhhnoyrza\"},{\"resourceId\":\"ee\",\"labSubnetName\":\"mjenvjeatea\",\"useInVmCreationPermission\":\"Default\",\"usePublicIpAddressPermission\":\"Deny\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{},{},{}]},\"virtualNetworkPoolName\":\"xldnaryy\"}],\"createdDate\":\"2021-09-14T08:54:41Z\",\"provisioningState\":\"dolrndw\",\"uniqueIdentifier\":\"vxvzaledoyqxlun\"},\"location\":\"fthmcxqqxmy\",\"tags\":{\"a\":\"a\",\"rqra\":\"pohrvm\",\"ivznllas\":\"a\"},\"id\":\"k\",\"name\":\"khjqjpvbaihxjtg\",\"type\":\"gtaiywbq\"}"; + = "{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"osnqliwkmzojfe\",\"labSubnetName\":\"alhtgmknaz\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"hrp\",\"labSubnetName\":\"qs\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"crcmmaixp\",\"labSubnetName\":\"iwifhbk\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"tohqclna\",\"labSubnetName\":\"tgs\",\"allowPublicIp\":\"Allow\"}],\"description\":\"vllrhtpmglxk\",\"externalProviderResourceId\":\"km\",\"externalSubnets\":[{\"id\":\"rqkzawbunmpak\",\"name\":\"z\"}],\"subnetOverrides\":[{\"resourceId\":\"prnejzltkaszf\",\"labSubnetName\":\"xscbduxapgrcqe\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{},{}]},\"virtualNetworkPoolName\":\"nwsb\"},{\"resourceId\":\"dls\",\"labSubnetName\":\"x\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{}]},\"virtualNetworkPoolName\":\"bgzancoinmphymcq\"},{\"resourceId\":\"kltvdhqnufbx\",\"labSubnetName\":\"iibntojo\",\"useInVmCreationPermission\":\"Default\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{}]},\"virtualNetworkPoolName\":\"ihaouwudhua\"}],\"createdDate\":\"2021-09-23T08:57:31Z\",\"provisioningState\":\"kehwvumosqirca\",\"uniqueIdentifier\":\"prlobrugejcvjkjy\"},\"tags\":{\"eqyxqfmzsiz\":\"mtagelajdyol\",\"jymgqbgcxhn\":\"hravrcj\",\"hskirhnp\":\"xgzxlermkmer\"},\"location\":\"kcbkfukdlj\",\"id\":\"vtsdydshkpafy\",\"name\":\"loowwzizznyufp\",\"type\":\"zstifgufyj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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)); VirtualNetwork response = manager.virtualNetworks() - .getWithResponse("wsnmrkkyjt", "epwpwfk", "auxuvavcpfpdofu", "kclbtxluevsol", - com.azure.core.util.Context.NONE) + .getWithResponse("vhvtq", "ykbkkteozejogmk", "rvvmvmcofn", "h", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("fthmcxqqxmy", response.location()); - Assertions.assertEquals("a", response.tags().get("a")); - Assertions.assertEquals("ngojfsqebuuxjx", response.allowedSubnets().get(0).resourceId()); - Assertions.assertEquals("xfjwp", response.allowedSubnets().get(0).labSubnetName()); - Assertions.assertEquals(UsagePermissionType.DENY, response.allowedSubnets().get(0).allowPublicIp()); - Assertions.assertEquals("yhgoq", response.description()); - Assertions.assertEquals("oyqyxyjrcbqpb", response.externalProviderResourceId()); - Assertions.assertEquals("fsr", response.subnetOverrides().get(0).resourceId()); - Assertions.assertEquals("uklajvcfoc", response.subnetOverrides().get(0).labSubnetName()); - Assertions.assertEquals(UsagePermissionType.DEFAULT, + Assertions.assertEquals("mtagelajdyol", response.tags().get("eqyxqfmzsiz")); + Assertions.assertEquals("kcbkfukdlj", response.location()); + Assertions.assertEquals("osnqliwkmzojfe", response.allowedSubnets().get(0).resourceId()); + Assertions.assertEquals("alhtgmknaz", response.allowedSubnets().get(0).labSubnetName()); + Assertions.assertEquals(UsagePermissionType.ALLOW, response.allowedSubnets().get(0).allowPublicIp()); + Assertions.assertEquals("vllrhtpmglxk", response.description()); + Assertions.assertEquals("km", response.externalProviderResourceId()); + Assertions.assertEquals("prnejzltkaszf", response.subnetOverrides().get(0).resourceId()); + Assertions.assertEquals("xscbduxapgrcqe", response.subnetOverrides().get(0).labSubnetName()); + Assertions.assertEquals(UsagePermissionType.DENY, response.subnetOverrides().get(0).useInVmCreationPermission()); - Assertions.assertEquals(UsagePermissionType.ALLOW, + Assertions.assertEquals(UsagePermissionType.DEFAULT, response.subnetOverrides().get(0).usePublicIpAddressPermission()); - Assertions.assertEquals("kwxnhwhhnoyrza", response.subnetOverrides().get(0).virtualNetworkPoolName()); + Assertions.assertEquals("nwsb", response.subnetOverrides().get(0).virtualNetworkPoolName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListMockTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListMockTests.java index 6e41fae5c359..eb97f2f15254 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListMockTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListMockTests.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.devtestlabs.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.devtestlabs.DevTestLabsManager; import com.azure.resourcemanager.devtestlabs.models.UsagePermissionType; @@ -23,33 +23,33 @@ public final class VirtualNetworksListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"yjfzi\",\"labSubnetName\":\"io\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"pajtfeyvkbd\",\"labSubnetName\":\"dkrhdccxbe\",\"allowPublicIp\":\"Deny\"}],\"description\":\"tkzwtj\",\"externalProviderResourceId\":\"guzytijc\",\"externalSubnets\":[{\"id\":\"ndegjdydhqkkkbj\",\"name\":\"kcat\"},{\"id\":\"bhpowcnxtpzdlys\",\"name\":\"dtoakatpryt\"},{\"id\":\"hzbqfdpfawrptvcs\",\"name\":\"kutzct\"}],\"subnetOverrides\":[{\"resourceId\":\"dirdammtzjgc\",\"labSubnetName\":\"fxtbwjjirmuydg\",\"useInVmCreationPermission\":\"Default\",\"usePublicIpAddressPermission\":\"Allow\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{},{}]},\"virtualNetworkPoolName\":\"oagfuoftnxodwx\"},{\"resourceId\":\"aj\",\"labSubnetName\":\"ygmgsevm\",\"useInVmCreationPermission\":\"Deny\",\"usePublicIpAddressPermission\":\"Default\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{}]},\"virtualNetworkPoolName\":\"gfc\"}],\"createdDate\":\"2021-02-10T10:42:45Z\",\"provisioningState\":\"n\",\"uniqueIdentifier\":\"dtjva\"},\"location\":\"yyznmrgcdogcvuc\",\"tags\":{\"bgszplusdek\":\"oxuwhttnzqsaqm\"},\"id\":\"dzzmssgpgv\",\"name\":\"kyejidbdq\",\"type\":\"squnycwztlv\"}]}"; + = "{\"value\":[{\"properties\":{\"allowedSubnets\":[{\"resourceId\":\"aczkf\",\"labSubnetName\":\"atgawphnsk\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"gtqcumecsaaqgoq\",\"labSubnetName\":\"iuycsbskowk\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"hrbkhtmqowi\",\"labSubnetName\":\"sfgqgucyhfaimqv\",\"allowPublicIp\":\"Allow\"},{\"resourceId\":\"zkgyfpeoe\",\"labSubnetName\":\"fm\",\"allowPublicIp\":\"Deny\"}],\"description\":\"kixvlzjxplh\",\"externalProviderResourceId\":\"vasyntv\",\"externalSubnets\":[{\"id\":\"elbqrvvbqvkn\",\"name\":\"ecqxgiqasifubns\"},{\"id\":\"tlpwqpjnxjkhtups\",\"name\":\"ouweuiyx\"}],\"subnetOverrides\":[{\"resourceId\":\"tsmsfbev\",\"labSubnetName\":\"lznfhkqytkztado\",\"useInVmCreationPermission\":\"Allow\",\"usePublicIpAddressPermission\":\"Deny\",\"sharedPublicIpAddressConfiguration\":{\"allowedPorts\":[{},{},{}]},\"virtualNetworkPoolName\":\"yc\"}],\"createdDate\":\"2021-10-09T12:01:28Z\",\"provisioningState\":\"oyyhigqk\",\"uniqueIdentifier\":\"uqw\"},\"tags\":{\"bgsosc\":\"quzxpixhyoipnf\",\"rtek\":\"enezfvbennmfkbpj\"},\"location\":\"nthropmdudsyiu\",\"id\":\"tvktjhffecqko\",\"name\":\"youergaghp\",\"type\":\"zxkpyehhfdyld\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DevTestLabsManager manager = DevTestLabsManager.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.virtualNetworks() - .list("z", "pvwdtgckzdqiq", "lrat", "kwx", 2099822665, "uwxsuykznhrfgsl", com.azure.core.util.Context.NONE); + .list("qpfzlpejtznxlue", "ujqbbgsimwejl", "bkbpjzobd", "bcpr", 1047118748, "wkuh", + com.azure.core.util.Context.NONE); - Assertions.assertEquals("yyznmrgcdogcvuc", response.iterator().next().location()); - Assertions.assertEquals("oxuwhttnzqsaqm", response.iterator().next().tags().get("bgszplusdek")); - Assertions.assertEquals("yjfzi", response.iterator().next().allowedSubnets().get(0).resourceId()); - Assertions.assertEquals("io", response.iterator().next().allowedSubnets().get(0).labSubnetName()); + Assertions.assertEquals("quzxpixhyoipnf", response.iterator().next().tags().get("bgsosc")); + Assertions.assertEquals("nthropmdudsyiu", response.iterator().next().location()); + Assertions.assertEquals("aczkf", response.iterator().next().allowedSubnets().get(0).resourceId()); + Assertions.assertEquals("atgawphnsk", response.iterator().next().allowedSubnets().get(0).labSubnetName()); Assertions.assertEquals(UsagePermissionType.ALLOW, response.iterator().next().allowedSubnets().get(0).allowPublicIp()); - Assertions.assertEquals("tkzwtj", response.iterator().next().description()); - Assertions.assertEquals("guzytijc", response.iterator().next().externalProviderResourceId()); - Assertions.assertEquals("dirdammtzjgc", response.iterator().next().subnetOverrides().get(0).resourceId()); - Assertions.assertEquals("fxtbwjjirmuydg", response.iterator().next().subnetOverrides().get(0).labSubnetName()); - Assertions.assertEquals(UsagePermissionType.DEFAULT, - response.iterator().next().subnetOverrides().get(0).useInVmCreationPermission()); + Assertions.assertEquals("kixvlzjxplh", response.iterator().next().description()); + Assertions.assertEquals("vasyntv", response.iterator().next().externalProviderResourceId()); + Assertions.assertEquals("tsmsfbev", response.iterator().next().subnetOverrides().get(0).resourceId()); + Assertions.assertEquals("lznfhkqytkztado", response.iterator().next().subnetOverrides().get(0).labSubnetName()); Assertions.assertEquals(UsagePermissionType.ALLOW, + response.iterator().next().subnetOverrides().get(0).useInVmCreationPermission()); + Assertions.assertEquals(UsagePermissionType.DENY, response.iterator().next().subnetOverrides().get(0).usePublicIpAddressPermission()); - Assertions.assertEquals("oagfuoftnxodwx", - response.iterator().next().subnetOverrides().get(0).virtualNetworkPoolName()); + Assertions.assertEquals("yc", response.iterator().next().subnetOverrides().get(0).virtualNetworkPoolName()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/WeekDetailsTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/WeekDetailsTests.java index c06bcf4da72a..6e938bc9757a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/WeekDetailsTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/WeekDetailsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -14,19 +14,18 @@ public final class WeekDetailsTests { public void testDeserialize() throws Exception { WeekDetails model = BinaryData .fromString( - "{\"weekdays\":[\"nermcl\",\"plpho\",\"uscrpabgyepsb\",\"tazqugxywpmueefj\"],\"time\":\"fqkquj\"}") + "{\"weekdays\":[\"moryocfsfksym\",\"dystkiiuxhqyud\",\"o\",\"rq\"],\"time\":\"poczvyifqrvkdvjs\"}") .toObject(WeekDetails.class); - Assertions.assertEquals("nermcl", model.weekdays().get(0)); - Assertions.assertEquals("fqkquj", model.time()); + Assertions.assertEquals("moryocfsfksym", model.weekdays().get(0)); + Assertions.assertEquals("poczvyifqrvkdvjs", model.time()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WeekDetails model - = new WeekDetails().withWeekdays(Arrays.asList("nermcl", "plpho", "uscrpabgyepsb", "tazqugxywpmueefj")) - .withTime("fqkquj"); + WeekDetails model = new WeekDetails().withWeekdays(Arrays.asList("moryocfsfksym", "dystkiiuxhqyud", "o", "rq")) + .withTime("poczvyifqrvkdvjs"); model = BinaryData.fromObject(model).toObject(WeekDetails.class); - Assertions.assertEquals("nermcl", model.weekdays().get(0)); - Assertions.assertEquals("fqkquj", model.time()); + Assertions.assertEquals("moryocfsfksym", model.weekdays().get(0)); + Assertions.assertEquals("poczvyifqrvkdvjs", model.time()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/WindowsOsInfoTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/WindowsOsInfoTests.java index af0b07faec70..95267121bfda 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/WindowsOsInfoTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/generated/WindowsOsInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.devtestlabs.generated; @@ -13,14 +13,14 @@ public final class WindowsOsInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WindowsOsInfo model - = BinaryData.fromString("{\"windowsOsState\":\"NonSysprepped\"}").toObject(WindowsOsInfo.class); - Assertions.assertEquals(WindowsOsState.NON_SYSPREPPED, model.windowsOsState()); + = BinaryData.fromString("{\"windowsOsState\":\"SysprepRequested\"}").toObject(WindowsOsInfo.class); + Assertions.assertEquals(WindowsOsState.SYSPREP_REQUESTED, model.windowsOsState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WindowsOsInfo model = new WindowsOsInfo().withWindowsOsState(WindowsOsState.NON_SYSPREPPED); + WindowsOsInfo model = new WindowsOsInfo().withWindowsOsState(WindowsOsState.SYSPREP_REQUESTED); model = BinaryData.fromObject(model).toObject(WindowsOsInfo.class); - Assertions.assertEquals(WindowsOsState.NON_SYSPREPPED, model.windowsOsState()); + Assertions.assertEquals(WindowsOsState.SYSPREP_REQUESTED, model.windowsOsState()); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/tsp-location.yaml b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/tsp-location.yaml new file mode 100644 index 000000000000..899afcbcbbf9 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/DevTestLabs +commit: 589ab73777dd977a411b60321a991e48a58adeb9 +repo: Azure/azure-rest-api-specs +additionalDirectories: From 71b513afb48f4d518e00f72608bceaabadfb5396 Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Mon, 1 Jun 2026 11:46:56 +0800 Subject: [PATCH 2/2] Fix region assignment in DevTestLabsManagerTests --- .../resourcemanager/devtestlabs/DevTestLabsManagerTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManagerTests.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManagerTests.java index 1be227c1512c..7ceb91219f6b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManagerTests.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/test/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManagerTests.java @@ -71,8 +71,8 @@ public void test() { // @embedmeStart lab = devTestLabsManager.labs() .define(labName) - .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) + .withRegion(REGION) .create(); // @embedmeEnd lab.refresh();