From 2b1093c5958eb59e1ede258579b6b254377bafcd Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 18 Oct 2021 06:17:11 +0000 Subject: [PATCH] CodeGen from PR 16431 in Azure/azure-rest-api-specs Add track2 batch 4 mysql-->cognitiveservices (#16431) * Add track2 batch 4 mysql-->cognitiveservices * resourcehealth-->sqlvirtualmachine --- .../CHANGELOG.md | 3 +- .../README.md | 5 +- .../SAMPLE.md | 4078 +++++++++++++++++ .../azure-resourcemanager-devtestlabs/pom.xml | 141 +- .../devtestlabs/DevTestLabsManager.java | 22 +- .../fluent/CustomImagesClient.java | 8 +- .../devtestlabs/fluent/DisksClient.java | 16 +- .../fluent/EnvironmentsClient.java | 8 +- .../devtestlabs/fluent/FormulasClient.java | 4 +- .../fluent/GlobalSchedulesClient.java | 8 +- .../devtestlabs/fluent/LabsClient.java | 24 +- .../devtestlabs/fluent/SchedulesClient.java | 4 +- .../devtestlabs/fluent/SecretsClient.java | 4 +- .../fluent/ServiceFabricSchedulesClient.java | 4 +- .../fluent/ServiceFabricsClient.java | 16 +- .../devtestlabs/fluent/UsersClient.java | 8 +- .../fluent/VirtualMachineSchedulesClient.java | 4 +- .../fluent/VirtualMachinesClient.java | 52 +- .../fluent/VirtualNetworksClient.java | 8 +- .../models/ApplicableScheduleInner.java | 77 +- .../ApplicableSchedulePropertiesInner.java | 86 + .../fluent/models/ArmTemplateInner.java | 111 +- .../fluent/models/ArmTemplateProperties.java | 152 + .../fluent/models/ArtifactInner.java | 108 +- .../fluent/models/ArtifactProperties.java | 145 + .../fluent/models/ArtifactSourceInner.java | 169 +- .../models/ArtifactSourceProperties.java | 280 ++ .../fluent/models/CustomImageInner.java | 193 +- .../fluent/models/CustomImageProperties.java | 324 ++ .../devtestlabs/fluent/models/DiskInner.java | 169 +- .../fluent/models/DiskProperties.java | 280 ++ .../fluent/models/DtlEnvironmentInner.java | 102 +- .../fluent/models/EnvironmentProperties.java | 144 + .../fluent/models/FormulaInner.java | 128 +- .../fluent/models/FormulaProperties.java | 197 + .../fluent/models/GalleryImageInner.java | 141 +- .../fluent/models/GalleryImageProperties.java | 226 + .../fluent/models/LabCostInner.java | 155 +- .../fluent/models/LabCostProperties.java | 247 + .../devtestlabs/fluent/models/LabInner.java | 253 +- .../fluent/models/LabProperties.java | 455 ++ ...ualMachineCreationParameterProperties.java | 689 +++ .../fluent/models/LabVirtualMachineInner.java | 462 +- .../LabVirtualMachinePropertiesInner.java | 845 ++++ .../models/NotificationChannelInner.java | 133 +- .../models/NotificationChannelProperties.java | 211 + .../fluent/models/PolicyInner.java | 145 +- .../fluent/models/PolicyProperties.java | 234 + .../ScheduleCreationParameterProperties.java | 258 ++ .../fluent/models/ScheduleInner.java | 181 +- .../fluent/models/ScheduleProperties.java | 304 ++ .../fluent/models/SecretInner.java | 71 +- .../fluent/models/SecretProperties.java | 80 + .../fluent/models/ServiceFabricInner.java | 93 +- .../models/ServiceFabricPropertiesInner.java | 127 + .../devtestlabs/fluent/models/UserInner.java | 90 +- .../fluent/models/UserProperties.java | 130 + .../fluent/models/VirtualNetworkInner.java | 127 +- .../models/VirtualNetworkProperties.java | 202 + .../ApplicableSchedulePropertiesImpl.java | 49 + .../CustomImagesClientImpl.java | 16 +- .../implementation/DisksClientImpl.java | 32 +- .../EnvironmentsClientImpl.java | 16 +- .../implementation/FormulasClientImpl.java | 8 +- .../GlobalSchedulesClientImpl.java | 16 +- .../LabVirtualMachinePropertiesImpl.java | 202 + .../implementation/LabsClientImpl.java | 48 +- .../implementation/SchedulesClientImpl.java | 8 +- .../implementation/SecretsClientImpl.java | 8 +- .../ServiceFabricPropertiesImpl.java | 56 + .../ServiceFabricSchedulesClientImpl.java | 8 +- .../ServiceFabricsClientImpl.java | 32 +- .../implementation/UsersClientImpl.java | 16 +- .../VirtualMachineSchedulesClientImpl.java | 8 +- .../VirtualMachinesClientImpl.java | 104 +- .../VirtualNetworksClientImpl.java | 16 +- .../models/ApplicableScheduleFragment.java | 4 +- .../models/ApplicableScheduleProperties.java | 32 + .../models/ArtifactSourceFragment.java | 4 +- .../models/CustomImageFragment.java | 4 +- .../devtestlabs/models/DiskFragment.java | 4 +- .../models/DtlEnvironmentFragment.java | 4 +- .../devtestlabs/models/FormulaFragment.java | 4 +- .../devtestlabs/models/LabFragment.java | 4 +- .../LabVirtualMachineCreationParameter.java | 353 +- .../models/LabVirtualMachineFragment.java | 4 +- .../models/LabVirtualMachineProperties.java | 267 ++ .../models/NotificationChannelFragment.java | 4 +- .../devtestlabs/models/PolicyFragment.java | 4 +- .../models/ScheduleCreationParameter.java | 151 +- .../devtestlabs/models/ScheduleFragment.java | 4 +- .../devtestlabs/models/SecretFragment.java | 4 +- .../models/ServiceFabricFragment.java | 4 +- .../models/ServiceFabricProperties.java | 53 + .../devtestlabs/models/UpdateResource.java | 2 + .../devtestlabs/models/UserFragment.java | 4 +- .../models/VirtualNetworkFragment.java | 4 +- .../generated/ArmTemplatesGetSamples.java | 25 + .../generated/ArmTemplatesListSamples.java | 24 + .../ArtifactSourcesCreateOrUpdateSamples.java | 50 + .../ArtifactSourcesDeleteSamples.java | 24 + .../generated/ArtifactSourcesGetSamples.java | 24 + .../generated/ArtifactSourcesListSamples.java | 22 + .../ArtifactSourcesUpdateSamples.java | 41 + .../ArtifactsGenerateArmTemplateSamples.java | 35 + .../generated/ArtifactsGetSamples.java | 25 + .../generated/ArtifactsListSamples.java | 24 + .../generated/CostsCreateOrUpdateSamples.java | 77 + .../generated/CostsGetSamples.java | 22 + .../CustomImagesCreateOrUpdateSamples.java | 49 + .../generated/CustomImagesDeleteSamples.java | 22 + .../generated/CustomImagesGetSamples.java | 24 + .../generated/CustomImagesListSamples.java | 22 + .../generated/CustomImagesUpdateSamples.java | 41 + .../generated/DisksAttachSamples.java | 33 + .../generated/DisksCreateOrUpdateSamples.java | 31 + .../generated/DisksDeleteSamples.java | 22 + .../generated/DisksDetachSamples.java | 33 + .../generated/DisksGetSamples.java | 22 + .../generated/DisksListSamples.java | 22 + .../generated/DisksUpdateSamples.java | 41 + .../EnvironmentsCreateOrUpdateSamples.java | 33 + .../generated/EnvironmentsDeleteSamples.java | 22 + .../generated/EnvironmentsGetSamples.java | 24 + .../generated/EnvironmentsListSamples.java | 22 + .../generated/EnvironmentsUpdateSamples.java | 41 + .../FormulasCreateOrUpdateSamples.java | 71 + .../generated/FormulasDeleteSamples.java | 22 + .../generated/FormulasGetSamples.java | 22 + .../generated/FormulasListSamples.java | 22 + .../generated/FormulasUpdateSamples.java | 41 + .../generated/GalleryImagesListSamples.java | 22 + .../GlobalSchedulesCreateOrUpdateSamples.java | 36 + .../GlobalSchedulesDeleteSamples.java | 22 + .../GlobalSchedulesExecuteSamples.java | 22 + ...balSchedulesGetByResourceGroupSamples.java | 24 + ...alSchedulesListByResourceGroupSamples.java | 23 + .../generated/GlobalSchedulesListSamples.java | 23 + .../GlobalSchedulesRetargetSamples.java | 33 + .../GlobalSchedulesUpdateSamples.java | 41 + .../generated/LabsClaimAnyVmSamples.java | 22 + .../LabsCreateEnvironmentSamples.java | 62 + .../generated/LabsCreateOrUpdateSamples.java | 42 + .../generated/LabsDeleteSamples.java | 22 + .../LabsExportResourceUsageSamples.java | 33 + .../LabsGenerateUploadUriSamples.java | 29 + .../LabsGetByResourceGroupSamples.java | 22 + .../LabsImportVirtualMachineSamples.java | 32 + .../LabsListByResourceGroupSamples.java | 22 + .../generated/LabsListSamples.java | 22 + .../generated/LabsListVhdsSamples.java | 22 + .../generated/LabsUpdateSamples.java | 28 + ...ficationChannelsCreateOrUpdateSamples.java | 35 + .../NotificationChannelsDeleteSamples.java | 24 + .../NotificationChannelsGetSamples.java | 24 + .../NotificationChannelsListSamples.java | 22 + .../NotificationChannelsNotifySamples.java | 34 + .../NotificationChannelsUpdateSamples.java | 28 + .../generated/OperationsGetSamples.java | 22 + .../PoliciesCreateOrUpdateSamples.java | 49 + .../generated/PoliciesDeleteSamples.java | 24 + .../generated/PoliciesGetSamples.java | 24 + .../generated/PoliciesListSamples.java | 24 + .../generated/PoliciesUpdateSamples.java | 42 + .../PolicySetsEvaluatePoliciesSamples.java | 35 + .../ProviderOperationsListSamples.java | 22 + .../SchedulesCreateOrUpdateSamples.java | 69 + .../generated/SchedulesDeleteSamples.java | 22 + .../generated/SchedulesExecuteSamples.java | 22 + .../generated/SchedulesGetSamples.java | 22 + .../SchedulesListApplicableSamples.java | 22 + .../generated/SchedulesListSamples.java | 22 + .../generated/SchedulesUpdateSamples.java | 43 + .../SecretsCreateOrUpdateSamples.java | 26 + .../generated/SecretsDeleteSamples.java | 24 + .../generated/SecretsGetSamples.java | 24 + .../generated/SecretsListSamples.java | 22 + .../generated/SecretsUpdateSamples.java | 41 + ...eFabricSchedulesCreateOrUpdateSamples.java | 76 + .../ServiceFabricSchedulesDeleteSamples.java | 25 + .../ServiceFabricSchedulesExecuteSamples.java | 24 + .../ServiceFabricSchedulesGetSamples.java | 25 + .../ServiceFabricSchedulesListSamples.java | 24 + .../ServiceFabricSchedulesUpdateSamples.java | 45 + .../ServiceFabricsCreateOrUpdateSamples.java | 42 + .../ServiceFabricsDeleteSamples.java | 24 + .../generated/ServiceFabricsGetSamples.java | 24 + ...FabricsListApplicableSchedulesSamples.java | 26 + .../generated/ServiceFabricsListSamples.java | 24 + .../generated/ServiceFabricsStartSamples.java | 24 + .../generated/ServiceFabricsStopSamples.java | 24 + .../ServiceFabricsUpdateSamples.java | 42 + .../ServiceRunnersCreateOrUpdateSamples.java | 48 + .../ServiceRunnersDeleteSamples.java | 24 + .../generated/ServiceRunnersGetSamples.java | 24 + .../generated/UsersCreateOrUpdateSamples.java | 50 + .../generated/UsersDeleteSamples.java | 22 + .../generated/UsersGetSamples.java | 22 + .../generated/UsersListSamples.java | 22 + .../generated/UsersUpdateSamples.java | 41 + ...MachineSchedulesCreateOrUpdateSamples.java | 69 + .../VirtualMachineSchedulesDeleteSamples.java | 24 + ...VirtualMachineSchedulesExecuteSamples.java | 25 + .../VirtualMachineSchedulesGetSamples.java | 24 + .../VirtualMachineSchedulesListSamples.java | 24 + .../VirtualMachineSchedulesUpdateSamples.java | 44 + .../VirtualMachinesAddDataDiskSamples.java | 37 + .../VirtualMachinesApplyArtifactsSamples.java | 39 + .../VirtualMachinesClaimSamples.java | 22 + .../VirtualMachinesCreateOrUpdateSamples.java | 57 + .../VirtualMachinesDeleteSamples.java | 22 + .../VirtualMachinesDetachDataDiskSamples.java | 32 + ...tualMachinesGetRdpFileContentsSamples.java | 25 + .../generated/VirtualMachinesGetSamples.java | 22 + ...achinesListApplicableSchedulesSamples.java | 25 + .../generated/VirtualMachinesListSamples.java | 22 + .../VirtualMachinesRedeploySamples.java | 22 + .../VirtualMachinesResizeSamples.java | 30 + .../VirtualMachinesRestartSamples.java | 22 + .../VirtualMachinesStartSamples.java | 22 + .../generated/VirtualMachinesStopSamples.java | 22 + .../VirtualMachinesTransferDisksSamples.java | 22 + .../VirtualMachinesUnClaimSamples.java | 22 + .../VirtualMachinesUpdateSamples.java | 28 + .../VirtualNetworksCreateOrUpdateSamples.java | 40 + .../VirtualNetworksDeleteSamples.java | 22 + .../generated/VirtualNetworksGetSamples.java | 24 + .../generated/VirtualNetworksListSamples.java | 22 + .../VirtualNetworksUpdateSamples.java | 41 + 229 files changed, 16104 insertions(+), 2399 deletions(-) create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableSchedulePropertiesInner.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachinePropertiesInner.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleCreationParameterProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricPropertiesInner.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableSchedulePropertiesImpl.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachinePropertiesImpl.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricPropertiesImpl.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricProperties.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateEnvironmentSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifySamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/OperationsGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PolicySetsEvaluatePoliciesSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeploySamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListSamples.java create mode 100644 sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksUpdateSamples.java diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/CHANGELOG.md b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/CHANGELOG.md index debcd7bec318..9af118093e9f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/CHANGELOG.md +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-10-18) +- 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). ## 1.0.0-beta.1 (2021-04-15) diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/README.md b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/README.md index 889ade30fe18..9f0b53d1b0b4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/README.md +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-devtestlabs - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md new file mode 100644 index 000000000000..7ab9e84fe774 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md @@ -0,0 +1,4078 @@ +# Code snippets and samples + + +## ArmTemplates + +- [Get](#armtemplates_get) +- [List](#armtemplates_list) + +## ArtifactSources + +- [CreateOrUpdate](#artifactsources_createorupdate) +- [Delete](#artifactsources_delete) +- [Get](#artifactsources_get) +- [List](#artifactsources_list) +- [Update](#artifactsources_update) + +## Artifacts + +- [GenerateArmTemplate](#artifacts_generatearmtemplate) +- [Get](#artifacts_get) +- [List](#artifacts_list) + +## Costs + +- [CreateOrUpdate](#costs_createorupdate) +- [Get](#costs_get) + +## CustomImages + +- [CreateOrUpdate](#customimages_createorupdate) +- [Delete](#customimages_delete) +- [Get](#customimages_get) +- [List](#customimages_list) +- [Update](#customimages_update) + +## Disks + +- [Attach](#disks_attach) +- [CreateOrUpdate](#disks_createorupdate) +- [Delete](#disks_delete) +- [Detach](#disks_detach) +- [Get](#disks_get) +- [List](#disks_list) +- [Update](#disks_update) + +## Environments + +- [CreateOrUpdate](#environments_createorupdate) +- [Delete](#environments_delete) +- [Get](#environments_get) +- [List](#environments_list) +- [Update](#environments_update) + +## Formulas + +- [CreateOrUpdate](#formulas_createorupdate) +- [Delete](#formulas_delete) +- [Get](#formulas_get) +- [List](#formulas_list) +- [Update](#formulas_update) + +## GalleryImages + +- [List](#galleryimages_list) + +## GlobalSchedules + +- [CreateOrUpdate](#globalschedules_createorupdate) +- [Delete](#globalschedules_delete) +- [Execute](#globalschedules_execute) +- [GetByResourceGroup](#globalschedules_getbyresourcegroup) +- [List](#globalschedules_list) +- [ListByResourceGroup](#globalschedules_listbyresourcegroup) +- [Retarget](#globalschedules_retarget) +- [Update](#globalschedules_update) + +## Labs + +- [ClaimAnyVm](#labs_claimanyvm) +- [CreateEnvironment](#labs_createenvironment) +- [CreateOrUpdate](#labs_createorupdate) +- [Delete](#labs_delete) +- [ExportResourceUsage](#labs_exportresourceusage) +- [GenerateUploadUri](#labs_generateuploaduri) +- [GetByResourceGroup](#labs_getbyresourcegroup) +- [ImportVirtualMachine](#labs_importvirtualmachine) +- [List](#labs_list) +- [ListByResourceGroup](#labs_listbyresourcegroup) +- [ListVhds](#labs_listvhds) +- [Update](#labs_update) + +## NotificationChannels + +- [CreateOrUpdate](#notificationchannels_createorupdate) +- [Delete](#notificationchannels_delete) +- [Get](#notificationchannels_get) +- [List](#notificationchannels_list) +- [Notify](#notificationchannels_notify) +- [Update](#notificationchannels_update) + +## Operations + +- [Get](#operations_get) + +## Policies + +- [CreateOrUpdate](#policies_createorupdate) +- [Delete](#policies_delete) +- [Get](#policies_get) +- [List](#policies_list) +- [Update](#policies_update) + +## PolicySets + +- [EvaluatePolicies](#policysets_evaluatepolicies) + +## ProviderOperations + +- [List](#provideroperations_list) + +## Schedules + +- [CreateOrUpdate](#schedules_createorupdate) +- [Delete](#schedules_delete) +- [Execute](#schedules_execute) +- [Get](#schedules_get) +- [List](#schedules_list) +- [ListApplicable](#schedules_listapplicable) +- [Update](#schedules_update) + +## Secrets + +- [CreateOrUpdate](#secrets_createorupdate) +- [Delete](#secrets_delete) +- [Get](#secrets_get) +- [List](#secrets_list) +- [Update](#secrets_update) + +## ServiceFabricSchedules + +- [CreateOrUpdate](#servicefabricschedules_createorupdate) +- [Delete](#servicefabricschedules_delete) +- [Execute](#servicefabricschedules_execute) +- [Get](#servicefabricschedules_get) +- [List](#servicefabricschedules_list) +- [Update](#servicefabricschedules_update) + +## ServiceFabrics + +- [CreateOrUpdate](#servicefabrics_createorupdate) +- [Delete](#servicefabrics_delete) +- [Get](#servicefabrics_get) +- [List](#servicefabrics_list) +- [ListApplicableSchedules](#servicefabrics_listapplicableschedules) +- [Start](#servicefabrics_start) +- [Stop](#servicefabrics_stop) +- [Update](#servicefabrics_update) + +## ServiceRunners + +- [CreateOrUpdate](#servicerunners_createorupdate) +- [Delete](#servicerunners_delete) +- [Get](#servicerunners_get) + +## Users + +- [CreateOrUpdate](#users_createorupdate) +- [Delete](#users_delete) +- [Get](#users_get) +- [List](#users_list) +- [Update](#users_update) + +## VirtualMachineSchedules + +- [CreateOrUpdate](#virtualmachineschedules_createorupdate) +- [Delete](#virtualmachineschedules_delete) +- [Execute](#virtualmachineschedules_execute) +- [Get](#virtualmachineschedules_get) +- [List](#virtualmachineschedules_list) +- [Update](#virtualmachineschedules_update) + +## VirtualMachines + +- [AddDataDisk](#virtualmachines_adddatadisk) +- [ApplyArtifacts](#virtualmachines_applyartifacts) +- [Claim](#virtualmachines_claim) +- [CreateOrUpdate](#virtualmachines_createorupdate) +- [Delete](#virtualmachines_delete) +- [DetachDataDisk](#virtualmachines_detachdatadisk) +- [Get](#virtualmachines_get) +- [GetRdpFileContents](#virtualmachines_getrdpfilecontents) +- [List](#virtualmachines_list) +- [ListApplicableSchedules](#virtualmachines_listapplicableschedules) +- [Redeploy](#virtualmachines_redeploy) +- [Resize](#virtualmachines_resize) +- [Restart](#virtualmachines_restart) +- [Start](#virtualmachines_start) +- [Stop](#virtualmachines_stop) +- [TransferDisks](#virtualmachines_transferdisks) +- [UnClaim](#virtualmachines_unclaim) +- [Update](#virtualmachines_update) + +## VirtualNetworks + +- [CreateOrUpdate](#virtualnetworks_createorupdate) +- [Delete](#virtualnetworks_delete) +- [Get](#virtualnetworks_get) +- [List](#virtualnetworks_list) +- [Update](#virtualnetworks_update) +### ArmTemplates_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ArmTemplates Get. */ +public final class ArmTemplatesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_Get.json + */ + /** + * Sample code: ArmTemplates_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void armTemplatesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .armTemplates() + .getWithResponse( + "resourceGroupName", "{labName}", "{artifactSourceName}", "{armTemplateName}", null, Context.NONE); + } +} +``` + +### ArmTemplates_List + +```java +import com.azure.core.util.Context; + +/** Samples for ArmTemplates List. */ +public final class ArmTemplatesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_List.json + */ + /** + * Sample code: ArmTemplates_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void armTemplatesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .armTemplates() + .list("resourceGroupName", "{labName}", "{artifactSourceName}", null, null, null, null, Context.NONE); + } +} +``` + +### ArtifactSources_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.SourceControlType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ArtifactSources CreateOrUpdate. */ +public final class ArtifactSourcesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_CreateOrUpdate.json + */ + /** + * Sample code: ArtifactSources_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + 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}") + .withUri("{artifactSourceUri}") + .withSourceType(SourceControlType.fromString("{VsoGit|GitHub|StorageAccount}")) + .withFolderPath("{folderPath}") + .withArmTemplateFolderPath("{armTemplateFolderPath}") + .withBranchRef("{branchRef}") + .withSecurityToken("{securityToken}") + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ArtifactSources_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ArtifactSources Delete. */ +public final class ArtifactSourcesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Delete.json + */ + /** + * Sample code: ArtifactSources_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifactSources() + .deleteWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", Context.NONE); + } +} +``` + +### ArtifactSources_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ArtifactSources Get. */ +public final class ArtifactSourcesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Get.json + */ + /** + * Sample code: ArtifactSources_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifactSources() + .getWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", null, Context.NONE); + } +} +``` + +### ArtifactSources_List + +```java +import com.azure.core.util.Context; + +/** Samples for ArtifactSources List. */ +public final class ArtifactSourcesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_List.json + */ + /** + * Sample code: ArtifactSources_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.artifactSources().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} +``` + +### ArtifactSources_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ArtifactSource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ArtifactSources Update. */ +public final class ArtifactSourcesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Update.json + */ + /** + * Sample code: ArtifactSources_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + ArtifactSource resource = + manager + .artifactSources() + .getWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Artifacts_GenerateArmTemplate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.FileUploadOptions; +import com.azure.resourcemanager.devtestlabs.models.GenerateArmTemplateRequest; + +/** Samples for Artifacts GenerateArmTemplate. */ +public final class ArtifactsGenerateArmTemplateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_GenerateArmTemplate.json + */ + /** + * Sample code: Artifacts_GenerateArmTemplate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactsGenerateArmTemplate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifacts() + .generateArmTemplateWithResponse( + "resourceGroupName", + "{labName}", + "{artifactSourceName}", + "{artifactName}", + new GenerateArmTemplateRequest() + .withVirtualMachineName("{vmName}") + .withLocation("{location}") + .withFileUploadOptions(FileUploadOptions.NONE), + Context.NONE); + } +} +``` + +### Artifacts_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Artifacts Get. */ +public final class ArtifactsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_Get.json + */ + /** + * Sample code: Artifacts_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifacts() + .getWithResponse( + "resourceGroupName", "{labName}", "{artifactSourceName}", "{artifactName}", null, Context.NONE); + } +} +``` + +### Artifacts_List + +```java +import com.azure.core.util.Context; + +/** Samples for Artifacts List. */ +public final class ArtifactsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_List.json + */ + /** + * Sample code: Artifacts_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifacts() + .list("resourceGroupName", "{labName}", "{artifactSourceName}", null, null, null, null, Context.NONE); + } +} +``` + +### Costs_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.CostThresholdProperties; +import com.azure.resourcemanager.devtestlabs.models.CostThresholdStatus; +import com.azure.resourcemanager.devtestlabs.models.PercentageCostThresholdProperties; +import com.azure.resourcemanager.devtestlabs.models.ReportingCycleType; +import com.azure.resourcemanager.devtestlabs.models.TargetCostProperties; +import com.azure.resourcemanager.devtestlabs.models.TargetCostStatus; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Costs CreateOrUpdate. */ +public final class CostsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_CreateOrUpdate.json + */ + /** + * Sample code: Costs_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + 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) + .withCostThresholds( + Arrays + .asList( + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000001") + .withPercentageThreshold( + new PercentageCostThresholdProperties().withThresholdValue(25.0)) + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000002") + .withPercentageThreshold( + new PercentageCostThresholdProperties().withThresholdValue(50.0)) + .withDisplayOnChart(CostThresholdStatus.ENABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.ENABLED), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000003") + .withPercentageThreshold( + new PercentageCostThresholdProperties().withThresholdValue(75.0)) + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000004") + .withPercentageThreshold( + new PercentageCostThresholdProperties().withThresholdValue(100.0)) + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000005") + .withPercentageThreshold( + new PercentageCostThresholdProperties().withThresholdValue(125.0)) + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED))) + .withCycleStartDateTime(OffsetDateTime.parse("2020-12-01T00:00:00.000Z")) + .withCycleEndDateTime(OffsetDateTime.parse("2020-12-31T00:00:00.000Z")) + .withCycleType(ReportingCycleType.CALENDAR_MONTH)) + .withCurrencyCode("USD") + .withStartDateTime(OffsetDateTime.parse("2020-12-01T00:00:00Z")) + .withEndDateTime(OffsetDateTime.parse("2020-12-31T23:59:59Z")) + .create(); + } +} +``` + +### Costs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Costs Get. */ +public final class CostsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_Get.json + */ + /** + * Sample code: Costs_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void costsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.costs().getWithResponse("resourceGroupName", "{labName}", "targetCost", null, Context.NONE); + } +} +``` + +### CustomImages_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromVm; +import com.azure.resourcemanager.devtestlabs.models.LinuxOsInfo; +import com.azure.resourcemanager.devtestlabs.models.LinuxOsState; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CustomImages CreateOrUpdate. */ +public final class CustomImagesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_CreateOrUpdate.json + */ + /** + * Sample code: CustomImages_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + 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( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}") + .withLinuxOsInfo(new LinuxOsInfo().withLinuxOsState(LinuxOsState.NON_DEPROVISIONED))) + .withDescription("My Custom Image") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CustomImages_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for CustomImages Delete. */ +public final class CustomImagesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Delete.json + */ + /** + * Sample code: CustomImages_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.customImages().delete("resourceGroupName", "{labName}", "{customImageName}", Context.NONE); + } +} +``` + +### CustomImages_Get + +```java +import com.azure.core.util.Context; + +/** Samples for CustomImages Get. */ +public final class CustomImagesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Get.json + */ + /** + * Sample code: CustomImages_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .customImages() + .getWithResponse("resourceGroupName", "{labName}", "{customImageName}", null, Context.NONE); + } +} +``` + +### CustomImages_List + +```java +import com.azure.core.util.Context; + +/** Samples for CustomImages List. */ +public final class CustomImagesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_List.json + */ + /** + * Sample code: CustomImages_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.customImages().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} +``` + +### CustomImages_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.CustomImage; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CustomImages Update. */ +public final class CustomImagesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Update.json + */ + /** + * Sample code: CustomImages_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + CustomImage resource = + manager + .customImages() + .getWithResponse("resourceGroupName", "{labName}", "{customImageName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Disks_Attach + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.AttachDiskProperties; + +/** Samples for Disks Attach. */ +public final class DisksAttachSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Attach.json + */ + /** + * Sample code: Disks_Attach. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksAttach(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .disks() + .attach( + "resourceGroupName", + "{labName}", + "{userId}", + "{diskName}", + new AttachDiskProperties() + .withLeasedByLabVmId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"), + Context.NONE); + } +} +``` + +### Disks_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.StorageType; + +/** Samples for Disks CreateOrUpdate. */ +public final class DisksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_CreateOrUpdate.json + */ + /** + * Sample code: Disks_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + 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) + .withLeasedByLabVmId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName") + .create(); + } +} +``` + +### Disks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Disks Delete. */ +public final class DisksDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Delete.json + */ + /** + * Sample code: Disks_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.disks().delete("resourceGroupName", "{labName}", "{userId}", "{diskName}", Context.NONE); + } +} +``` + +### Disks_Detach + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DetachDiskProperties; + +/** Samples for Disks Detach. */ +public final class DisksDetachSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Detach.json + */ + /** + * Sample code: Disks_Detach. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksDetach(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .disks() + .detach( + "resourceGroupName", + "{labName}", + "{userId}", + "{diskName}", + new DetachDiskProperties() + .withLeasedByLabVmId( + "/subscriptions/{subscriptionId}/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"), + Context.NONE); + } +} +``` + +### Disks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Disks Get. */ +public final class DisksGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Get.json + */ + /** + * Sample code: Disks_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.disks().getWithResponse("resourceGroupName", "{labName}", "@me", "{diskName}", null, Context.NONE); + } +} +``` + +### Disks_List + +```java +import com.azure.core.util.Context; + +/** Samples for Disks List. */ +public final class DisksListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_List.json + */ + /** + * Sample code: Disks_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.disks().list("resourceGroupName", "{labName}", "@me", null, null, null, null, Context.NONE); + } +} +``` + +### Disks_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Disk; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Disks Update. */ +public final class DisksUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Update.json + */ + /** + * Sample code: Disks_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Disk resource = + manager + .disks() + .getWithResponse("resourceGroupName", "{labName}", "@me", "diskName", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Environments_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.EnvironmentDeploymentProperties; +import java.util.Arrays; + +/** Samples for Environments CreateOrUpdate. */ +public final class EnvironmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_CreateOrUpdate.json + */ + /** + * Sample code: Environments_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + 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}") + .withParameters(Arrays.asList())) + .create(); + } +} +``` + +### Environments_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Environments Delete. */ +public final class EnvironmentsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Delete.json + */ + /** + * Sample code: Environments_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.environments().delete("resourceGroupName", "{labName}", "@me", "{environmentName}", Context.NONE); + } +} +``` + +### Environments_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Environments Get. */ +public final class EnvironmentsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Get.json + */ + /** + * Sample code: Environments_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .environments() + .getWithResponse("resourceGroupName", "{labName}", "@me", "{environmentName}", null, Context.NONE); + } +} +``` + +### Environments_List + +```java +import com.azure.core.util.Context; + +/** Samples for Environments List. */ +public final class EnvironmentsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_List.json + */ + /** + * Sample code: Environments_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.environments().list("resourceGroupName", "{labName}", "@me", null, null, null, null, Context.NONE); + } +} +``` + +### Environments_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DtlEnvironment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Environments Update. */ +public final class EnvironmentsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Update.json + */ + /** + * Sample code: Environments_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + DtlEnvironment resource = + manager + .environments() + .getWithResponse("resourceGroupName", "{labName}", "@me", "{environmentName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Formulas_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.NetworkInterfaceProperties; +import com.azure.resourcemanager.devtestlabs.models.SharedPublicIpAddressConfiguration; +import com.azure.resourcemanager.devtestlabs.models.TransportProtocol; +import java.util.Arrays; + +/** Samples for Formulas CreateOrUpdate. */ +public final class FormulasCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_CreateOrUpdate.json + */ + /** + * Sample code: Formulas_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .formulas() + .define("{formulaName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withDescription("Formula using a Linux base") + .withFormulaContent( + new LabVirtualMachineCreationParameter() + .withLocation("{location}") + .withNotes("Ubuntu Server 20.10") + .withSize("Standard_B1ms") + .withUsername("user") + .withIsAuthenticationWithSshKey(false) + .withLabSubnetName("Dtl{labName}Subnet") + .withLabVirtualNetworkId("/virtualnetworks/dtl{labName}") + .withDisallowPublicIpAddress(true) + .withArtifacts( + Arrays + .asList( + new ArtifactInstallProperties() + .withArtifactId( + "/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs") + .withParameters(Arrays.asList()))) + .withGalleryImageReference( + new GalleryImageReference() + .withOffer("0001-com-ubuntu-server-groovy") + .withPublisher("canonical") + .withSku("20_10") + .withOsType("Linux") + .withVersion("latest")) + .withNetworkInterface( + new NetworkInterfaceProperties() + .withSharedPublicIpAddressConfiguration( + new SharedPublicIpAddressConfiguration() + .withInboundNatRules( + Arrays + .asList( + new InboundNatRule() + .withTransportProtocol(TransportProtocol.TCP) + .withBackendPort(22))))) + .withAllowClaim(false) + .withStorageType("Standard")) + .create(); + } +} +``` + +### Formulas_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Formulas Delete. */ +public final class FormulasDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Delete.json + */ + /** + * Sample code: Formulas_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.formulas().deleteWithResponse("resourceGroupName", "{labName}", "{formulaName}", Context.NONE); + } +} +``` + +### Formulas_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Formulas Get. */ +public final class FormulasGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Get.json + */ + /** + * Sample code: Formulas_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.formulas().getWithResponse("resourceGroupName", "{labName}", "{formulaName}", null, Context.NONE); + } +} +``` + +### Formulas_List + +```java +import com.azure.core.util.Context; + +/** Samples for Formulas List. */ +public final class FormulasListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_List.json + */ + /** + * Sample code: Formulas_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.formulas().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} +``` + +### Formulas_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Formula; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Formulas Update. */ +public final class FormulasUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Update.json + */ + /** + * Sample code: Formulas_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Formula resource = + manager + .formulas() + .getWithResponse("resourceGroupName", "{labName}", "{formulaName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### GalleryImages_List + +```java +import com.azure.core.util.Context; + +/** Samples for GalleryImages List. */ +public final class GalleryImagesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GalleryImages_List.json + */ + /** + * Sample code: GalleryImages_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void galleryImagesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.galleryImages().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} +``` + +### GlobalSchedules_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.WeekDetails; +import java.util.Arrays; + +/** Samples for GlobalSchedules CreateOrUpdate. */ +public final class GlobalSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_CreateOrUpdate.json + */ + /** + * Sample code: GlobalSchedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .globalSchedules() + .define("labvmautostart") + .withRegion((String) null) + .withExistingResourceGroup("resourceGroupName") + .withStatus(EnableStatus.ENABLED) + .withTaskType("LabVmsStartupTask") + .withWeeklyRecurrence( + new WeekDetails() + .withWeekdays(Arrays.asList("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")) + .withTime("0700")) + .withTimeZoneId("Hawaiian Standard Time") + .create(); + } +} +``` + +### GlobalSchedules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules Delete. */ +public final class GlobalSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Delete.json + */ + /** + * Sample code: GlobalSchedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().deleteWithResponse("resourceGroupName", "labvmautostart", Context.NONE); + } +} +``` + +### GlobalSchedules_Execute + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules Execute. */ +public final class GlobalSchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Execute.json + */ + /** + * Sample code: GlobalSchedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesExecute(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().execute("resourceGroupName", "labvmautostart", Context.NONE); + } +} +``` + +### GlobalSchedules_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules GetByResourceGroup. */ +public final class GlobalSchedulesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Get.json + */ + /** + * Sample code: GlobalSchedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .globalSchedules() + .getByResourceGroupWithResponse("resourceGroupName", "labvmautostart", null, Context.NONE); + } +} +``` + +### GlobalSchedules_List + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules List. */ +public final class GlobalSchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListBySubscription.json + */ + /** + * Sample code: GlobalSchedules_ListBySubscription. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesListBySubscription( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().list(null, null, null, null, Context.NONE); + } +} +``` + +### GlobalSchedules_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules ListByResourceGroup. */ +public final class GlobalSchedulesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListByResourceGroup.json + */ + /** + * Sample code: GlobalSchedules_ListByResourceGroup. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesListByResourceGroup( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().listByResourceGroup("resourceGroupName", null, null, null, null, Context.NONE); + } +} +``` + +### GlobalSchedules_Retarget + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.RetargetScheduleProperties; + +/** Samples for GlobalSchedules Retarget. */ +public final class GlobalSchedulesRetargetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Retarget.json + */ + /** + * Sample code: GlobalSchedules_Retarget. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesRetarget(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .globalSchedules() + .retarget( + "resourceGroupName", + "{scheduleName}", + new RetargetScheduleProperties() + .withCurrentResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{targetLab}") + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{currentLab}"), + Context.NONE); + } +} +``` + +### GlobalSchedules_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Schedule; +import java.util.HashMap; +import java.util.Map; + +/** Samples for GlobalSchedules Update. */ +public final class GlobalSchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Update.json + */ + /** + * Sample code: GlobalSchedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Schedule resource = + manager + .globalSchedules() + .getByResourceGroupWithResponse("resourceGroupName", "labvmautostart", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Labs_ClaimAnyVm + +```java +import com.azure.core.util.Context; + +/** Samples for Labs ClaimAnyVm. */ +public final class LabsClaimAnyVmSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ClaimAnyVm.json + */ + /** + * Sample code: Labs_ClaimAnyVm. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsClaimAnyVm(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().claimAnyVm("resourceGroupName", "{labName}", Context.NONE); + } +} +``` + +### Labs_CreateEnvironment + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Labs CreateEnvironment. */ +public final class LabsCreateEnvironmentSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateEnvironment.json + */ + /** + * Sample code: Labs_CreateEnvironment. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsCreateEnvironment(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .createEnvironment( + "resourceGroupName", + "{labName}", + new LabVirtualMachineCreationParameter() + .withName("{vmName}") + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withSize("Standard_A2_v2") + .withUsername("{userName}") + .withPassword("{userPassword}") + .withLabSubnetName("{virtualnetwork-subnet-name}") + .withLabVirtualNetworkId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}") + .withDisallowPublicIpAddress(true) + .withGalleryImageReference( + new GalleryImageReference() + .withOffer("UbuntuServer") + .withPublisher("Canonical") + .withSku("16.04-LTS") + .withOsType("Linux") + .withVersion("Latest")) + .withAllowClaim(true) + .withStorageType("Standard"), + Context.NONE); + } + + @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; + } +} +``` + +### Labs_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Labs CreateOrUpdate. */ +public final class LabsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateOrUpdate.json + */ + /** + * Sample code: Labs_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .define("{labName}") + .withRegion("{location}") + .withExistingResourceGroup("resourceGroupName") + .withTags(mapOf("tagName1", "tagValue1")) + .withLabStorageType(StorageType.fromString("{Standard|Premium}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Labs_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Labs Delete. */ +public final class LabsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Delete.json + */ + /** + * Sample code: Labs_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().delete("resourceGroupName", "{labName}", Context.NONE); + } +} +``` + +### Labs_ExportResourceUsage + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ExportResourceUsageParameters; +import java.time.OffsetDateTime; + +/** Samples for Labs ExportResourceUsage. */ +public final class LabsExportResourceUsageSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ExportResourceUsage.json + */ + /** + * Sample code: Labs_ExportResourceUsage. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsExportResourceUsage(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .exportResourceUsage( + "resourceGroupName", + "{labName}", + new ExportResourceUsageParameters() + .withBlobStorageAbsoluteSasUri( + "https://invalid.blob.core.windows.net/export.blob?sv=2015-07-08&sig={sas}&sp=rcw") + .withUsageStartDate(OffsetDateTime.parse("2020-12-01T00:00:00Z")), + Context.NONE); + } +} +``` + +### Labs_GenerateUploadUri + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriParameter; + +/** Samples for Labs GenerateUploadUri. */ +public final class LabsGenerateUploadUriSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_GenerateUploadUri.json + */ + /** + * Sample code: Labs_GenerateUploadUri. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsGenerateUploadUri(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .generateUploadUriWithResponse( + "resourceGroupName", + "{labName}", + new GenerateUploadUriParameter().withBlobName("{blob-name}"), + Context.NONE); + } +} +``` + +### Labs_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Labs GetByResourceGroup. */ +public final class LabsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Get.json + */ + /** + * Sample code: Labs_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().getByResourceGroupWithResponse("resourceGroupName", "{labName}", null, Context.NONE); + } +} +``` + +### Labs_ImportVirtualMachine + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ImportLabVirtualMachineRequest; + +/** Samples for Labs ImportVirtualMachine. */ +public final class LabsImportVirtualMachineSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ImportVirtualMachine.json + */ + /** + * Sample code: Labs_ImportVirtualMachine. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsImportVirtualMachine(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .importVirtualMachine( + "resourceGroupName", + "{labName}", + new ImportLabVirtualMachineRequest() + .withSourceVirtualMachineResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{otherResourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}") + .withDestinationVirtualMachineName("{vmName}"), + Context.NONE); + } +} +``` + +### Labs_List + +```java +import com.azure.core.util.Context; + +/** Samples for Labs List. */ +public final class LabsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListBySubscription.json + */ + /** + * Sample code: Labs_ListBySubscription. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsListBySubscription(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().list(null, null, null, null, Context.NONE); + } +} +``` + +### Labs_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Labs ListByResourceGroup. */ +public final class LabsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListByResourceGroup.json + */ + /** + * Sample code: Labs_ListByResourceGroup. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsListByResourceGroup(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().listByResourceGroup("resourceGroupName", null, null, null, null, Context.NONE); + } +} +``` + +### Labs_ListVhds + +```java +import com.azure.core.util.Context; + +/** Samples for Labs ListVhds. */ +public final class LabsListVhdsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListVhds.json + */ + /** + * Sample code: Labs_ListVhds. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsListVhds(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().listVhds("resourceGroupName", "{labName}", Context.NONE); + } +} +``` + +### Labs_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Lab; + +/** Samples for Labs Update. */ +public final class LabsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Update.json + */ + /** + * Sample code: Labs_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Lab resource = + manager + .labs() + .getByResourceGroupWithResponse("resourceGroupName", "{labName}", null, Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### NotificationChannels_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.Event; +import com.azure.resourcemanager.devtestlabs.models.NotificationChannelEventType; +import java.util.Arrays; + +/** Samples for NotificationChannels CreateOrUpdate. */ +public final class NotificationChannelsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_CreateOrUpdate.json + */ + /** + * Sample code: NotificationChannels_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsCreateOrUpdate( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .define("{notificationChannelName}") + .withRegion((String) null) + .withExistingLab("resourceGroupName", "{labName}") + .withWebhookUrl("{webhookUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("en") + .withDescription("Integration configured for auto-shutdown") + .withEvents(Arrays.asList(new Event().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN))) + .create(); + } +} +``` + +### NotificationChannels_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for NotificationChannels Delete. */ +public final class NotificationChannelsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Delete.json + */ + /** + * Sample code: NotificationChannels_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .deleteWithResponse("resourceGroupName", "{labName}", "{notificationChannelName}", Context.NONE); + } +} +``` + +### NotificationChannels_Get + +```java +import com.azure.core.util.Context; + +/** Samples for NotificationChannels Get. */ +public final class NotificationChannelsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Get.json + */ + /** + * Sample code: NotificationChannels_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .getWithResponse("resourceGroupName", "{labName}", "{notificationChannelName}", null, Context.NONE); + } +} +``` + +### NotificationChannels_List + +```java +import com.azure.core.util.Context; + +/** Samples for NotificationChannels List. */ +public final class NotificationChannelsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_List.json + */ + /** + * Sample code: NotificationChannels_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.notificationChannels().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} +``` + +### NotificationChannels_Notify + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.NotificationChannelEventType; +import com.azure.resourcemanager.devtestlabs.models.NotifyParameters; + +/** Samples for NotificationChannels Notify. */ +public final class NotificationChannelsNotifySamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Notify.json + */ + /** + * Sample code: NotificationChannels_Notify. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsNotify(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .notifyWithResponse( + "resourceGroupName", + "{labName}", + "{notificationChannelName}", + new NotifyParameters() + .withEventName(NotificationChannelEventType.AUTO_SHUTDOWN) + .withJsonPayload( + "{\"eventType\":\"AutoShutdown\",\"subscriptionId\":\"{subscriptionId}\",\"resourceGroupName\":\"resourceGroupName\",\"labName\":\"{labName}\"}"), + Context.NONE); + } +} +``` + +### NotificationChannels_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.NotificationChannel; + +/** Samples for NotificationChannels Update. */ +public final class NotificationChannelsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Update.json + */ + /** + * Sample code: NotificationChannels_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + NotificationChannel resource = + manager + .notificationChannels() + .getWithResponse("resourceGroupName", "{labName}", "{notificationChannelName}", null, Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### Operations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Operations Get. */ +public final class OperationsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Operations_Get.json + */ + /** + * Sample code: Operations_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void operationsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.operations().getWithResponse("{locationName}", "{operationName}", Context.NONE); + } +} +``` + +### Policies_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.PolicyEvaluatorType; +import com.azure.resourcemanager.devtestlabs.models.PolicyFactName; +import com.azure.resourcemanager.devtestlabs.models.PolicyStatus; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Policies CreateOrUpdate. */ +public final class PoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_CreateOrUpdate.json + */ + /** + * Sample code: Policies_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .define("{policyName}") + .withRegion("{location}") + .withExistingPolicyset("resourceGroupName", "{labName}", "{policySetName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withDescription("{policyDescription}") + .withStatus(PolicyStatus.fromString("{policyStatus}")) + .withFactName(PolicyFactName.fromString("{policyFactName}")) + .withFactData("{policyFactData}") + .withThreshold("{policyThreshold}") + .withEvaluatorType(PolicyEvaluatorType.fromString("{policyEvaluatorType}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Policies_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Policies Delete. */ +public final class PoliciesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Delete.json + */ + /** + * Sample code: Policies_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .deleteWithResponse("resourceGroupName", "{labName}", "{policySetName}", "{policyName}", Context.NONE); + } +} +``` + +### Policies_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Policies Get. */ +public final class PoliciesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Get.json + */ + /** + * Sample code: Policies_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .getWithResponse("resourceGroupName", "{labName}", "{policySetName}", "{policyName}", null, Context.NONE); + } +} +``` + +### Policies_List + +```java +import com.azure.core.util.Context; + +/** Samples for Policies List. */ +public final class PoliciesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_List.json + */ + /** + * Sample code: Policies_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .list("resourceGroupName", "{labName}", "{policySetName}", null, null, null, null, Context.NONE); + } +} +``` + +### Policies_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Policy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Policies Update. */ +public final class PoliciesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Update.json + */ + /** + * Sample code: Policies_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Policy resource = + manager + .policies() + .getWithResponse( + "resourceGroupName", "{labName}", "{policySetName}", "{policyName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### PolicySets_EvaluatePolicies + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesProperties; +import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesRequest; +import java.util.Arrays; + +/** Samples for PolicySets EvaluatePolicies. */ +public final class PolicySetsEvaluatePoliciesSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/PolicySets_EvaluatePolicies.json + */ + /** + * Sample code: PolicySets_EvaluatePolicies. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policySetsEvaluatePolicies(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policySets() + .evaluatePoliciesWithResponse( + "resourceGroupName", + "{labName}", + "{policySetName}", + new EvaluatePoliciesRequest() + .withPolicies( + Arrays + .asList(new EvaluatePoliciesProperties().withFactName("LabVmCount").withValueOffset("1"))), + Context.NONE); + } +} +``` + +### ProviderOperations_List + +```java +import com.azure.core.util.Context; + +/** Samples for ProviderOperations List. */ +public final class ProviderOperationsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ProviderOperations_List.json + */ + /** + * Sample code: ProviderOperations_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void providerOperationsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.providerOperations().list(Context.NONE); + } +} +``` + +### Schedules_CreateOrUpdate + +```java +import com.azure.core.util.Context; +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; + +/** Samples for Schedules CreateOrUpdate. */ +public final class SchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_CreateOrUpdate.json + */ + /** + * Sample code: Schedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .schedules() + .createOrUpdateWithResponse( + "resourceGroupName", + "{labName}", + "{scheduleName}", + new ScheduleInner() + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTaskType("{myLabVmTaskType}") + .withWeeklyRecurrence( + new WeekDetails() + .withWeekdays(Arrays.asList("Monday", "Wednesday", "Friday")) + .withTime("{timeOfTheDayTheScheduleWillOccurOnThoseDays}")) + .withDailyRecurrence(new DayDetails().withTime("{timeOfTheDayTheScheduleWillOccurEveryDay}")) + .withHourlyRecurrence(new HourDetails().withMinute(30)) + .withTimeZoneId("Pacific Standard Time") + .withNotificationSettings( + new NotificationSettings() + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTimeInMinutes(15) + .withWebhookUrl("{webhookUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("EN")) + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"), + Context.NONE); + } + + @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; + } +} +``` + +### Schedules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules Delete. */ +public final class SchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Delete.json + */ + /** + * Sample code: Schedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().deleteWithResponse("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} +``` + +### Schedules_Execute + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules Execute. */ +public final class SchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Execute.json + */ + /** + * Sample code: Schedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesExecute(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().execute("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} +``` + +### Schedules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules Get. */ +public final class SchedulesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Get.json + */ + /** + * Sample code: Schedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().getWithResponse("resourceGroupName", "{labName}", "{scheduleName}", null, Context.NONE); + } +} +``` + +### Schedules_List + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules List. */ +public final class SchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_List.json + */ + /** + * Sample code: Schedules_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} +``` + +### Schedules_ListApplicable + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules ListApplicable. */ +public final class SchedulesListApplicableSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_ListApplicable.json + */ + /** + * Sample code: Schedules_ListApplicable. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesListApplicable(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().listApplicable("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} +``` + +### Schedules_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Schedules Update. */ +public final class SchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Update.json + */ + /** + * Sample code: Schedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .schedules() + .updateWithResponse( + "resourceGroupName", + "{labName}", + "{scheduleName}", + new ScheduleFragment().withTags(mapOf("tagName1", "tagValue1")), + Context.NONE); + } + + @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; + } +} +``` + +### Secrets_CreateOrUpdate + +```java +/** Samples for Secrets CreateOrUpdate. */ +public final class SecretsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_CreateOrUpdate.json + */ + /** + * Sample code: Secrets_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .secrets() + .define("{secretName}") + .withRegion((String) null) + .withExistingUser("resourceGroupName", "{labName}", "{userName}") + .withValue("{secret}") + .create(); + } +} +``` + +### Secrets_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Secrets Delete. */ +public final class SecretsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Delete.json + */ + /** + * Sample code: Secrets_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .secrets() + .deleteWithResponse("resourceGroupName", "{labName}", "{userName}", "{secretName}", Context.NONE); + } +} +``` + +### Secrets_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Secrets Get. */ +public final class SecretsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Get.json + */ + /** + * Sample code: Secrets_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .secrets() + .getWithResponse("resourceGroupName", "{labName}", "{userName}", "{secretName}", null, Context.NONE); + } +} +``` + +### Secrets_List + +```java +import com.azure.core.util.Context; + +/** Samples for Secrets List. */ +public final class SecretsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_List.json + */ + /** + * Sample code: Secrets_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.secrets().list("resourceGroupName", "{labName}", "{userName}", null, null, null, null, Context.NONE); + } +} +``` + +### Secrets_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Secret; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Secrets Update. */ +public final class SecretsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Update.json + */ + /** + * Sample code: Secrets_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Secret resource = + manager + .secrets() + .getWithResponse("resourceGroupName", "{labName}", "{userName}", "{secretName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ServiceFabricSchedules_CreateOrUpdate + +```java +import com.azure.core.util.Context; +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; + +/** Samples for ServiceFabricSchedules CreateOrUpdate. */ +public final class ServiceFabricSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_CreateOrUpdate.json + */ + /** + * Sample code: ServiceFabricSchedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesCreateOrUpdate( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .createOrUpdateWithResponse( + "resourceGroupName", + "{labName}", + "@me", + "{serviceFrabicName}", + "{scheduleName}", + new ScheduleInner() + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTaskType( + "{Unknown|LabVmsShutdownTask|LabVmsStartupTask|LabVmReclamationTask|ComputeVmShutdownTask}") + .withWeeklyRecurrence( + new WeekDetails() + .withWeekdays( + Arrays + .asList( + "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")) + .withTime("19:00")) + .withDailyRecurrence(new DayDetails().withTime("19:00")) + .withHourlyRecurrence(new HourDetails().withMinute(0)) + .withTimeZoneId("Pacific Standard Time") + .withNotificationSettings( + new NotificationSettings() + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTimeInMinutes(15) + .withWebhookUrl("{webhoolUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("EN")) + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}"), + Context.NONE); + } + + @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; + } +} +``` + +### ServiceFabricSchedules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules Delete. */ +public final class ServiceFabricSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Delete.json + */ + /** + * Sample code: ServiceFabricSchedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .deleteWithResponse( + "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", Context.NONE); + } +} +``` + +### ServiceFabricSchedules_Execute + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules Execute. */ +public final class ServiceFabricSchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Execute.json + */ + /** + * Sample code: ServiceFabricSchedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesExecute(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .execute("resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", Context.NONE); + } +} +``` + +### ServiceFabricSchedules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules Get. */ +public final class ServiceFabricSchedulesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Get.json + */ + /** + * Sample code: ServiceFabricSchedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .getWithResponse( + "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", null, Context.NONE); + } +} +``` + +### ServiceFabricSchedules_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules List. */ +public final class ServiceFabricSchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_List.json + */ + /** + * Sample code: ServiceFabricSchedules_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .list("resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", null, null, null, null, Context.NONE); + } +} +``` + +### ServiceFabricSchedules_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabricSchedules Update. */ +public final class ServiceFabricSchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Update.json + */ + /** + * Sample code: ServiceFabricSchedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .updateWithResponse( + "resourceGroupName", + "{labName}", + "@me", + "{serviceFrabicName}", + "{scheduleName}", + new ScheduleFragment().withTags(mapOf("tagName1", "tagValue1")), + Context.NONE); + } + + @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; + } +} +``` + +### ServiceFabrics_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabrics CreateOrUpdate. */ +public final class ServiceFabricsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_CreateOrUpdate.json + */ + /** + * Sample code: ServiceFabrics_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .define("{serviceFabricName}") + .withRegion("{location}") + .withExistingUser("resourceGroupName", "{labName}", "{userName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withExternalServiceFabricId("{serviceFabricId}") + .withEnvironmentId("{environmentId}") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ServiceFabrics_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Delete. */ +public final class ServiceFabricsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Delete.json + */ + /** + * Sample code: ServiceFabrics_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .delete("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} +``` + +### ServiceFabrics_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Get. */ +public final class ServiceFabricsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Get.json + */ + /** + * Sample code: ServiceFabrics_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .getWithResponse("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", null, Context.NONE); + } +} +``` + +### ServiceFabrics_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics List. */ +public final class ServiceFabricsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_List.json + */ + /** + * Sample code: ServiceFabrics_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .list("resourceGroupName", "{labName}", "{userName}", null, null, null, null, Context.NONE); + } +} +``` + +### ServiceFabrics_ListApplicableSchedules + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics ListApplicableSchedules. */ +public final class ServiceFabricsListApplicableSchedulesSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_ListApplicableSchedules.json + */ + /** + * Sample code: ServiceFabrics_ListApplicableSchedules. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsListApplicableSchedules( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .listApplicableSchedulesWithResponse( + "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} +``` + +### ServiceFabrics_Start + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Start. */ +public final class ServiceFabricsStartSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Start.json + */ + /** + * Sample code: ServiceFabrics_Start. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsStart(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .start("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} +``` + +### ServiceFabrics_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Stop. */ +public final class ServiceFabricsStopSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Stop.json + */ + /** + * Sample code: ServiceFabrics_Stop. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsStop(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .stop("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} +``` + +### ServiceFabrics_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ServiceFabric; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabrics Update. */ +public final class ServiceFabricsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Update.json + */ + /** + * Sample code: ServiceFabrics_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + ServiceFabric resource = + manager + .serviceFabrics() + .getWithResponse( + "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ServiceRunners_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.IdentityProperties; +import com.azure.resourcemanager.devtestlabs.models.ManagedIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceRunners CreateOrUpdate. */ +public final class ServiceRunnersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_CreateOrUpdate.json + */ + /** + * Sample code: ServiceRunners_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceRunners() + .define("{servicerunnerName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{devtestlabName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withIdentity( + new IdentityProperties() + .withType(ManagedIdentityType.fromString("{identityType}")) + .withPrincipalId("{identityPrincipalId}") + .withTenantId("{identityTenantId}") + .withClientSecretUrl("{identityClientSecretUrl}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ServiceRunners_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceRunners Delete. */ +public final class ServiceRunnersDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Delete.json + */ + /** + * Sample code: ServiceRunners_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceRunners() + .deleteWithResponse("resourceGroupName", "{devtestlabName}", "{servicerunnerName}", Context.NONE); + } +} +``` + +### ServiceRunners_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceRunners Get. */ +public final class ServiceRunnersGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Get.json + */ + /** + * Sample code: ServiceRunners_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceRunners() + .getWithResponse("resourceGroupName", "{devtestlabName}", "{servicerunnerName}", Context.NONE); + } +} +``` + +### Users_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.UserIdentity; +import com.azure.resourcemanager.devtestlabs.models.UserSecretStore; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Users CreateOrUpdate. */ +public final class UsersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_CreateOrUpdate.json + */ + /** + * Sample code: Users_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .users() + .define("{userName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{devtestlabName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withIdentity( + new UserIdentity() + .withPrincipalName("{principalName}") + .withPrincipalId("{principalId}") + .withTenantId("{tenantId}") + .withObjectId("{objectId}") + .withAppId("{appId}")) + .withSecretStore(new UserSecretStore().withKeyVaultUri("{keyVaultUri}").withKeyVaultId("{keyVaultId}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Users_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Users Delete. */ +public final class UsersDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Delete.json + */ + /** + * Sample code: Users_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.users().delete("resourceGroupName", "{devtestlabName}", "{userName}", Context.NONE); + } +} +``` + +### Users_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Users Get. */ +public final class UsersGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Get.json + */ + /** + * Sample code: Users_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.users().getWithResponse("resourceGroupName", "{devtestlabName}", "{userName}", null, Context.NONE); + } +} +``` + +### Users_List + +```java +import com.azure.core.util.Context; + +/** Samples for Users List. */ +public final class UsersListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_List.json + */ + /** + * Sample code: Users_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.users().list("resourceGroupName", "{devtestlabName}", null, null, null, null, Context.NONE); + } +} +``` + +### Users_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.User; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Users Update. */ +public final class UsersUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Update.json + */ + /** + * Sample code: Users_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + User resource = + manager + .users() + .getWithResponse("resourceGroupName", "{devtestlabName}", "{userName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualMachineSchedules_CreateOrUpdate + +```java +import com.azure.core.util.Context; +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; + +/** Samples for VirtualMachineSchedules CreateOrUpdate. */ +public final class VirtualMachineSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_CreateOrUpdate.json + */ + /** + * Sample code: VirtualMachineSchedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesCreateOrUpdate( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .createOrUpdateWithResponse( + "resourceGroupName", + "{labName}", + "{vmName}", + "LabVmsShutdown", + new ScheduleInner() + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withStatus(EnableStatus.ENABLED) + .withTaskType("LabVmsShutdownTask") + .withWeeklyRecurrence( + new WeekDetails().withWeekdays(Arrays.asList("Friday", "Saturday", "Sunday")).withTime("1700")) + .withDailyRecurrence(new DayDetails().withTime("1900")) + .withHourlyRecurrence(new HourDetails().withMinute(30)) + .withTimeZoneId("Pacific Standard Time") + .withNotificationSettings( + new NotificationSettings() + .withStatus(EnableStatus.ENABLED) + .withTimeInMinutes(30) + .withWebhookUrl("{webhookUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("EN")) + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}"), + Context.NONE); + } + + @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; + } +} +``` + +### VirtualMachineSchedules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules Delete. */ +public final class VirtualMachineSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Delete.json + */ + /** + * Sample code: VirtualMachineSchedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .deleteWithResponse("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", Context.NONE); + } +} +``` + +### VirtualMachineSchedules_Execute + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules Execute. */ +public final class VirtualMachineSchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Execute.json + */ + /** + * Sample code: VirtualMachineSchedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesExecute( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .execute("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", Context.NONE); + } +} +``` + +### VirtualMachineSchedules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules Get. */ +public final class VirtualMachineSchedulesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Get.json + */ + /** + * Sample code: VirtualMachineSchedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .getWithResponse("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", null, Context.NONE); + } +} +``` + +### VirtualMachineSchedules_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules List. */ +public final class VirtualMachineSchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_List.json + */ + /** + * Sample code: VirtualMachineSchedules_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .list("resourceGroupName", "{labName}", "{vmName}", null, null, null, null, Context.NONE); + } +} +``` + +### VirtualMachineSchedules_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachineSchedules Update. */ +public final class VirtualMachineSchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Update.json + */ + /** + * Sample code: VirtualMachineSchedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .updateWithResponse( + "resourceGroupName", + "{labName}", + "{vmName}", + "LabVmsShutdown", + new ScheduleFragment().withTags(mapOf("tagName1", "tagValue1")), + Context.NONE); + } + + @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; + } +} +``` + +### VirtualMachines_AddDataDisk + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.AttachNewDataDiskOptions; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.StorageType; + +/** Samples for VirtualMachines AddDataDisk. */ +public final class VirtualMachinesAddDataDiskSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_AddDataDisk.json + */ + /** + * Sample code: VirtualMachines_AddDataDisk. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesAddDataDisk(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .addDataDisk( + "resourceGroupName", + "{labName}", + "{virtualMachineName}", + new DataDiskProperties() + .withAttachNewDataDiskOptions( + new AttachNewDataDiskOptions() + .withDiskSizeGiB(127) + .withDiskName("{diskName}") + .withDiskType(StorageType.fromString("{diskType}"))), + Context.NONE); + } +} +``` + +### VirtualMachines_ApplyArtifacts + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ApplyArtifactsRequest; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import java.util.Arrays; + +/** Samples for VirtualMachines ApplyArtifacts. */ +public final class VirtualMachinesApplyArtifactsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_ApplyArtifacts.json + */ + /** + * Sample code: VirtualMachines_ApplyArtifacts. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesApplyArtifacts(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .applyArtifacts( + "resourceGroupName", + "{labName}", + "{vmName}", + new ApplyArtifactsRequest() + .withArtifacts( + Arrays + .asList( + new ArtifactInstallProperties() + .withArtifactId( + "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/public" + + " repo/artifacts/windows-restart"))), + Context.NONE); + } +} +``` + +### VirtualMachines_Claim + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Claim. */ +public final class VirtualMachinesClaimSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Claim.json + */ + /** + * Sample code: VirtualMachines_Claim. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesClaim(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().claim("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachines CreateOrUpdate. */ +public final class VirtualMachinesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_CreateOrUpdate.json + */ + /** + * Sample code: VirtualMachines_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .define("{vmName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withSize("Standard_A2_v2") + .withUsername("{userName}") + .withPassword("{userPassword}") + .withLabSubnetName("{virtualNetworkName}Subnet") + .withLabVirtualNetworkId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}") + .withDisallowPublicIpAddress(true) + .withGalleryImageReference( + new GalleryImageReference() + .withOffer("UbuntuServer") + .withPublisher("Canonical") + .withSku("16.04-LTS") + .withOsType("Linux") + .withVersion("Latest")) + .withAllowClaim(true) + .withStorageType("Standard") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualMachines_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Delete. */ +public final class VirtualMachinesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Delete.json + */ + /** + * Sample code: VirtualMachines_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().delete("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_DetachDataDisk + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DetachDataDiskProperties; + +/** Samples for VirtualMachines DetachDataDisk. */ +public final class VirtualMachinesDetachDataDiskSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_DetachDataDisk.json + */ + /** + * Sample code: VirtualMachines_DetachDataDisk. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesDetachDataDisk(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .detachDataDisk( + "resourceGroupName", + "{labName}", + "{virtualMachineName}", + new DetachDataDiskProperties() + .withExistingLabDiskId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{virtualMachineName}"), + Context.NONE); + } +} +``` + +### VirtualMachines_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Get. */ +public final class VirtualMachinesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Get.json + */ + /** + * Sample code: VirtualMachines_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().getWithResponse("resourceGroupName", "{labName}", "{vmName}", null, Context.NONE); + } +} +``` + +### VirtualMachines_GetRdpFileContents + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines GetRdpFileContents. */ +public final class VirtualMachinesGetRdpFileContentsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_GetRdpFileContents.json + */ + /** + * Sample code: VirtualMachines_GetRdpFileContents. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesGetRdpFileContents( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .getRdpFileContentsWithResponse("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines List. */ +public final class VirtualMachinesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_List.json + */ + /** + * Sample code: VirtualMachines_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} +``` + +### VirtualMachines_ListApplicableSchedules + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines ListApplicableSchedules. */ +public final class VirtualMachinesListApplicableSchedulesSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_ListApplicableSchedules.json + */ + /** + * Sample code: VirtualMachines_ListApplicableSchedules. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesListApplicableSchedules( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .listApplicableSchedulesWithResponse("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_Redeploy + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Redeploy. */ +public final class VirtualMachinesRedeploySamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Redeploy.json + */ + /** + * Sample code: VirtualMachines_Redeploy. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesRedeploy(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().redeploy("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_Resize + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ResizeLabVirtualMachineProperties; + +/** Samples for VirtualMachines Resize. */ +public final class VirtualMachinesResizeSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Resize.json + */ + /** + * Sample code: VirtualMachines_Resize. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesResize(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .resize( + "resourceGroupName", + "{labName}", + "{vmName}", + new ResizeLabVirtualMachineProperties().withSize("Standard_A4_v2"), + Context.NONE); + } +} +``` + +### VirtualMachines_Restart + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Restart. */ +public final class VirtualMachinesRestartSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Restart.json + */ + /** + * Sample code: VirtualMachines_Restart. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesRestart(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().restart("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_Start + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Start. */ +public final class VirtualMachinesStartSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Start.json + */ + /** + * Sample code: VirtualMachines_Start. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesStart(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().start("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Stop. */ +public final class VirtualMachinesStopSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Stop.json + */ + /** + * Sample code: VirtualMachines_Stop. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesStop(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().stop("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_TransferDisks + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines TransferDisks. */ +public final class VirtualMachinesTransferDisksSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_TransferDisks.json + */ + /** + * Sample code: VirtualMachines_TransferDisks. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesTransferDisks(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().transferDisks("resourceGroupName", "{labName}", "{virtualmachineName}", Context.NONE); + } +} +``` + +### VirtualMachines_UnClaim + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines UnClaim. */ +public final class VirtualMachinesUnClaimSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_UnClaim.json + */ + /** + * Sample code: VirtualMachines_UnClaim. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesUnClaim(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().unClaim("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachine; + +/** Samples for VirtualMachines Update. */ +public final class VirtualMachinesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Update.json + */ + /** + * Sample code: VirtualMachines_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + LabVirtualMachine resource = + manager + .virtualMachines() + .getWithResponse("resourceGroupName", "{labName}", "{vmName}", null, Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### VirtualNetworks_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualNetworks CreateOrUpdate. */ +public final class VirtualNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_CreateOrUpdate.json + */ + /** + * Sample code: VirtualNetworks_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualNetworks() + .define("{virtualNetworkName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withTags(mapOf("tagName1", "tagValue1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualNetworks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks Delete. */ +public final class VirtualNetworksDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Delete.json + */ + /** + * Sample code: VirtualNetworks_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualNetworks().delete("resourceGroupName", "{labName}", "{virtualNetworkName}", Context.NONE); + } +} +``` + +### VirtualNetworks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks Get. */ +public final class VirtualNetworksGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Get.json + */ + /** + * Sample code: VirtualNetworks_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualNetworks() + .getWithResponse("resourceGroupName", "{labName}", "{virtualNetworkName}", null, Context.NONE); + } +} +``` + +### VirtualNetworks_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks List. */ +public final class VirtualNetworksListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_List.json + */ + /** + * Sample code: VirtualNetworks_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualNetworks().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} +``` + +### VirtualNetworks_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.VirtualNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualNetworks Update. */ +public final class VirtualNetworksUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Update.json + */ + /** + * Sample code: VirtualNetworks_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + VirtualNetwork resource = + manager + .virtualNetworks() + .getWithResponse("resourceGroupName", "{labName}", "{virtualNetworkName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml index 4a30c0f966d7..4c0f53371142 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml @@ -1,67 +1,86 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-devtestlabs - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-devtestlabs + 1.0.0-beta.2 + 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. - https://github.com/Azure/azure-sdk-for-java + 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. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - - - - - com.azure - azure-core - 1.21.0 - - - com.azure - azure-core-management - 1.4.2 - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.7 - - true - - - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.21.0 + + + com.azure + azure-core-management + 1.4.2 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.7 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + 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 96929b98af39..1e24672d873e 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 @@ -9,7 +9,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +16,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -173,6 +173,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -212,6 +213,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -268,6 +280,9 @@ public DevTestLabsManager authenticate(TokenCredential credential, AzureProfile userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } @@ -277,10 +292,7 @@ public DevTestLabsManager authenticate(TokenCredential credential, AzureProfile HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); 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 f62f57f8cb68..260a2c0ec980 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 @@ -97,7 +97,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a custom image. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CustomImageInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, CustomImageInner customImage); @@ -114,7 +114,7 @@ SyncPoller, CustomImageInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a custom image. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CustomImageInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, CustomImageInner customImage, Context context); @@ -162,7 +162,7 @@ CustomImageInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name); /** @@ -177,7 +177,7 @@ CustomImageInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context); 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 4e6fda42b3e6..7aa3df11060f 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 @@ -105,7 +105,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Disk. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DiskInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, DiskInner disk); @@ -123,7 +123,7 @@ SyncPoller, DiskInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Disk. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DiskInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, DiskInner disk, Context context); @@ -173,7 +173,7 @@ DiskInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name); @@ -190,7 +190,7 @@ SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name, Context context); @@ -270,7 +270,7 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginAttach( String resourceGroupName, String labName, @@ -292,7 +292,7 @@ SyncPoller, Void> beginAttach( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginAttach( String resourceGroupName, String labName, @@ -357,7 +357,7 @@ void attach( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDetach( String resourceGroupName, String labName, @@ -380,7 +380,7 @@ SyncPoller, Void> beginDetach( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDetach( String resourceGroupName, String labName, 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 c7cc0d54c506..25024af96055 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 @@ -103,7 +103,7 @@ Response getWithResponse( * @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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DtlEnvironmentInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, DtlEnvironmentInner dtlEnvironment); @@ -121,7 +121,7 @@ SyncPoller, DtlEnvironmentInner> beginCreateOrUp * @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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DtlEnvironmentInner> beginCreateOrUpdate( String resourceGroupName, String labName, @@ -182,7 +182,7 @@ DtlEnvironmentInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name); @@ -199,7 +199,7 @@ SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( 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/FormulasClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/FormulasClient.java index e5897892f1d3..f2b70544953d 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 @@ -97,7 +97,7 @@ Response getWithResponse( * @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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, FormulaInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, FormulaInner formula); @@ -114,7 +114,7 @@ SyncPoller, FormulaInner> beginCreateOrUpdate( * @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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, FormulaInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, FormulaInner formula, Context context); 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 2056c0c2030a..561ced1c582a 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 @@ -198,7 +198,7 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute(String resourceGroupName, String name); /** @@ -212,7 +212,7 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute(String resourceGroupName, String name, Context context); /** @@ -251,7 +251,7 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRetarget( String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties); @@ -267,7 +267,7 @@ SyncPoller, Void> beginRetarget( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRetarget( String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties, Context context); 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 7c67e3a3e40d..e1895b4517fe 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 @@ -118,7 +118,7 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a lab. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, LabInner> beginCreateOrUpdate(String resourceGroupName, String name, LabInner lab); /** @@ -133,7 +133,7 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a lab. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, LabInner> beginCreateOrUpdate( String resourceGroupName, String name, LabInner lab, Context context); @@ -176,7 +176,7 @@ SyncPoller, LabInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String name); /** @@ -190,7 +190,7 @@ SyncPoller, LabInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); /** @@ -257,7 +257,7 @@ SyncPoller, LabInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginClaimAnyVm(String resourceGroupName, String name); /** @@ -271,7 +271,7 @@ SyncPoller, LabInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginClaimAnyVm(String resourceGroupName, String name, Context context); /** @@ -310,7 +310,7 @@ SyncPoller, LabInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginCreateEnvironment( String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter); @@ -326,7 +326,7 @@ SyncPoller, Void> beginCreateEnvironment( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginCreateEnvironment( String resourceGroupName, String name, @@ -376,7 +376,7 @@ void createEnvironment( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExportResourceUsage( String resourceGroupName, String name, ExportResourceUsageParameters exportResourceUsageParameters); @@ -392,7 +392,7 @@ SyncPoller, Void> beginExportResourceUsage( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExportResourceUsage( String resourceGroupName, String name, @@ -474,7 +474,7 @@ Response generateUploadUriWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginImportVirtualMachine( String resourceGroupName, String name, ImportLabVirtualMachineRequest importLabVirtualMachineRequest); @@ -491,7 +491,7 @@ SyncPoller, Void> beginImportVirtualMachine( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginImportVirtualMachine( String resourceGroupName, String name, 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 ea32206bbdd6..81c0e81e3592 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 @@ -188,7 +188,7 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String name); /** @@ -203,7 +203,7 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String name, Context context); 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 4eefb92a8939..27ed2a344984 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 @@ -103,7 +103,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a secret. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SecretInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, SecretInner secret); @@ -121,7 +121,7 @@ SyncPoller, SecretInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a secret. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SecretInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, SecretInner secret, 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 76f59363278b..db78a956411e 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 @@ -249,7 +249,7 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String username, String serviceFabricName, String name); @@ -267,7 +267,7 @@ SyncPoller, Void> beginExecute( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute( String resourceGroupName, String labName, 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 dfd47c899d69..90bdb9d47a30 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 @@ -104,7 +104,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Service Fabric. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServiceFabricInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, ServiceFabricInner serviceFabric); @@ -122,7 +122,7 @@ SyncPoller, ServiceFabricInner> beginCreateOrUpda * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Service Fabric. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServiceFabricInner> beginCreateOrUpdate( String resourceGroupName, String labName, @@ -183,7 +183,7 @@ ServiceFabricInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name); @@ -200,7 +200,7 @@ SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name, Context context); @@ -318,7 +318,7 @@ Response listApplicableSchedulesWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStart( String resourceGroupName, String labName, String username, String name); @@ -335,7 +335,7 @@ SyncPoller, Void> beginStart( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStart( String resourceGroupName, String labName, String username, String name, Context context); @@ -380,7 +380,7 @@ SyncPoller, Void> beginStart( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStop( String resourceGroupName, String labName, String username, String name); @@ -397,7 +397,7 @@ SyncPoller, Void> beginStop( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStop( 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/UsersClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/UsersClient.java index 4b11461cecb0..480f46083731 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 @@ -97,7 +97,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return profile of a lab user. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, UserInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, UserInner user); @@ -114,7 +114,7 @@ SyncPoller, UserInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return profile of a lab user. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, UserInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, UserInner user, Context context); @@ -160,7 +160,7 @@ SyncPoller, UserInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name); /** @@ -175,7 +175,7 @@ SyncPoller, UserInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, 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 f65bbd0104c7..267e51a2205b 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 @@ -218,7 +218,7 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String virtualMachineName, String name); @@ -235,7 +235,7 @@ SyncPoller, Void> beginExecute( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String virtualMachineName, String name, Context context); 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 317f3a8544ea..d1363746f18f 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 @@ -105,7 +105,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, LabVirtualMachineInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine); @@ -122,7 +122,7 @@ SyncPoller, LabVirtualMachineInner> beginCrea * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, LabVirtualMachineInner> beginCreateOrUpdate( String resourceGroupName, String labName, @@ -178,7 +178,7 @@ LabVirtualMachineInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name); /** @@ -193,7 +193,7 @@ LabVirtualMachineInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context); @@ -273,7 +273,7 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginAddDataDisk( String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties); @@ -290,7 +290,7 @@ SyncPoller, Void> beginAddDataDisk( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginAddDataDisk( String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties, Context context); @@ -336,7 +336,7 @@ void addDataDisk( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginApplyArtifacts( String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest); @@ -353,7 +353,7 @@ SyncPoller, Void> beginApplyArtifacts( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginApplyArtifacts( String resourceGroupName, String labName, @@ -407,7 +407,7 @@ void applyArtifacts( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginClaim(String resourceGroupName, String labName, String name); /** @@ -422,7 +422,7 @@ void applyArtifacts( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginClaim( String resourceGroupName, String labName, String name, Context context); @@ -465,7 +465,7 @@ SyncPoller, Void> beginClaim( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDetachDataDisk( String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties); @@ -482,7 +482,7 @@ SyncPoller, Void> beginDetachDataDisk( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDetachDataDisk( String resourceGroupName, String labName, @@ -596,7 +596,7 @@ Response listApplicableSchedulesWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRedeploy(String resourceGroupName, String labName, String name); /** @@ -611,7 +611,7 @@ Response listApplicableSchedulesWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRedeploy( String resourceGroupName, String labName, String name, Context context); @@ -654,7 +654,7 @@ SyncPoller, Void> beginRedeploy( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginResize( String resourceGroupName, String labName, @@ -674,7 +674,7 @@ SyncPoller, Void> beginResize( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginResize( String resourceGroupName, String labName, @@ -731,7 +731,7 @@ void resize( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRestart(String resourceGroupName, String labName, String name); /** @@ -746,7 +746,7 @@ void resize( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRestart( String resourceGroupName, String labName, String name, Context context); @@ -788,7 +788,7 @@ SyncPoller, Void> beginRestart( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStart(String resourceGroupName, String labName, String name); /** @@ -803,7 +803,7 @@ SyncPoller, Void> beginRestart( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStart( String resourceGroupName, String labName, String name, Context context); @@ -845,7 +845,7 @@ SyncPoller, Void> beginStart( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStop(String resourceGroupName, String labName, String name); /** @@ -860,7 +860,7 @@ SyncPoller, Void> beginStart( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStop( String resourceGroupName, String labName, String name, Context context); @@ -903,7 +903,7 @@ SyncPoller, Void> beginStop( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTransferDisks(String resourceGroupName, String labName, String name); /** @@ -919,7 +919,7 @@ SyncPoller, Void> beginStop( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTransferDisks( String resourceGroupName, String labName, String name, Context context); @@ -963,7 +963,7 @@ SyncPoller, Void> beginTransferDisks( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginUnClaim(String resourceGroupName, String labName, String name); /** @@ -978,7 +978,7 @@ SyncPoller, Void> beginTransferDisks( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginUnClaim( String resourceGroupName, String labName, String name, Context context); 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 aa4dc054554c..921b7a0904c1 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 @@ -97,7 +97,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual network. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork); @@ -114,7 +114,7 @@ SyncPoller, VirtualNetworkInner> beginCreateOrUp * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual network. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork, Context context); @@ -162,7 +162,7 @@ VirtualNetworkInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name); /** @@ -177,7 +177,7 @@ VirtualNetworkInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, 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 1fb9d099da1c..4c96b194cc22 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -13,24 +12,38 @@ import java.util.Map; /** Schedules applicable to a virtual machine. The schedules may have been defined on a VM or on lab level. */ -@JsonFlatten @Fluent -public class ApplicableScheduleInner extends Resource { +public final class ApplicableScheduleInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicableScheduleInner.class); /* - * The auto-shutdown schedule, if one has been set at the lab or lab - * resource level. + * The properties of the resource. */ - @JsonProperty(value = "properties.labVmsShutdown") - private ScheduleInner labVmsShutdown; + @JsonProperty(value = "properties", required = true) + private ApplicableSchedulePropertiesInner innerProperties = new ApplicableSchedulePropertiesInner(); - /* - * The auto-startup schedule, if one has been set at the lab or lab - * resource level. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.labVmsStartup") - private ScheduleInner labVmsStartup; + private ApplicableSchedulePropertiesInner innerProperties() { + return this.innerProperties; + } + + /** {@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 @@ -39,7 +52,7 @@ public class ApplicableScheduleInner extends Resource { * @return the labVmsShutdown value. */ public ScheduleInner labVmsShutdown() { - return this.labVmsShutdown; + return this.innerProperties() == null ? null : this.innerProperties().labVmsShutdown(); } /** @@ -50,7 +63,10 @@ public ScheduleInner labVmsShutdown() { * @return the ApplicableScheduleInner object itself. */ public ApplicableScheduleInner withLabVmsShutdown(ScheduleInner labVmsShutdown) { - this.labVmsShutdown = labVmsShutdown; + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withLabVmsShutdown(labVmsShutdown); return this; } @@ -60,7 +76,7 @@ public ApplicableScheduleInner withLabVmsShutdown(ScheduleInner labVmsShutdown) * @return the labVmsStartup value. */ public ScheduleInner labVmsStartup() { - return this.labVmsStartup; + return this.innerProperties() == null ? null : this.innerProperties().labVmsStartup(); } /** @@ -70,21 +86,10 @@ public ScheduleInner labVmsStartup() { * @return the ApplicableScheduleInner object itself. */ public ApplicableScheduleInner withLabVmsStartup(ScheduleInner labVmsStartup) { - this.labVmsStartup = labVmsStartup; - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicableScheduleInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ApplicableScheduleInner withTags(Map tags) { - super.withTags(tags); + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withLabVmsStartup(labVmsStartup); return this; } @@ -94,11 +99,13 @@ public ApplicableScheduleInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (labVmsShutdown() != null) { - labVmsShutdown().validate(); - } - if (labVmsStartup() != null) { - labVmsStartup().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ApplicableScheduleInner")); + } else { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..e8110ff0641a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableSchedulePropertiesInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a schedules applicable to a virtual machine. */ +@Fluent +public final class ApplicableSchedulePropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicableSchedulePropertiesInner.class); + + /* + * The auto-shutdown schedule, if one has been set at the lab or lab + * resource level. + */ + @JsonProperty(value = "labVmsShutdown") + private ScheduleInner labVmsShutdown; + + /* + * The auto-startup schedule, if one has been set at the lab or lab + * resource level. + */ + @JsonProperty(value = "labVmsStartup") + private ScheduleInner labVmsStartup; + + /** + * Get the labVmsShutdown property: The auto-shutdown schedule, if one has been set at the lab or lab resource + * level. + * + * @return the labVmsShutdown value. + */ + 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. + * + * @return the labVmsStartup value. + */ + 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(); + } + } +} 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 fa6c94a5a485..93daf43b6ee4 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 @@ -4,8 +4,7 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.ParametersValueFileInfo; @@ -16,59 +15,38 @@ import java.util.Map; /** An Azure Resource Manager template. */ -@JsonFlatten -@Immutable -public class ArmTemplateInner extends Resource { +@Fluent +public final class ArmTemplateInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmTemplateInner.class); /* - * The display name of the ARM template. + * The properties of the resource. */ - @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; + @JsonProperty(value = "properties", required = true) + private ArmTemplateProperties innerProperties = new ArmTemplateProperties(); - /* - * The description of the ARM template. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The publisher of the ARM template. - */ - @JsonProperty(value = "properties.publisher", access = JsonProperty.Access.WRITE_ONLY) - private String publisher; - - /* - * The URI to the icon of the ARM template. - */ - @JsonProperty(value = "properties.icon", access = JsonProperty.Access.WRITE_ONLY) - private String icon; - - /* - * The contents of the ARM template. - */ - @JsonProperty(value = "properties.contents", access = JsonProperty.Access.WRITE_ONLY) - private Object contents; - - /* - * The creation date of the armTemplate. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + private ArmTemplateProperties innerProperties() { + return this.innerProperties; + } - /* - * File name and parameter values information from all - * azuredeploy.*.parameters.json for the ARM template. - */ - @JsonProperty(value = "properties.parametersValueFilesInfo", access = JsonProperty.Access.WRITE_ONLY) - private List parametersValueFilesInfo; + /** {@inheritDoc} */ + @Override + public ArmTemplateInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * Whether or not ARM template is enabled for use by lab user. - */ - @JsonProperty(value = "properties.enabled", access = JsonProperty.Access.WRITE_ONLY) - private Boolean enabled; + /** {@inheritDoc} */ + @Override + public ArmTemplateInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the displayName property: The display name of the ARM template. @@ -76,7 +54,7 @@ public class ArmTemplateInner extends Resource { * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -85,7 +63,7 @@ public String displayName() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -94,7 +72,7 @@ public String description() { * @return the publisher value. */ public String publisher() { - return this.publisher; + return this.innerProperties() == null ? null : this.innerProperties().publisher(); } /** @@ -103,7 +81,7 @@ public String publisher() { * @return the icon value. */ public String icon() { - return this.icon; + return this.innerProperties() == null ? null : this.innerProperties().icon(); } /** @@ -112,7 +90,7 @@ public String icon() { * @return the contents value. */ public Object contents() { - return this.contents; + return this.innerProperties() == null ? null : this.innerProperties().contents(); } /** @@ -121,7 +99,7 @@ public Object contents() { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -131,7 +109,7 @@ public OffsetDateTime createdDate() { * @return the parametersValueFilesInfo value. */ public List parametersValueFilesInfo() { - return this.parametersValueFilesInfo; + return this.innerProperties() == null ? null : this.innerProperties().parametersValueFilesInfo(); } /** @@ -140,21 +118,7 @@ public List parametersValueFilesInfo() { * @return the enabled value. */ public Boolean enabled() { - return this.enabled; - } - - /** {@inheritDoc} */ - @Override - public ArmTemplateInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ArmTemplateInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().enabled(); } /** @@ -163,8 +127,13 @@ public ArmTemplateInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (parametersValueFilesInfo() != null) { - parametersValueFilesInfo().forEach(e -> e.validate()); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ArmTemplateInner")); + } else { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..f1dc551ff667 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateProperties.java @@ -0,0 +1,152 @@ +// 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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ParametersValueFileInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of an Azure Resource Manager template. */ +@Immutable +public final class ArmTemplateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmTemplateProperties.class); + + /* + * The display name of the ARM template. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The description of the ARM template. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The publisher of the ARM template. + */ + @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) + private String publisher; + + /* + * The URI to the icon of the ARM template. + */ + @JsonProperty(value = "icon", access = JsonProperty.Access.WRITE_ONLY) + private String icon; + + /* + * The contents of the ARM template. + */ + @JsonProperty(value = "contents", access = JsonProperty.Access.WRITE_ONLY) + private Object contents; + + /* + * The creation date of the armTemplate. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * File name and parameter values information from all + * azuredeploy.*.parameters.json for the ARM template. + */ + @JsonProperty(value = "parametersValueFilesInfo", access = JsonProperty.Access.WRITE_ONLY) + private List parametersValueFilesInfo; + + /* + * Whether or not ARM template is enabled for use by lab user. + */ + @JsonProperty(value = "enabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean enabled; + + /** + * Get the displayName property: The display name of the ARM template. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: The description of the ARM template. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the publisher property: The publisher of the ARM template. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Get the icon property: The URI to the icon of the ARM template. + * + * @return the icon value. + */ + public String icon() { + return this.icon; + } + + /** + * Get the contents property: The contents of the ARM template. + * + * @return the contents value. + */ + public Object contents() { + return this.contents; + } + + /** + * Get the createdDate property: The creation date of the armTemplate. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the parametersValueFilesInfo property: File name and parameter values information from all + * azuredeploy.*.parameters.json for the ARM template. + * + * @return the parametersValueFilesInfo value. + */ + public List parametersValueFilesInfo() { + return this.parametersValueFilesInfo; + } + + /** + * Get the enabled property: Whether or not ARM template is enabled for use by lab user. + * + * @return the enabled value. + */ + 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()); + } + } +} 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 337b3537e162..d57f01a43034 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 @@ -4,8 +4,7 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -14,58 +13,38 @@ import java.util.Map; /** An artifact. */ -@JsonFlatten -@Immutable -public class ArtifactInner extends Resource { +@Fluent +public final class ArtifactInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactInner.class); /* - * The artifact's title. + * The properties of the resource. */ - @JsonProperty(value = "properties.title", access = JsonProperty.Access.WRITE_ONLY) - private String title; + @JsonProperty(value = "properties", required = true) + private ArtifactProperties innerProperties = new ArtifactProperties(); - /* - * The artifact's description. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The artifact's publisher. - */ - @JsonProperty(value = "properties.publisher", access = JsonProperty.Access.WRITE_ONLY) - private String publisher; - - /* - * The file path to the artifact. - */ - @JsonProperty(value = "properties.filePath", access = JsonProperty.Access.WRITE_ONLY) - private String filePath; - - /* - * The URI to the artifact icon. - */ - @JsonProperty(value = "properties.icon", access = JsonProperty.Access.WRITE_ONLY) - private String icon; - - /* - * The artifact's target OS. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.targetOsType", access = JsonProperty.Access.WRITE_ONLY) - private String targetOsType; + private ArtifactProperties innerProperties() { + return this.innerProperties; + } - /* - * The artifact's parameters. - */ - @JsonProperty(value = "properties.parameters", access = JsonProperty.Access.WRITE_ONLY) - private Object parameters; + /** {@inheritDoc} */ + @Override + public ArtifactInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The artifact's creation date. - */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + /** {@inheritDoc} */ + @Override + public ArtifactInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the title property: The artifact's title. @@ -73,7 +52,7 @@ public class ArtifactInner extends Resource { * @return the title value. */ public String title() { - return this.title; + return this.innerProperties() == null ? null : this.innerProperties().title(); } /** @@ -82,7 +61,7 @@ public String title() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -91,7 +70,7 @@ public String description() { * @return the publisher value. */ public String publisher() { - return this.publisher; + return this.innerProperties() == null ? null : this.innerProperties().publisher(); } /** @@ -100,7 +79,7 @@ public String publisher() { * @return the filePath value. */ public String filePath() { - return this.filePath; + return this.innerProperties() == null ? null : this.innerProperties().filePath(); } /** @@ -109,7 +88,7 @@ public String filePath() { * @return the icon value. */ public String icon() { - return this.icon; + return this.innerProperties() == null ? null : this.innerProperties().icon(); } /** @@ -118,7 +97,7 @@ public String icon() { * @return the targetOsType value. */ public String targetOsType() { - return this.targetOsType; + return this.innerProperties() == null ? null : this.innerProperties().targetOsType(); } /** @@ -127,7 +106,7 @@ public String targetOsType() { * @return the parameters value. */ public Object parameters() { - return this.parameters; + return this.innerProperties() == null ? null : this.innerProperties().parameters(); } /** @@ -136,21 +115,7 @@ public Object parameters() { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; - } - - /** {@inheritDoc} */ - @Override - public ArtifactInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ArtifactInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -159,5 +124,12 @@ public ArtifactInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model ArtifactInner")); + } else { + innerProperties().validate(); + } } } 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 new file mode 100644 index 000000000000..31a53e3c6893 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactProperties.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of an artifact. */ +@Immutable +public final class ArtifactProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactProperties.class); + + /* + * The artifact's title. + */ + @JsonProperty(value = "title", access = JsonProperty.Access.WRITE_ONLY) + private String title; + + /* + * The artifact's description. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The artifact's publisher. + */ + @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) + private String publisher; + + /* + * The file path to the artifact. + */ + @JsonProperty(value = "filePath", access = JsonProperty.Access.WRITE_ONLY) + private String filePath; + + /* + * The URI to the artifact icon. + */ + @JsonProperty(value = "icon", access = JsonProperty.Access.WRITE_ONLY) + private String icon; + + /* + * The artifact's target OS. + */ + @JsonProperty(value = "targetOsType", access = JsonProperty.Access.WRITE_ONLY) + private String targetOsType; + + /* + * The artifact's parameters. + */ + @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) + private Object parameters; + + /* + * The artifact's creation date. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /** + * Get the title property: The artifact's title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Get the description property: The artifact's description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the publisher property: The artifact's publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Get the filePath property: The file path to the artifact. + * + * @return the filePath value. + */ + public String filePath() { + return this.filePath; + } + + /** + * Get the icon property: The URI to the artifact icon. + * + * @return the icon value. + */ + public String icon() { + return this.icon; + } + + /** + * Get the targetOsType property: The artifact's target OS. + * + * @return the targetOsType value. + */ + public String targetOsType() { + return this.targetOsType; + } + + /** + * Get the parameters property: The artifact's parameters. + * + * @return the parameters value. + */ + public Object parameters() { + return this.parameters; + } + + /** + * Get the createdDate property: The artifact's creation date. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 eea399ba1661..693b2d14fb86 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; @@ -16,76 +15,38 @@ import java.util.Map; /** Properties of an artifact source. */ -@JsonFlatten @Fluent -public class ArtifactSourceInner extends Resource { +public final class ArtifactSourceInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactSourceInner.class); /* - * The artifact source's display name. + * The properties of the resource. */ - @JsonProperty(value = "properties.displayName") - private String displayName; + @JsonProperty(value = "properties", required = true) + private ArtifactSourceProperties innerProperties = new ArtifactSourceProperties(); - /* - * The artifact source's URI. - */ - @JsonProperty(value = "properties.uri") - private String uri; - - /* - * The artifact source's type. - */ - @JsonProperty(value = "properties.sourceType") - private SourceControlType sourceType; - - /* - * The folder containing artifacts. - */ - @JsonProperty(value = "properties.folderPath") - private String folderPath; - - /* - * The folder containing Azure Resource Manager templates. - */ - @JsonProperty(value = "properties.armTemplateFolderPath") - private String armTemplateFolderPath; - - /* - * The artifact source's branch reference. - */ - @JsonProperty(value = "properties.branchRef") - private String branchRef; - - /* - * The security token to authenticate to the artifact source. - */ - @JsonProperty(value = "properties.securityToken") - private String securityToken; - - /* - * Indicates if the artifact source is enabled (values: Enabled, Disabled). - */ - @JsonProperty(value = "properties.status") - private EnableStatus status; - - /* - * The artifact source's creation date. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + private ArtifactSourceProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public ArtifactSourceInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public ArtifactSourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the displayName property: The artifact source's display name. @@ -93,7 +54,7 @@ public class ArtifactSourceInner extends Resource { * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -103,7 +64,10 @@ public String displayName() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withDisplayName(String displayName) { - this.displayName = displayName; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withDisplayName(displayName); return this; } @@ -113,7 +77,7 @@ public ArtifactSourceInner withDisplayName(String displayName) { * @return the uri value. */ public String uri() { - return this.uri; + return this.innerProperties() == null ? null : this.innerProperties().uri(); } /** @@ -123,7 +87,10 @@ public String uri() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withUri(String uri) { - this.uri = uri; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withUri(uri); return this; } @@ -133,7 +100,7 @@ public ArtifactSourceInner withUri(String uri) { * @return the sourceType value. */ public SourceControlType sourceType() { - return this.sourceType; + return this.innerProperties() == null ? null : this.innerProperties().sourceType(); } /** @@ -143,7 +110,10 @@ public SourceControlType sourceType() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withSourceType(SourceControlType sourceType) { - this.sourceType = sourceType; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withSourceType(sourceType); return this; } @@ -153,7 +123,7 @@ public ArtifactSourceInner withSourceType(SourceControlType sourceType) { * @return the folderPath value. */ public String folderPath() { - return this.folderPath; + return this.innerProperties() == null ? null : this.innerProperties().folderPath(); } /** @@ -163,7 +133,10 @@ public String folderPath() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withFolderPath(String folderPath) { - this.folderPath = folderPath; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withFolderPath(folderPath); return this; } @@ -173,7 +146,7 @@ public ArtifactSourceInner withFolderPath(String folderPath) { * @return the armTemplateFolderPath value. */ public String armTemplateFolderPath() { - return this.armTemplateFolderPath; + return this.innerProperties() == null ? null : this.innerProperties().armTemplateFolderPath(); } /** @@ -183,7 +156,10 @@ public String armTemplateFolderPath() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withArmTemplateFolderPath(String armTemplateFolderPath) { - this.armTemplateFolderPath = armTemplateFolderPath; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withArmTemplateFolderPath(armTemplateFolderPath); return this; } @@ -193,7 +169,7 @@ public ArtifactSourceInner withArmTemplateFolderPath(String armTemplateFolderPat * @return the branchRef value. */ public String branchRef() { - return this.branchRef; + return this.innerProperties() == null ? null : this.innerProperties().branchRef(); } /** @@ -203,7 +179,10 @@ public String branchRef() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withBranchRef(String branchRef) { - this.branchRef = branchRef; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withBranchRef(branchRef); return this; } @@ -213,7 +192,7 @@ public ArtifactSourceInner withBranchRef(String branchRef) { * @return the securityToken value. */ public String securityToken() { - return this.securityToken; + return this.innerProperties() == null ? null : this.innerProperties().securityToken(); } /** @@ -223,7 +202,10 @@ public String securityToken() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withSecurityToken(String securityToken) { - this.securityToken = securityToken; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withSecurityToken(securityToken); return this; } @@ -233,7 +215,7 @@ public ArtifactSourceInner withSecurityToken(String securityToken) { * @return the status value. */ public EnableStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -243,7 +225,10 @@ public EnableStatus status() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withStatus(EnableStatus status) { - this.status = status; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withStatus(status); return this; } @@ -253,7 +238,7 @@ public ArtifactSourceInner withStatus(EnableStatus status) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -262,7 +247,7 @@ public OffsetDateTime createdDate() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -271,21 +256,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public ArtifactSourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ArtifactSourceInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -294,5 +265,13 @@ public ArtifactSourceInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ArtifactSourceInner")); + } else { + innerProperties().validate(); + } } } 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 new file mode 100644 index 000000000000..fdd6a62a31e8 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceProperties.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.SourceControlType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of an artifact source. */ +@Fluent +public final class ArtifactSourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactSourceProperties.class); + + /* + * The artifact source's display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The artifact source's URI. + */ + @JsonProperty(value = "uri") + private String uri; + + /* + * The artifact source's type. + */ + @JsonProperty(value = "sourceType") + private SourceControlType sourceType; + + /* + * The folder containing artifacts. + */ + @JsonProperty(value = "folderPath") + private String folderPath; + + /* + * The folder containing Azure Resource Manager templates. + */ + @JsonProperty(value = "armTemplateFolderPath") + private String armTemplateFolderPath; + + /* + * The artifact source's branch reference. + */ + @JsonProperty(value = "branchRef") + private String branchRef; + + /* + * The security token to authenticate to the artifact source. + */ + @JsonProperty(value = "securityToken") + private String securityToken; + + /* + * Indicates if the artifact source is enabled (values: Enabled, Disabled). + */ + @JsonProperty(value = "status") + private EnableStatus status; + + /* + * The artifact source's creation date. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the displayName property: The artifact source's display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The artifact source's display name. + * + * @param displayName the displayName value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the uri property: The artifact source's URI. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The artifact source's URI. + * + * @param uri the uri value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the sourceType property: The artifact source's type. + * + * @return the sourceType value. + */ + public SourceControlType sourceType() { + return this.sourceType; + } + + /** + * Set the sourceType property: The artifact source's type. + * + * @param sourceType the sourceType value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withSourceType(SourceControlType sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Get the folderPath property: The folder containing artifacts. + * + * @return the folderPath value. + */ + public String folderPath() { + return this.folderPath; + } + + /** + * Set the folderPath property: The folder containing artifacts. + * + * @param folderPath the folderPath value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withFolderPath(String folderPath) { + this.folderPath = folderPath; + return this; + } + + /** + * Get the armTemplateFolderPath property: The folder containing Azure Resource Manager templates. + * + * @return the armTemplateFolderPath value. + */ + public String armTemplateFolderPath() { + return this.armTemplateFolderPath; + } + + /** + * Set the armTemplateFolderPath property: The folder containing Azure Resource Manager templates. + * + * @param armTemplateFolderPath the armTemplateFolderPath value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withArmTemplateFolderPath(String armTemplateFolderPath) { + this.armTemplateFolderPath = armTemplateFolderPath; + return this; + } + + /** + * Get the branchRef property: The artifact source's branch reference. + * + * @return the branchRef value. + */ + public String branchRef() { + return this.branchRef; + } + + /** + * Set the branchRef property: The artifact source's branch reference. + * + * @param branchRef the branchRef value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withBranchRef(String branchRef) { + this.branchRef = branchRef; + return this; + } + + /** + * Get the securityToken property: The security token to authenticate to the artifact source. + * + * @return the securityToken value. + */ + public String securityToken() { + return this.securityToken; + } + + /** + * Set the securityToken property: The security token to authenticate to the artifact source. + * + * @param securityToken the securityToken value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withSecurityToken(String securityToken) { + this.securityToken = securityToken; + return this; + } + + /** + * Get the status property: Indicates if the artifact source is enabled (values: Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates if the artifact source is enabled (values: Enabled, Disabled). + * + * @param status the status value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withStatus(EnableStatus status) { + this.status = status; + return this; + } + + /** + * Get the createdDate property: The artifact source's creation date. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 4c183a014e1d..2f9ab08c0a36 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesCustom; @@ -19,83 +18,38 @@ import java.util.Map; /** A custom image. */ -@JsonFlatten @Fluent -public class CustomImageInner extends Resource { +public final class CustomImageInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomImageInner.class); /* - * The virtual machine from which the image is to be created. + * The properties of the resource. */ - @JsonProperty(value = "properties.vm") - private CustomImagePropertiesFromVm vm; + @JsonProperty(value = "properties", required = true) + private CustomImageProperties innerProperties = new CustomImageProperties(); - /* - * The VHD from which the image is to be created. - */ - @JsonProperty(value = "properties.vhd") - private CustomImagePropertiesCustom vhd; - - /* - * The description of the custom image. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * The author of the custom image. - */ - @JsonProperty(value = "properties.author") - private String author; - - /* - * The creation date of the custom image. - */ - @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationDate; - - /* - * The Managed Image Id backing the custom image. - */ - @JsonProperty(value = "properties.managedImageId") - private String managedImageId; - - /* - * The Managed Snapshot Id backing the custom image. - */ - @JsonProperty(value = "properties.managedSnapshotId") - private String managedSnapshotId; - - /* - * Storage information about the data disks present in the custom image - */ - @JsonProperty(value = "properties.dataDiskStorageInfo") - private List dataDiskStorageInfo; - - /* - * Storage information about the plan related to this custom image - */ - @JsonProperty(value = "properties.customImagePlan") - private CustomImagePropertiesFromPlan customImagePlan; - - /* - * Whether or not the custom images underlying offer/plan has been enabled - * for programmatic deployment + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.isPlanAuthorized") - private Boolean isPlanAuthorized; + private CustomImageProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public CustomImageInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@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. @@ -103,7 +57,7 @@ public class CustomImageInner extends Resource { * @return the vm value. */ public CustomImagePropertiesFromVm vm() { - return this.vm; + return this.innerProperties() == null ? null : this.innerProperties().vm(); } /** @@ -113,7 +67,10 @@ public CustomImagePropertiesFromVm vm() { * @return the CustomImageInner object itself. */ public CustomImageInner withVm(CustomImagePropertiesFromVm vm) { - this.vm = vm; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withVm(vm); return this; } @@ -123,7 +80,7 @@ public CustomImageInner withVm(CustomImagePropertiesFromVm vm) { * @return the vhd value. */ public CustomImagePropertiesCustom vhd() { - return this.vhd; + return this.innerProperties() == null ? null : this.innerProperties().vhd(); } /** @@ -133,7 +90,10 @@ public CustomImagePropertiesCustom vhd() { * @return the CustomImageInner object itself. */ public CustomImageInner withVhd(CustomImagePropertiesCustom vhd) { - this.vhd = vhd; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withVhd(vhd); return this; } @@ -143,7 +103,7 @@ public CustomImageInner withVhd(CustomImagePropertiesCustom vhd) { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -153,7 +113,10 @@ public String description() { * @return the CustomImageInner object itself. */ public CustomImageInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -163,7 +126,7 @@ public CustomImageInner withDescription(String description) { * @return the author value. */ public String author() { - return this.author; + return this.innerProperties() == null ? null : this.innerProperties().author(); } /** @@ -173,7 +136,10 @@ public String author() { * @return the CustomImageInner object itself. */ public CustomImageInner withAuthor(String author) { - this.author = author; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withAuthor(author); return this; } @@ -183,7 +149,7 @@ public CustomImageInner withAuthor(String author) { * @return the creationDate value. */ public OffsetDateTime creationDate() { - return this.creationDate; + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); } /** @@ -192,7 +158,7 @@ public OffsetDateTime creationDate() { * @return the managedImageId value. */ public String managedImageId() { - return this.managedImageId; + return this.innerProperties() == null ? null : this.innerProperties().managedImageId(); } /** @@ -202,7 +168,10 @@ public String managedImageId() { * @return the CustomImageInner object itself. */ public CustomImageInner withManagedImageId(String managedImageId) { - this.managedImageId = managedImageId; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withManagedImageId(managedImageId); return this; } @@ -212,7 +181,7 @@ public CustomImageInner withManagedImageId(String managedImageId) { * @return the managedSnapshotId value. */ public String managedSnapshotId() { - return this.managedSnapshotId; + return this.innerProperties() == null ? null : this.innerProperties().managedSnapshotId(); } /** @@ -222,7 +191,10 @@ public String managedSnapshotId() { * @return the CustomImageInner object itself. */ public CustomImageInner withManagedSnapshotId(String managedSnapshotId) { - this.managedSnapshotId = managedSnapshotId; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withManagedSnapshotId(managedSnapshotId); return this; } @@ -232,7 +204,7 @@ public CustomImageInner withManagedSnapshotId(String managedSnapshotId) { * @return the dataDiskStorageInfo value. */ public List dataDiskStorageInfo() { - return this.dataDiskStorageInfo; + return this.innerProperties() == null ? null : this.innerProperties().dataDiskStorageInfo(); } /** @@ -242,7 +214,10 @@ public List dataDiskStorageInfo() { * @return the CustomImageInner object itself. */ public CustomImageInner withDataDiskStorageInfo(List dataDiskStorageInfo) { - this.dataDiskStorageInfo = dataDiskStorageInfo; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withDataDiskStorageInfo(dataDiskStorageInfo); return this; } @@ -252,7 +227,7 @@ public CustomImageInner withDataDiskStorageInfo(List da * @return the customImagePlan value. */ public CustomImagePropertiesFromPlan customImagePlan() { - return this.customImagePlan; + return this.innerProperties() == null ? null : this.innerProperties().customImagePlan(); } /** @@ -262,7 +237,10 @@ public CustomImagePropertiesFromPlan customImagePlan() { * @return the CustomImageInner object itself. */ public CustomImageInner withCustomImagePlan(CustomImagePropertiesFromPlan customImagePlan) { - this.customImagePlan = customImagePlan; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withCustomImagePlan(customImagePlan); return this; } @@ -273,7 +251,7 @@ public CustomImageInner withCustomImagePlan(CustomImagePropertiesFromPlan custom * @return the isPlanAuthorized value. */ public Boolean isPlanAuthorized() { - return this.isPlanAuthorized; + return this.innerProperties() == null ? null : this.innerProperties().isPlanAuthorized(); } /** @@ -284,7 +262,10 @@ public Boolean isPlanAuthorized() { * @return the CustomImageInner object itself. */ public CustomImageInner withIsPlanAuthorized(Boolean isPlanAuthorized) { - this.isPlanAuthorized = isPlanAuthorized; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withIsPlanAuthorized(isPlanAuthorized); return this; } @@ -294,7 +275,7 @@ public CustomImageInner withIsPlanAuthorized(Boolean isPlanAuthorized) { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -303,21 +284,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public CustomImageInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public CustomImageInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -326,17 +293,13 @@ public CustomImageInner withTags(Map tags) { * @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(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model CustomImageInner")); + } else { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..ee7a97ca3e15 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageProperties.java @@ -0,0 +1,324 @@ +// 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.core.util.logging.ClientLogger; +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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of a custom image. */ +@Fluent +public final class CustomImageProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomImageProperties.class); + + /* + * The virtual machine from which the image is to be created. + */ + @JsonProperty(value = "vm") + private CustomImagePropertiesFromVm vm; + + /* + * The VHD from which the image is to be created. + */ + @JsonProperty(value = "vhd") + private CustomImagePropertiesCustom vhd; + + /* + * The description of the custom image. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The author of the custom image. + */ + @JsonProperty(value = "author") + private String author; + + /* + * The creation date of the custom image. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * The Managed Image Id backing the custom image. + */ + @JsonProperty(value = "managedImageId") + private String managedImageId; + + /* + * The Managed Snapshot Id backing the custom image. + */ + @JsonProperty(value = "managedSnapshotId") + private String managedSnapshotId; + + /* + * Storage information about the data disks present in the custom image + */ + @JsonProperty(value = "dataDiskStorageInfo") + private List dataDiskStorageInfo; + + /* + * Storage information about the plan related to this custom image + */ + @JsonProperty(value = "customImagePlan") + private CustomImagePropertiesFromPlan customImagePlan; + + /* + * Whether or not the custom images underlying offer/plan has been enabled + * for programmatic deployment + */ + @JsonProperty(value = "isPlanAuthorized") + private Boolean isPlanAuthorized; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the vm property: The virtual machine from which the image is to be created. + * + * @return the vm value. + */ + public CustomImagePropertiesFromVm vm() { + return this.vm; + } + + /** + * Set the vm property: The virtual machine from which the image is to be created. + * + * @param vm the vm value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withVm(CustomImagePropertiesFromVm vm) { + this.vm = vm; + return this; + } + + /** + * Get the vhd property: The VHD from which the image is to be created. + * + * @return the vhd value. + */ + public CustomImagePropertiesCustom vhd() { + return this.vhd; + } + + /** + * Set the vhd property: The VHD from which the image is to be created. + * + * @param vhd the vhd value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withVhd(CustomImagePropertiesCustom vhd) { + this.vhd = vhd; + return this; + } + + /** + * Get the description property: The description of the custom image. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the custom image. + * + * @param description the description value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the author property: The author of the custom image. + * + * @return the author value. + */ + public String author() { + return this.author; + } + + /** + * Set the author property: The author of the custom image. + * + * @param author the author value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withAuthor(String author) { + this.author = author; + return this; + } + + /** + * Get the creationDate property: The creation date of the custom image. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the managedImageId property: The Managed Image Id backing the custom image. + * + * @return the managedImageId value. + */ + public String managedImageId() { + return this.managedImageId; + } + + /** + * Set the managedImageId property: The Managed Image Id backing the custom image. + * + * @param managedImageId the managedImageId value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withManagedImageId(String managedImageId) { + this.managedImageId = managedImageId; + return this; + } + + /** + * Get the managedSnapshotId property: The Managed Snapshot Id backing the custom image. + * + * @return the managedSnapshotId value. + */ + public String managedSnapshotId() { + return this.managedSnapshotId; + } + + /** + * Set the managedSnapshotId property: The Managed Snapshot Id backing the custom image. + * + * @param managedSnapshotId the managedSnapshotId value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withManagedSnapshotId(String managedSnapshotId) { + this.managedSnapshotId = managedSnapshotId; + return this; + } + + /** + * Get the dataDiskStorageInfo property: Storage information about the data disks present in the custom image. + * + * @return the dataDiskStorageInfo value. + */ + public List dataDiskStorageInfo() { + return this.dataDiskStorageInfo; + } + + /** + * Set the dataDiskStorageInfo property: Storage information about the data disks present in the custom image. + * + * @param dataDiskStorageInfo the dataDiskStorageInfo value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withDataDiskStorageInfo(List dataDiskStorageInfo) { + this.dataDiskStorageInfo = dataDiskStorageInfo; + return this; + } + + /** + * Get the customImagePlan property: Storage information about the plan related to this custom image. + * + * @return the customImagePlan value. + */ + public CustomImagePropertiesFromPlan customImagePlan() { + return this.customImagePlan; + } + + /** + * Set the customImagePlan property: Storage information about the plan related to this custom image. + * + * @param customImagePlan the customImagePlan value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withCustomImagePlan(CustomImagePropertiesFromPlan customImagePlan) { + this.customImagePlan = customImagePlan; + return this; + } + + /** + * Get the isPlanAuthorized property: Whether or not the custom images underlying offer/plan has been enabled for + * programmatic deployment. + * + * @return the isPlanAuthorized value. + */ + public Boolean isPlanAuthorized() { + return this.isPlanAuthorized; + } + + /** + * Set the isPlanAuthorized property: Whether or not the custom images underlying offer/plan has been enabled for + * programmatic deployment. + * + * @param isPlanAuthorized the isPlanAuthorized value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withIsPlanAuthorized(Boolean isPlanAuthorized) { + this.isPlanAuthorized = isPlanAuthorized; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + 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(); + } + } +} 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 e0846e50558f..5071fdbeaba3 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.StorageType; @@ -15,77 +14,38 @@ import java.util.Map; /** A Disk. */ -@JsonFlatten @Fluent -public class DiskInner extends Resource { +public final class DiskInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskInner.class); /* - * The storage type for the disk (i.e. Standard, Premium). + * The properties of the resource. */ - @JsonProperty(value = "properties.diskType") - private StorageType diskType; + @JsonProperty(value = "properties", required = true) + private DiskProperties innerProperties = new DiskProperties(); - /* - * The size of the disk in Gibibytes. - */ - @JsonProperty(value = "properties.diskSizeGiB") - private Integer diskSizeGiB; - - /* - * The resource ID of the VM to which this disk is leased. - */ - @JsonProperty(value = "properties.leasedByLabVmId") - private String leasedByLabVmId; - - /* - * When backed by a blob, the name of the VHD blob without extension. - */ - @JsonProperty(value = "properties.diskBlobName") - private String diskBlobName; - - /* - * When backed by a blob, the URI of underlying blob. - */ - @JsonProperty(value = "properties.diskUri") - private String diskUri; - - /* - * When backed by a blob, the storage account where the blob is. - */ - @JsonProperty(value = "properties.storageAccountId") - private String storageAccountId; - - /* - * The creation date of the disk. - */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; - - /* - * The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). - */ - @JsonProperty(value = "properties.hostCaching") - private String hostCaching; - - /* - * When backed by managed disk, this is the ID of the compute disk - * resource. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.managedDiskId") - private String managedDiskId; + private DiskProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public DiskInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@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). @@ -93,7 +53,7 @@ public class DiskInner extends Resource { * @return the diskType value. */ public StorageType diskType() { - return this.diskType; + return this.innerProperties() == null ? null : this.innerProperties().diskType(); } /** @@ -103,7 +63,10 @@ public StorageType diskType() { * @return the DiskInner object itself. */ public DiskInner withDiskType(StorageType diskType) { - this.diskType = diskType; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskType(diskType); return this; } @@ -113,7 +76,7 @@ public DiskInner withDiskType(StorageType diskType) { * @return the diskSizeGiB value. */ public Integer diskSizeGiB() { - return this.diskSizeGiB; + return this.innerProperties() == null ? null : this.innerProperties().diskSizeGiB(); } /** @@ -123,7 +86,10 @@ public Integer diskSizeGiB() { * @return the DiskInner object itself. */ public DiskInner withDiskSizeGiB(Integer diskSizeGiB) { - this.diskSizeGiB = diskSizeGiB; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskSizeGiB(diskSizeGiB); return this; } @@ -133,7 +99,7 @@ public DiskInner withDiskSizeGiB(Integer diskSizeGiB) { * @return the leasedByLabVmId value. */ public String leasedByLabVmId() { - return this.leasedByLabVmId; + return this.innerProperties() == null ? null : this.innerProperties().leasedByLabVmId(); } /** @@ -143,7 +109,10 @@ public String leasedByLabVmId() { * @return the DiskInner object itself. */ public DiskInner withLeasedByLabVmId(String leasedByLabVmId) { - this.leasedByLabVmId = leasedByLabVmId; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withLeasedByLabVmId(leasedByLabVmId); return this; } @@ -153,7 +122,7 @@ public DiskInner withLeasedByLabVmId(String leasedByLabVmId) { * @return the diskBlobName value. */ public String diskBlobName() { - return this.diskBlobName; + return this.innerProperties() == null ? null : this.innerProperties().diskBlobName(); } /** @@ -163,7 +132,10 @@ public String diskBlobName() { * @return the DiskInner object itself. */ public DiskInner withDiskBlobName(String diskBlobName) { - this.diskBlobName = diskBlobName; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskBlobName(diskBlobName); return this; } @@ -173,7 +145,7 @@ public DiskInner withDiskBlobName(String diskBlobName) { * @return the diskUri value. */ public String diskUri() { - return this.diskUri; + return this.innerProperties() == null ? null : this.innerProperties().diskUri(); } /** @@ -183,7 +155,10 @@ public String diskUri() { * @return the DiskInner object itself. */ public DiskInner withDiskUri(String diskUri) { - this.diskUri = diskUri; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskUri(diskUri); return this; } @@ -193,7 +168,7 @@ public DiskInner withDiskUri(String diskUri) { * @return the storageAccountId value. */ public String storageAccountId() { - return this.storageAccountId; + return this.innerProperties() == null ? null : this.innerProperties().storageAccountId(); } /** @@ -203,7 +178,10 @@ public String storageAccountId() { * @return the DiskInner object itself. */ public DiskInner withStorageAccountId(String storageAccountId) { - this.storageAccountId = storageAccountId; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withStorageAccountId(storageAccountId); return this; } @@ -213,7 +191,7 @@ public DiskInner withStorageAccountId(String storageAccountId) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -222,7 +200,7 @@ public OffsetDateTime createdDate() { * @return the hostCaching value. */ public String hostCaching() { - return this.hostCaching; + return this.innerProperties() == null ? null : this.innerProperties().hostCaching(); } /** @@ -232,7 +210,10 @@ public String hostCaching() { * @return the DiskInner object itself. */ public DiskInner withHostCaching(String hostCaching) { - this.hostCaching = hostCaching; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withHostCaching(hostCaching); return this; } @@ -242,7 +223,7 @@ public DiskInner withHostCaching(String hostCaching) { * @return the managedDiskId value. */ public String managedDiskId() { - return this.managedDiskId; + return this.innerProperties() == null ? null : this.innerProperties().managedDiskId(); } /** @@ -252,7 +233,10 @@ public String managedDiskId() { * @return the DiskInner object itself. */ public DiskInner withManagedDiskId(String managedDiskId) { - this.managedDiskId = managedDiskId; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withManagedDiskId(managedDiskId); return this; } @@ -262,7 +246,7 @@ public DiskInner withManagedDiskId(String managedDiskId) { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -271,21 +255,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public DiskInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DiskInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -294,5 +264,12 @@ public DiskInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model DiskInner")); + } else { + innerProperties().validate(); + } } } 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 new file mode 100644 index 000000000000..5b1d140ce6d7 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskProperties.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of a disk. */ +@Fluent +public final class DiskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskProperties.class); + + /* + * The storage type for the disk (i.e. Standard, Premium). + */ + @JsonProperty(value = "diskType") + private StorageType diskType; + + /* + * The size of the disk in Gibibytes. + */ + @JsonProperty(value = "diskSizeGiB") + private Integer diskSizeGiB; + + /* + * The resource ID of the VM to which this disk is leased. + */ + @JsonProperty(value = "leasedByLabVmId") + private String leasedByLabVmId; + + /* + * When backed by a blob, the name of the VHD blob without extension. + */ + @JsonProperty(value = "diskBlobName") + private String diskBlobName; + + /* + * When backed by a blob, the URI of underlying blob. + */ + @JsonProperty(value = "diskUri") + private String diskUri; + + /* + * When backed by a blob, the storage account where the blob is. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /* + * The creation date of the disk. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). + */ + @JsonProperty(value = "hostCaching") + private String hostCaching; + + /* + * When backed by managed disk, this is the ID of the compute disk + * resource. + */ + @JsonProperty(value = "managedDiskId") + private String managedDiskId; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the diskType property: The storage type for the disk (i.e. Standard, Premium). + * + * @return the diskType value. + */ + public StorageType diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The storage type for the disk (i.e. Standard, Premium). + * + * @param diskType the diskType value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withDiskType(StorageType diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the diskSizeGiB property: The size of the disk in Gibibytes. + * + * @return the diskSizeGiB value. + */ + public Integer diskSizeGiB() { + return this.diskSizeGiB; + } + + /** + * Set the diskSizeGiB property: The size of the disk in Gibibytes. + * + * @param diskSizeGiB the diskSizeGiB value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withDiskSizeGiB(Integer diskSizeGiB) { + this.diskSizeGiB = diskSizeGiB; + return this; + } + + /** + * Get the leasedByLabVmId property: The resource ID of the VM to which this disk is leased. + * + * @return the leasedByLabVmId value. + */ + public String leasedByLabVmId() { + return this.leasedByLabVmId; + } + + /** + * Set the leasedByLabVmId property: The resource ID of the VM to which this disk is leased. + * + * @param leasedByLabVmId the leasedByLabVmId value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withLeasedByLabVmId(String leasedByLabVmId) { + this.leasedByLabVmId = leasedByLabVmId; + return this; + } + + /** + * Get the diskBlobName property: When backed by a blob, the name of the VHD blob without extension. + * + * @return the diskBlobName value. + */ + public String diskBlobName() { + return this.diskBlobName; + } + + /** + * Set the diskBlobName property: When backed by a blob, the name of the VHD blob without extension. + * + * @param diskBlobName the diskBlobName value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withDiskBlobName(String diskBlobName) { + this.diskBlobName = diskBlobName; + return this; + } + + /** + * Get the diskUri property: When backed by a blob, the URI of underlying blob. + * + * @return the diskUri value. + */ + 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 DiskProperties object itself. + */ + public DiskProperties withDiskUri(String diskUri) { + this.diskUri = diskUri; + return this; + } + + /** + * Get the storageAccountId property: When backed by a blob, the storage account where the blob is. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: When backed by a blob, the storage account where the blob is. + * + * @param storageAccountId the storageAccountId value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the createdDate property: The creation date of the disk. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the hostCaching property: The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). + * + * @return the hostCaching value. + */ + public String hostCaching() { + return this.hostCaching; + } + + /** + * Set the hostCaching property: The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). + * + * @param hostCaching the hostCaching value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withHostCaching(String hostCaching) { + this.hostCaching = hostCaching; + return this; + } + + /** + * Get the managedDiskId property: When backed by managed disk, this is the ID of the compute disk resource. + * + * @return the managedDiskId value. + */ + 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 DiskProperties object itself. + */ + public DiskProperties withManagedDiskId(String managedDiskId) { + this.managedDiskId = managedDiskId; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 024dc79df197..226db62bd990 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.EnvironmentDeploymentProperties; @@ -14,48 +13,38 @@ import java.util.Map; /** An environment, which is essentially an ARM template deployment. */ -@JsonFlatten @Fluent -public class DtlEnvironmentInner extends Resource { +public final class DtlEnvironmentInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DtlEnvironmentInner.class); /* - * The deployment properties of the environment. + * The properties of the resource. */ - @JsonProperty(value = "properties.deploymentProperties") - private EnvironmentDeploymentProperties deploymentProperties; + @JsonProperty(value = "properties", required = true) + private EnvironmentProperties innerProperties = new EnvironmentProperties(); - /* - * The display name of the Azure Resource Manager template that produced - * the environment. - */ - @JsonProperty(value = "properties.armTemplateDisplayName") - private String armTemplateDisplayName; - - /* - * The identifier of the resource group containing the environment's - * resources. - */ - @JsonProperty(value = "properties.resourceGroupId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroupId; - - /* - * The creator of the environment. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.createdByUser", access = JsonProperty.Access.WRITE_ONLY) - private String createdByUser; + private EnvironmentProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public DtlEnvironmentInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public DtlEnvironmentInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the deploymentProperties property: The deployment properties of the environment. @@ -63,7 +52,7 @@ public class DtlEnvironmentInner extends Resource { * @return the deploymentProperties value. */ public EnvironmentDeploymentProperties deploymentProperties() { - return this.deploymentProperties; + return this.innerProperties() == null ? null : this.innerProperties().deploymentProperties(); } /** @@ -73,7 +62,10 @@ public EnvironmentDeploymentProperties deploymentProperties() { * @return the DtlEnvironmentInner object itself. */ public DtlEnvironmentInner withDeploymentProperties(EnvironmentDeploymentProperties deploymentProperties) { - this.deploymentProperties = deploymentProperties; + if (this.innerProperties() == null) { + this.innerProperties = new EnvironmentProperties(); + } + this.innerProperties().withDeploymentProperties(deploymentProperties); return this; } @@ -84,7 +76,7 @@ public DtlEnvironmentInner withDeploymentProperties(EnvironmentDeploymentPropert * @return the armTemplateDisplayName value. */ public String armTemplateDisplayName() { - return this.armTemplateDisplayName; + return this.innerProperties() == null ? null : this.innerProperties().armTemplateDisplayName(); } /** @@ -95,7 +87,10 @@ public String armTemplateDisplayName() { * @return the DtlEnvironmentInner object itself. */ public DtlEnvironmentInner withArmTemplateDisplayName(String armTemplateDisplayName) { - this.armTemplateDisplayName = armTemplateDisplayName; + if (this.innerProperties() == null) { + this.innerProperties = new EnvironmentProperties(); + } + this.innerProperties().withArmTemplateDisplayName(armTemplateDisplayName); return this; } @@ -105,7 +100,7 @@ public DtlEnvironmentInner withArmTemplateDisplayName(String armTemplateDisplayN * @return the resourceGroupId value. */ public String resourceGroupId() { - return this.resourceGroupId; + return this.innerProperties() == null ? null : this.innerProperties().resourceGroupId(); } /** @@ -114,7 +109,7 @@ public String resourceGroupId() { * @return the createdByUser value. */ public String createdByUser() { - return this.createdByUser; + return this.innerProperties() == null ? null : this.innerProperties().createdByUser(); } /** @@ -123,7 +118,7 @@ public String createdByUser() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -132,21 +127,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public DtlEnvironmentInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DtlEnvironmentInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -155,8 +136,13 @@ public DtlEnvironmentInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (deploymentProperties() != null) { - deploymentProperties().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model DtlEnvironmentInner")); + } else { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..db136108b10b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentProperties.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnvironmentDeploymentProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of an environment. */ +@Fluent +public final class EnvironmentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentProperties.class); + + /* + * The deployment properties of the environment. + */ + @JsonProperty(value = "deploymentProperties") + private EnvironmentDeploymentProperties deploymentProperties; + + /* + * The display name of the Azure Resource Manager template that produced + * the environment. + */ + @JsonProperty(value = "armTemplateDisplayName") + private String armTemplateDisplayName; + + /* + * The identifier of the resource group containing the environment's + * resources. + */ + @JsonProperty(value = "resourceGroupId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGroupId; + + /* + * The creator of the environment. + */ + @JsonProperty(value = "createdByUser", access = JsonProperty.Access.WRITE_ONLY) + private String createdByUser; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the deploymentProperties property: The deployment properties of the environment. + * + * @return the deploymentProperties value. + */ + public EnvironmentDeploymentProperties deploymentProperties() { + return this.deploymentProperties; + } + + /** + * Set the deploymentProperties property: The deployment properties of the environment. + * + * @param deploymentProperties the deploymentProperties value to set. + * @return the EnvironmentProperties object itself. + */ + public EnvironmentProperties withDeploymentProperties(EnvironmentDeploymentProperties deploymentProperties) { + this.deploymentProperties = deploymentProperties; + return this; + } + + /** + * Get the armTemplateDisplayName property: The display name of the Azure Resource Manager template that produced + * the environment. + * + * @return the armTemplateDisplayName value. + */ + public String armTemplateDisplayName() { + return this.armTemplateDisplayName; + } + + /** + * Set the armTemplateDisplayName property: The display name of the Azure Resource Manager template that produced + * the environment. + * + * @param armTemplateDisplayName the armTemplateDisplayName value to set. + * @return the EnvironmentProperties object itself. + */ + public EnvironmentProperties withArmTemplateDisplayName(String armTemplateDisplayName) { + this.armTemplateDisplayName = armTemplateDisplayName; + return this; + } + + /** + * Get the resourceGroupId property: The identifier of the resource group containing the environment's resources. + * + * @return the resourceGroupId value. + */ + public String resourceGroupId() { + return this.resourceGroupId; + } + + /** + * Get the createdByUser property: The creator of the environment. + * + * @return the createdByUser value. + */ + public String createdByUser() { + return this.createdByUser; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + 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(); + } + } +} 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 6d92f275805c..da54c658955b 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.FormulaPropertiesFromVm; @@ -16,58 +15,38 @@ import java.util.Map; /** A formula for creating a VM, specifying an image base and other parameters. */ -@JsonFlatten @Fluent -public class FormulaInner extends Resource { +public final class FormulaInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(FormulaInner.class); /* - * The description of the formula. + * The properties of the resource. */ - @JsonProperty(value = "properties.description") - private String description; + @JsonProperty(value = "properties", required = true) + private FormulaProperties innerProperties = new FormulaProperties(); - /* - * The author of the formula. - */ - @JsonProperty(value = "properties.author", access = JsonProperty.Access.WRITE_ONLY) - private String author; - - /* - * The OS type of the formula. - */ - @JsonProperty(value = "properties.osType") - private String osType; - - /* - * The creation date of the formula. - */ - @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationDate; - - /* - * The content of the formula. - */ - @JsonProperty(value = "properties.formulaContent") - private LabVirtualMachineCreationParameter formulaContent; - - /* - * Information about a VM from which a formula is to be created. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.vm") - private FormulaPropertiesFromVm vm; + private FormulaProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public FormulaInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public FormulaInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the description property: The description of the formula. @@ -75,7 +54,7 @@ public class FormulaInner extends Resource { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -85,7 +64,10 @@ public String description() { * @return the FormulaInner object itself. */ public FormulaInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new FormulaProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -95,7 +77,7 @@ public FormulaInner withDescription(String description) { * @return the author value. */ public String author() { - return this.author; + return this.innerProperties() == null ? null : this.innerProperties().author(); } /** @@ -104,7 +86,7 @@ public String author() { * @return the osType value. */ public String osType() { - return this.osType; + return this.innerProperties() == null ? null : this.innerProperties().osType(); } /** @@ -114,7 +96,10 @@ public String osType() { * @return the FormulaInner object itself. */ public FormulaInner withOsType(String osType) { - this.osType = osType; + if (this.innerProperties() == null) { + this.innerProperties = new FormulaProperties(); + } + this.innerProperties().withOsType(osType); return this; } @@ -124,7 +109,7 @@ public FormulaInner withOsType(String osType) { * @return the creationDate value. */ public OffsetDateTime creationDate() { - return this.creationDate; + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); } /** @@ -133,7 +118,7 @@ public OffsetDateTime creationDate() { * @return the formulaContent value. */ public LabVirtualMachineCreationParameter formulaContent() { - return this.formulaContent; + return this.innerProperties() == null ? null : this.innerProperties().formulaContent(); } /** @@ -143,7 +128,10 @@ public LabVirtualMachineCreationParameter formulaContent() { * @return the FormulaInner object itself. */ public FormulaInner withFormulaContent(LabVirtualMachineCreationParameter formulaContent) { - this.formulaContent = formulaContent; + if (this.innerProperties() == null) { + this.innerProperties = new FormulaProperties(); + } + this.innerProperties().withFormulaContent(formulaContent); return this; } @@ -153,7 +141,7 @@ public FormulaInner withFormulaContent(LabVirtualMachineCreationParameter formul * @return the vm value. */ public FormulaPropertiesFromVm vm() { - return this.vm; + return this.innerProperties() == null ? null : this.innerProperties().vm(); } /** @@ -163,7 +151,10 @@ public FormulaPropertiesFromVm vm() { * @return the FormulaInner object itself. */ public FormulaInner withVm(FormulaPropertiesFromVm vm) { - this.vm = vm; + if (this.innerProperties() == null) { + this.innerProperties = new FormulaProperties(); + } + this.innerProperties().withVm(vm); return this; } @@ -173,7 +164,7 @@ public FormulaInner withVm(FormulaPropertiesFromVm vm) { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -182,21 +173,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public FormulaInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public FormulaInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -205,11 +182,12 @@ public FormulaInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (formulaContent() != null) { - formulaContent().validate(); - } - if (vm() != null) { - vm().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model FormulaInner")); + } else { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..a99450fe1eee --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaProperties.java @@ -0,0 +1,197 @@ +// 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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.FormulaPropertiesFromVm; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of a formula. */ +@Fluent +public final class FormulaProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FormulaProperties.class); + + /* + * The description of the formula. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The author of the formula. + */ + @JsonProperty(value = "author", access = JsonProperty.Access.WRITE_ONLY) + private String author; + + /* + * The OS type of the formula. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * The creation date of the formula. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * The content of the formula. + */ + @JsonProperty(value = "formulaContent") + private LabVirtualMachineCreationParameter formulaContent; + + /* + * Information about a VM from which a formula is to be created. + */ + @JsonProperty(value = "vm") + private FormulaPropertiesFromVm vm; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the description property: The description of the formula. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the formula. + * + * @param description the description value to set. + * @return the FormulaProperties object itself. + */ + public FormulaProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the author property: The author of the formula. + * + * @return the author value. + */ + public String author() { + return this.author; + } + + /** + * Get the osType property: The OS type of the formula. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The OS type of the formula. + * + * @param osType the osType value to set. + * @return the FormulaProperties object itself. + */ + public FormulaProperties withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the creationDate property: The creation date of the formula. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the formulaContent property: The content of the formula. + * + * @return the formulaContent value. + */ + public LabVirtualMachineCreationParameter formulaContent() { + return this.formulaContent; + } + + /** + * Set the formulaContent property: The content of the formula. + * + * @param formulaContent the formulaContent value to set. + * @return the FormulaProperties object itself. + */ + public FormulaProperties withFormulaContent(LabVirtualMachineCreationParameter formulaContent) { + this.formulaContent = formulaContent; + return this; + } + + /** + * Get the vm property: Information about a VM from which a formula is to be created. + * + * @return the vm value. + */ + public FormulaPropertiesFromVm vm() { + return this.vm; + } + + /** + * Set the vm property: Information about a VM from which a formula is to be created. + * + * @param vm the vm value to set. + * @return the FormulaProperties object itself. + */ + public FormulaProperties withVm(FormulaPropertiesFromVm vm) { + this.vm = vm; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + 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(); + } + } +} 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 3c8655bfdb48..a9b5f04b2d1a 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; @@ -15,58 +14,38 @@ import java.util.Map; /** A gallery image. */ -@JsonFlatten @Fluent -public class GalleryImageInner extends Resource { +public final class GalleryImageInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageInner.class); /* - * The author of the gallery image. + * The properties of the resource. */ - @JsonProperty(value = "properties.author") - private String author; + @JsonProperty(value = "properties", required = true) + private GalleryImageProperties innerProperties = new GalleryImageProperties(); - /* - * The creation date of the gallery image. - */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; - - /* - * The description of the gallery image. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * The image reference of the gallery image. - */ - @JsonProperty(value = "properties.imageReference") - private GalleryImageReference imageReference; - - /* - * The icon of the gallery image. - */ - @JsonProperty(value = "properties.icon") - private String icon; - - /* - * Indicates whether this gallery image is enabled. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.enabled") - private Boolean enabled; + private GalleryImageProperties innerProperties() { + return this.innerProperties; + } - /* - * The third party plan that applies to this image - */ - @JsonProperty(value = "properties.planId") - private String planId; + /** {@inheritDoc} */ + @Override + public GalleryImageInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * Indicates if the plan has been authorized for programmatic deployment. - */ - @JsonProperty(value = "properties.isPlanAuthorized") - private Boolean isPlanAuthorized; + /** {@inheritDoc} */ + @Override + public GalleryImageInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the author property: The author of the gallery image. @@ -74,7 +53,7 @@ public class GalleryImageInner extends Resource { * @return the author value. */ public String author() { - return this.author; + return this.innerProperties() == null ? null : this.innerProperties().author(); } /** @@ -84,7 +63,10 @@ public String author() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withAuthor(String author) { - this.author = author; + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withAuthor(author); return this; } @@ -94,7 +76,7 @@ public GalleryImageInner withAuthor(String author) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -103,7 +85,7 @@ public OffsetDateTime createdDate() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -113,7 +95,10 @@ public String description() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -123,7 +108,7 @@ public GalleryImageInner withDescription(String description) { * @return the imageReference value. */ public GalleryImageReference imageReference() { - return this.imageReference; + return this.innerProperties() == null ? null : this.innerProperties().imageReference(); } /** @@ -133,7 +118,10 @@ public GalleryImageReference imageReference() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withImageReference(GalleryImageReference imageReference) { - this.imageReference = imageReference; + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withImageReference(imageReference); return this; } @@ -143,7 +131,7 @@ public GalleryImageInner withImageReference(GalleryImageReference imageReference * @return the icon value. */ public String icon() { - return this.icon; + return this.innerProperties() == null ? null : this.innerProperties().icon(); } /** @@ -153,7 +141,10 @@ public String icon() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withIcon(String icon) { - this.icon = icon; + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withIcon(icon); return this; } @@ -163,7 +154,7 @@ public GalleryImageInner withIcon(String icon) { * @return the enabled value. */ public Boolean enabled() { - return this.enabled; + return this.innerProperties() == null ? null : this.innerProperties().enabled(); } /** @@ -173,7 +164,10 @@ public Boolean enabled() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withEnabled(Boolean enabled) { - this.enabled = enabled; + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withEnabled(enabled); return this; } @@ -183,7 +177,7 @@ public GalleryImageInner withEnabled(Boolean enabled) { * @return the planId value. */ public String planId() { - return this.planId; + return this.innerProperties() == null ? null : this.innerProperties().planId(); } /** @@ -193,7 +187,10 @@ public String planId() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withPlanId(String planId) { - this.planId = planId; + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withPlanId(planId); return this; } @@ -203,7 +200,7 @@ public GalleryImageInner withPlanId(String planId) { * @return the isPlanAuthorized value. */ public Boolean isPlanAuthorized() { - return this.isPlanAuthorized; + return this.innerProperties() == null ? null : this.innerProperties().isPlanAuthorized(); } /** @@ -213,21 +210,10 @@ public Boolean isPlanAuthorized() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withIsPlanAuthorized(Boolean isPlanAuthorized) { - this.isPlanAuthorized = isPlanAuthorized; - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageInner withTags(Map tags) { - super.withTags(tags); + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withIsPlanAuthorized(isPlanAuthorized); return this; } @@ -237,8 +223,13 @@ public GalleryImageInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (imageReference() != null) { - imageReference().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model GalleryImageInner")); + } else { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..e2c027f879df --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageProperties.java @@ -0,0 +1,226 @@ +// 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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of a gallery image. */ +@Fluent +public final class GalleryImageProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageProperties.class); + + /* + * The author of the gallery image. + */ + @JsonProperty(value = "author") + private String author; + + /* + * The creation date of the gallery image. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The description of the gallery image. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The image reference of the gallery image. + */ + @JsonProperty(value = "imageReference") + private GalleryImageReference imageReference; + + /* + * The icon of the gallery image. + */ + @JsonProperty(value = "icon") + private String icon; + + /* + * Indicates whether this gallery image is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The third party plan that applies to this image + */ + @JsonProperty(value = "planId") + private String planId; + + /* + * Indicates if the plan has been authorized for programmatic deployment. + */ + @JsonProperty(value = "isPlanAuthorized") + private Boolean isPlanAuthorized; + + /** + * Get the author property: The author of the gallery image. + * + * @return the author value. + */ + public String author() { + return this.author; + } + + /** + * Set the author property: The author of the gallery image. + * + * @param author the author value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withAuthor(String author) { + this.author = author; + return this; + } + + /** + * Get the createdDate property: The creation date of the gallery image. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the description property: The description of the gallery image. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the gallery image. + * + * @param description the description value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the imageReference property: The image reference of the gallery image. + * + * @return the imageReference value. + */ + public GalleryImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: The image reference of the gallery image. + * + * @param imageReference the imageReference value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withImageReference(GalleryImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the icon property: The icon of the gallery image. + * + * @return the icon value. + */ + public String icon() { + return this.icon; + } + + /** + * Set the icon property: The icon of the gallery image. + * + * @param icon the icon value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withIcon(String icon) { + this.icon = icon; + return this; + } + + /** + * Get the enabled property: Indicates whether this gallery image is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether this gallery image is enabled. + * + * @param enabled the enabled value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the planId property: The third party plan that applies to this image. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Set the planId property: The third party plan that applies to this image. + * + * @param planId the planId value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withPlanId(String planId) { + this.planId = planId; + return this; + } + + /** + * Get the isPlanAuthorized property: Indicates if the plan has been authorized for programmatic deployment. + * + * @return the isPlanAuthorized value. + */ + public Boolean isPlanAuthorized() { + return this.isPlanAuthorized; + } + + /** + * Set the isPlanAuthorized property: Indicates if the plan has been authorized for programmatic deployment. + * + * @param isPlanAuthorized the isPlanAuthorized value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withIsPlanAuthorized(Boolean isPlanAuthorized) { + this.isPlanAuthorized = isPlanAuthorized; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageReference() != null) { + imageReference().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostInner.java index 21455ba7d8d2..85d6025bb3ca 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.LabCostDetailsProperties; @@ -19,70 +18,38 @@ import java.util.Map; /** A cost item. */ -@JsonFlatten @Fluent -public class LabCostInner extends Resource { +public final class LabCostInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabCostInner.class); /* - * The target cost properties + * The properties of the resource. */ - @JsonProperty(value = "properties.targetCost") - private TargetCostProperties targetCost; + @JsonProperty(value = "properties", required = true) + private LabCostProperties innerProperties = new LabCostProperties(); - /* - * The lab cost summary component of the cost data. - */ - @JsonProperty(value = "properties.labCostSummary", access = JsonProperty.Access.WRITE_ONLY) - private LabCostSummaryProperties labCostSummary; - - /* - * The lab cost details component of the cost data. - */ - @JsonProperty(value = "properties.labCostDetails", access = JsonProperty.Access.WRITE_ONLY) - private List labCostDetails; - - /* - * The resource cost component of the cost data. - */ - @JsonProperty(value = "properties.resourceCosts", access = JsonProperty.Access.WRITE_ONLY) - private List resourceCosts; - - /* - * The currency code of the cost. - */ - @JsonProperty(value = "properties.currencyCode") - private String currencyCode; - - /* - * The start time of the cost data. - */ - @JsonProperty(value = "properties.startDateTime") - private OffsetDateTime startDateTime; - - /* - * The end time of the cost data. - */ - @JsonProperty(value = "properties.endDateTime") - private OffsetDateTime endDateTime; - - /* - * The creation date of the cost. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.createdDate") - private OffsetDateTime createdDate; + private LabCostProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public LabCostInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public LabCostInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the targetCost property: The target cost properties. @@ -90,7 +57,7 @@ public class LabCostInner extends Resource { * @return the targetCost value. */ public TargetCostProperties targetCost() { - return this.targetCost; + return this.innerProperties() == null ? null : this.innerProperties().targetCost(); } /** @@ -100,7 +67,10 @@ public TargetCostProperties targetCost() { * @return the LabCostInner object itself. */ public LabCostInner withTargetCost(TargetCostProperties targetCost) { - this.targetCost = targetCost; + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); + } + this.innerProperties().withTargetCost(targetCost); return this; } @@ -110,7 +80,7 @@ public LabCostInner withTargetCost(TargetCostProperties targetCost) { * @return the labCostSummary value. */ public LabCostSummaryProperties labCostSummary() { - return this.labCostSummary; + return this.innerProperties() == null ? null : this.innerProperties().labCostSummary(); } /** @@ -119,7 +89,7 @@ public LabCostSummaryProperties labCostSummary() { * @return the labCostDetails value. */ public List labCostDetails() { - return this.labCostDetails; + return this.innerProperties() == null ? null : this.innerProperties().labCostDetails(); } /** @@ -128,7 +98,7 @@ public List labCostDetails() { * @return the resourceCosts value. */ public List resourceCosts() { - return this.resourceCosts; + return this.innerProperties() == null ? null : this.innerProperties().resourceCosts(); } /** @@ -137,7 +107,7 @@ public List resourceCosts() { * @return the currencyCode value. */ public String currencyCode() { - return this.currencyCode; + return this.innerProperties() == null ? null : this.innerProperties().currencyCode(); } /** @@ -147,7 +117,10 @@ public String currencyCode() { * @return the LabCostInner object itself. */ public LabCostInner withCurrencyCode(String currencyCode) { - this.currencyCode = currencyCode; + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); + } + this.innerProperties().withCurrencyCode(currencyCode); return this; } @@ -157,7 +130,7 @@ public LabCostInner withCurrencyCode(String currencyCode) { * @return the startDateTime value. */ public OffsetDateTime startDateTime() { - return this.startDateTime; + return this.innerProperties() == null ? null : this.innerProperties().startDateTime(); } /** @@ -167,7 +140,10 @@ public OffsetDateTime startDateTime() { * @return the LabCostInner object itself. */ public LabCostInner withStartDateTime(OffsetDateTime startDateTime) { - this.startDateTime = startDateTime; + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); + } + this.innerProperties().withStartDateTime(startDateTime); return this; } @@ -177,7 +153,7 @@ public LabCostInner withStartDateTime(OffsetDateTime startDateTime) { * @return the endDateTime value. */ public OffsetDateTime endDateTime() { - return this.endDateTime; + return this.innerProperties() == null ? null : this.innerProperties().endDateTime(); } /** @@ -187,7 +163,10 @@ public OffsetDateTime endDateTime() { * @return the LabCostInner object itself. */ public LabCostInner withEndDateTime(OffsetDateTime endDateTime) { - this.endDateTime = endDateTime; + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); + } + this.innerProperties().withEndDateTime(endDateTime); return this; } @@ -197,7 +176,7 @@ public LabCostInner withEndDateTime(OffsetDateTime endDateTime) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -207,7 +186,10 @@ public OffsetDateTime createdDate() { * @return the LabCostInner object itself. */ public LabCostInner withCreatedDate(OffsetDateTime createdDate) { - this.createdDate = createdDate; + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); + } + this.innerProperties().withCreatedDate(createdDate); return this; } @@ -217,7 +199,7 @@ public LabCostInner withCreatedDate(OffsetDateTime createdDate) { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -226,21 +208,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public LabCostInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabCostInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -249,17 +217,12 @@ public LabCostInner withTags(Map tags) { * @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()); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model LabCostInner")); + } else { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..53da60eb98ba --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostProperties.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.LabCostDetailsProperties; +import com.azure.resourcemanager.devtestlabs.models.LabCostSummaryProperties; +import com.azure.resourcemanager.devtestlabs.models.LabResourceCostProperties; +import com.azure.resourcemanager.devtestlabs.models.TargetCostProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of a cost item. */ +@Fluent +public final class LabCostProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabCostProperties.class); + + /* + * The target cost properties + */ + @JsonProperty(value = "targetCost") + private TargetCostProperties targetCost; + + /* + * The lab cost summary component of the cost data. + */ + @JsonProperty(value = "labCostSummary", access = JsonProperty.Access.WRITE_ONLY) + private LabCostSummaryProperties labCostSummary; + + /* + * The lab cost details component of the cost data. + */ + @JsonProperty(value = "labCostDetails", access = JsonProperty.Access.WRITE_ONLY) + private List labCostDetails; + + /* + * The resource cost component of the cost data. + */ + @JsonProperty(value = "resourceCosts", access = JsonProperty.Access.WRITE_ONLY) + private List resourceCosts; + + /* + * The currency code of the cost. + */ + @JsonProperty(value = "currencyCode") + private String currencyCode; + + /* + * The start time of the cost data. + */ + @JsonProperty(value = "startDateTime") + private OffsetDateTime startDateTime; + + /* + * The end time of the cost data. + */ + @JsonProperty(value = "endDateTime") + private OffsetDateTime endDateTime; + + /* + * The creation date of the cost. + */ + @JsonProperty(value = "createdDate") + private OffsetDateTime createdDate; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the targetCost property: The target cost properties. + * + * @return the targetCost value. + */ + public TargetCostProperties targetCost() { + return this.targetCost; + } + + /** + * Set the targetCost property: The target cost properties. + * + * @param targetCost the targetCost value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withTargetCost(TargetCostProperties targetCost) { + this.targetCost = targetCost; + return this; + } + + /** + * Get the labCostSummary property: The lab cost summary component of the cost data. + * + * @return the labCostSummary value. + */ + public LabCostSummaryProperties labCostSummary() { + return this.labCostSummary; + } + + /** + * Get the labCostDetails property: The lab cost details component of the cost data. + * + * @return the labCostDetails value. + */ + public List labCostDetails() { + return this.labCostDetails; + } + + /** + * Get the resourceCosts property: The resource cost component of the cost data. + * + * @return the resourceCosts value. + */ + public List resourceCosts() { + return this.resourceCosts; + } + + /** + * Get the currencyCode property: The currency code of the cost. + * + * @return the currencyCode value. + */ + public String currencyCode() { + return this.currencyCode; + } + + /** + * Set the currencyCode property: The currency code of the cost. + * + * @param currencyCode the currencyCode value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + return this; + } + + /** + * Get the startDateTime property: The start time of the cost data. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: The start time of the cost data. + * + * @param startDateTime the startDateTime value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + return this; + } + + /** + * Get the endDateTime property: The end time of the cost data. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: The end time of the cost data. + * + * @param endDateTime the endDateTime value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Get the createdDate property: The creation date of the cost. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: The creation date of the cost. + * + * @param createdDate the createdDate value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + 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()); + } + } +} 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 f69209b3665a..ca86b6b70880 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.EnvironmentPermission; @@ -20,143 +19,38 @@ import java.util.Map; /** A lab. */ -@JsonFlatten @Fluent -public class LabInner extends Resource { +public final class LabInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabInner.class); /* - * The lab's default storage account. + * The properties of the resource. */ - @JsonProperty(value = "properties.defaultStorageAccount", access = JsonProperty.Access.WRITE_ONLY) - private String defaultStorageAccount; + @JsonProperty(value = "properties") + private LabProperties innerProperties; - /* - * The lab's default premium storage account. - */ - @JsonProperty(value = "properties.defaultPremiumStorageAccount", access = JsonProperty.Access.WRITE_ONLY) - private String defaultPremiumStorageAccount; - - /* - * The lab's artifact storage account. - */ - @JsonProperty(value = "properties.artifactsStorageAccount", access = JsonProperty.Access.WRITE_ONLY) - private String artifactsStorageAccount; - - /* - * The lab's premium data disk storage account. - */ - @JsonProperty(value = "properties.premiumDataDiskStorageAccount", access = JsonProperty.Access.WRITE_ONLY) - private String premiumDataDiskStorageAccount; - - /* - * The lab's Key vault. - */ - @JsonProperty(value = "properties.vaultName", access = JsonProperty.Access.WRITE_ONLY) - private String vaultName; - - /* - * Type of storage used by the lab. It can be either Premium or Standard. - * Default is Premium. - */ - @JsonProperty(value = "properties.labStorageType") - private StorageType labStorageType; - - /* - * The ordered list of artifact resource IDs that should be applied on all - * Linux VM creations by default, prior to the artifacts specified by the - * user. - */ - @JsonProperty(value = "properties.mandatoryArtifactsResourceIdsLinux") - private List mandatoryArtifactsResourceIdsLinux; - - /* - * The ordered list of artifact resource IDs that should be applied on all - * Windows VM creations by default, prior to the artifacts specified by the - * user. - */ - @JsonProperty(value = "properties.mandatoryArtifactsResourceIdsWindows") - private List mandatoryArtifactsResourceIdsWindows; - - /* - * The creation date of the lab. - */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; - - /* - * The setting to enable usage of premium data disks. - * When its value is 'Enabled', creation of standard or premium data disks - * is allowed. - * When its value is 'Disabled', only creation of standard data disks is - * allowed. - */ - @JsonProperty(value = "properties.premiumDataDisks") - private PremiumDataDisk premiumDataDisks; - - /* - * The access rights to be granted to the user when provisioning an - * environment - */ - @JsonProperty(value = "properties.environmentPermission") - private EnvironmentPermission environmentPermission; - - /* - * The properties of any lab announcement associated with this lab - */ - @JsonProperty(value = "properties.announcement") - private LabAnnouncementProperties announcement; - - /* - * The properties of any lab support message associated with this lab - */ - @JsonProperty(value = "properties.support") - private LabSupportProperties support; - - /* - * The resource group in which all new lab virtual machines will be - * created. To let DevTest Labs manage resource group creation, set this - * value to null. - */ - @JsonProperty(value = "properties.vmCreationResourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String vmCreationResourceGroup; - - /* - * The public IP address for the lab's load balancer. - */ - @JsonProperty(value = "properties.publicIpId", access = JsonProperty.Access.WRITE_ONLY) - private String publicIpId; - - /* - * The load balancer used to for lab VMs that use shared IP address. - */ - @JsonProperty(value = "properties.loadBalancerId", access = JsonProperty.Access.WRITE_ONLY) - private String loadBalancerId; - - /* - * The Network Security Group attached to the lab VMs Network interfaces to - * restrict open ports. - */ - @JsonProperty(value = "properties.networkSecurityGroupId", access = JsonProperty.Access.WRITE_ONLY) - private String networkSecurityGroupId; - - /* - * Extended properties of the lab used for experimental features + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.extendedProperties") - private Map extendedProperties; + private LabProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public LabInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public LabInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the defaultStorageAccount property: The lab's default storage account. @@ -164,7 +58,7 @@ public class LabInner extends Resource { * @return the defaultStorageAccount value. */ public String defaultStorageAccount() { - return this.defaultStorageAccount; + return this.innerProperties() == null ? null : this.innerProperties().defaultStorageAccount(); } /** @@ -173,7 +67,7 @@ public String defaultStorageAccount() { * @return the defaultPremiumStorageAccount value. */ public String defaultPremiumStorageAccount() { - return this.defaultPremiumStorageAccount; + return this.innerProperties() == null ? null : this.innerProperties().defaultPremiumStorageAccount(); } /** @@ -182,7 +76,7 @@ public String defaultPremiumStorageAccount() { * @return the artifactsStorageAccount value. */ public String artifactsStorageAccount() { - return this.artifactsStorageAccount; + return this.innerProperties() == null ? null : this.innerProperties().artifactsStorageAccount(); } /** @@ -191,7 +85,7 @@ public String artifactsStorageAccount() { * @return the premiumDataDiskStorageAccount value. */ public String premiumDataDiskStorageAccount() { - return this.premiumDataDiskStorageAccount; + return this.innerProperties() == null ? null : this.innerProperties().premiumDataDiskStorageAccount(); } /** @@ -200,7 +94,7 @@ public String premiumDataDiskStorageAccount() { * @return the vaultName value. */ public String vaultName() { - return this.vaultName; + return this.innerProperties() == null ? null : this.innerProperties().vaultName(); } /** @@ -210,7 +104,7 @@ public String vaultName() { * @return the labStorageType value. */ public StorageType labStorageType() { - return this.labStorageType; + return this.innerProperties() == null ? null : this.innerProperties().labStorageType(); } /** @@ -221,7 +115,10 @@ public StorageType labStorageType() { * @return the LabInner object itself. */ public LabInner withLabStorageType(StorageType labStorageType) { - this.labStorageType = labStorageType; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withLabStorageType(labStorageType); return this; } @@ -232,7 +129,7 @@ public LabInner withLabStorageType(StorageType labStorageType) { * @return the mandatoryArtifactsResourceIdsLinux value. */ public List mandatoryArtifactsResourceIdsLinux() { - return this.mandatoryArtifactsResourceIdsLinux; + return this.innerProperties() == null ? null : this.innerProperties().mandatoryArtifactsResourceIdsLinux(); } /** @@ -243,7 +140,10 @@ public List mandatoryArtifactsResourceIdsLinux() { * @return the LabInner object itself. */ public LabInner withMandatoryArtifactsResourceIdsLinux(List mandatoryArtifactsResourceIdsLinux) { - this.mandatoryArtifactsResourceIdsLinux = mandatoryArtifactsResourceIdsLinux; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withMandatoryArtifactsResourceIdsLinux(mandatoryArtifactsResourceIdsLinux); return this; } @@ -254,7 +154,7 @@ public LabInner withMandatoryArtifactsResourceIdsLinux(List mandatoryArt * @return the mandatoryArtifactsResourceIdsWindows value. */ public List mandatoryArtifactsResourceIdsWindows() { - return this.mandatoryArtifactsResourceIdsWindows; + return this.innerProperties() == null ? null : this.innerProperties().mandatoryArtifactsResourceIdsWindows(); } /** @@ -265,7 +165,10 @@ public List mandatoryArtifactsResourceIdsWindows() { * @return the LabInner object itself. */ public LabInner withMandatoryArtifactsResourceIdsWindows(List mandatoryArtifactsResourceIdsWindows) { - this.mandatoryArtifactsResourceIdsWindows = mandatoryArtifactsResourceIdsWindows; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withMandatoryArtifactsResourceIdsWindows(mandatoryArtifactsResourceIdsWindows); return this; } @@ -275,7 +178,7 @@ public LabInner withMandatoryArtifactsResourceIdsWindows(List mandatoryA * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -286,7 +189,7 @@ public OffsetDateTime createdDate() { * @return the premiumDataDisks value. */ public PremiumDataDisk premiumDataDisks() { - return this.premiumDataDisks; + return this.innerProperties() == null ? null : this.innerProperties().premiumDataDisks(); } /** @@ -298,7 +201,10 @@ public PremiumDataDisk premiumDataDisks() { * @return the LabInner object itself. */ public LabInner withPremiumDataDisks(PremiumDataDisk premiumDataDisks) { - this.premiumDataDisks = premiumDataDisks; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withPremiumDataDisks(premiumDataDisks); return this; } @@ -309,7 +215,7 @@ public LabInner withPremiumDataDisks(PremiumDataDisk premiumDataDisks) { * @return the environmentPermission value. */ public EnvironmentPermission environmentPermission() { - return this.environmentPermission; + return this.innerProperties() == null ? null : this.innerProperties().environmentPermission(); } /** @@ -320,7 +226,10 @@ public EnvironmentPermission environmentPermission() { * @return the LabInner object itself. */ public LabInner withEnvironmentPermission(EnvironmentPermission environmentPermission) { - this.environmentPermission = environmentPermission; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withEnvironmentPermission(environmentPermission); return this; } @@ -330,7 +239,7 @@ public LabInner withEnvironmentPermission(EnvironmentPermission environmentPermi * @return the announcement value. */ public LabAnnouncementProperties announcement() { - return this.announcement; + return this.innerProperties() == null ? null : this.innerProperties().announcement(); } /** @@ -340,7 +249,10 @@ public LabAnnouncementProperties announcement() { * @return the LabInner object itself. */ public LabInner withAnnouncement(LabAnnouncementProperties announcement) { - this.announcement = announcement; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withAnnouncement(announcement); return this; } @@ -350,7 +262,7 @@ public LabInner withAnnouncement(LabAnnouncementProperties announcement) { * @return the support value. */ public LabSupportProperties support() { - return this.support; + return this.innerProperties() == null ? null : this.innerProperties().support(); } /** @@ -360,7 +272,10 @@ public LabSupportProperties support() { * @return the LabInner object itself. */ public LabInner withSupport(LabSupportProperties support) { - this.support = support; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withSupport(support); return this; } @@ -371,7 +286,7 @@ public LabInner withSupport(LabSupportProperties support) { * @return the vmCreationResourceGroup value. */ public String vmCreationResourceGroup() { - return this.vmCreationResourceGroup; + return this.innerProperties() == null ? null : this.innerProperties().vmCreationResourceGroup(); } /** @@ -380,7 +295,7 @@ public String vmCreationResourceGroup() { * @return the publicIpId value. */ public String publicIpId() { - return this.publicIpId; + return this.innerProperties() == null ? null : this.innerProperties().publicIpId(); } /** @@ -389,7 +304,7 @@ public String publicIpId() { * @return the loadBalancerId value. */ public String loadBalancerId() { - return this.loadBalancerId; + return this.innerProperties() == null ? null : this.innerProperties().loadBalancerId(); } /** @@ -399,7 +314,7 @@ public String loadBalancerId() { * @return the networkSecurityGroupId value. */ public String networkSecurityGroupId() { - return this.networkSecurityGroupId; + return this.innerProperties() == null ? null : this.innerProperties().networkSecurityGroupId(); } /** @@ -408,7 +323,7 @@ public String networkSecurityGroupId() { * @return the extendedProperties value. */ public Map extendedProperties() { - return this.extendedProperties; + return this.innerProperties() == null ? null : this.innerProperties().extendedProperties(); } /** @@ -418,7 +333,10 @@ public Map extendedProperties() { * @return the LabInner object itself. */ public LabInner withExtendedProperties(Map extendedProperties) { - this.extendedProperties = extendedProperties; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withExtendedProperties(extendedProperties); return this; } @@ -428,7 +346,7 @@ public LabInner withExtendedProperties(Map extendedProperties) { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -437,21 +355,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public LabInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -460,11 +364,8 @@ public LabInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (announcement() != null) { - announcement().validate(); - } - if (support() != null) { - support().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..877b32b9ca52 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabProperties.java @@ -0,0 +1,455 @@ +// 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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnvironmentPermission; +import com.azure.resourcemanager.devtestlabs.models.LabAnnouncementProperties; +import com.azure.resourcemanager.devtestlabs.models.LabSupportProperties; +import com.azure.resourcemanager.devtestlabs.models.PremiumDataDisk; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Properties of a lab. */ +@Fluent +public final class LabProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabProperties.class); + + /* + * The lab's default storage account. + */ + @JsonProperty(value = "defaultStorageAccount", access = JsonProperty.Access.WRITE_ONLY) + private String defaultStorageAccount; + + /* + * The lab's default premium storage account. + */ + @JsonProperty(value = "defaultPremiumStorageAccount", access = JsonProperty.Access.WRITE_ONLY) + private String defaultPremiumStorageAccount; + + /* + * The lab's artifact storage account. + */ + @JsonProperty(value = "artifactsStorageAccount", access = JsonProperty.Access.WRITE_ONLY) + private String artifactsStorageAccount; + + /* + * The lab's premium data disk storage account. + */ + @JsonProperty(value = "premiumDataDiskStorageAccount", access = JsonProperty.Access.WRITE_ONLY) + private String premiumDataDiskStorageAccount; + + /* + * The lab's Key vault. + */ + @JsonProperty(value = "vaultName", access = JsonProperty.Access.WRITE_ONLY) + private String vaultName; + + /* + * Type of storage used by the lab. It can be either Premium or Standard. + * Default is Premium. + */ + @JsonProperty(value = "labStorageType") + private StorageType labStorageType; + + /* + * The ordered list of artifact resource IDs that should be applied on all + * Linux VM creations by default, prior to the artifacts specified by the + * user. + */ + @JsonProperty(value = "mandatoryArtifactsResourceIdsLinux") + private List mandatoryArtifactsResourceIdsLinux; + + /* + * The ordered list of artifact resource IDs that should be applied on all + * Windows VM creations by default, prior to the artifacts specified by the + * user. + */ + @JsonProperty(value = "mandatoryArtifactsResourceIdsWindows") + private List mandatoryArtifactsResourceIdsWindows; + + /* + * The creation date of the lab. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The setting to enable usage of premium data disks. + * When its value is 'Enabled', creation of standard or premium data disks + * is allowed. + * When its value is 'Disabled', only creation of standard data disks is + * allowed. + */ + @JsonProperty(value = "premiumDataDisks") + private PremiumDataDisk premiumDataDisks; + + /* + * The access rights to be granted to the user when provisioning an + * environment + */ + @JsonProperty(value = "environmentPermission") + private EnvironmentPermission environmentPermission; + + /* + * The properties of any lab announcement associated with this lab + */ + @JsonProperty(value = "announcement") + private LabAnnouncementProperties announcement; + + /* + * The properties of any lab support message associated with this lab + */ + @JsonProperty(value = "support") + private LabSupportProperties support; + + /* + * The resource group in which all new lab virtual machines will be + * created. To let DevTest Labs manage resource group creation, set this + * value to null. + */ + @JsonProperty(value = "vmCreationResourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String vmCreationResourceGroup; + + /* + * The public IP address for the lab's load balancer. + */ + @JsonProperty(value = "publicIpId", access = JsonProperty.Access.WRITE_ONLY) + private String publicIpId; + + /* + * The load balancer used to for lab VMs that use shared IP address. + */ + @JsonProperty(value = "loadBalancerId", access = JsonProperty.Access.WRITE_ONLY) + private String loadBalancerId; + + /* + * The Network Security Group attached to the lab VMs Network interfaces to + * restrict open ports. + */ + @JsonProperty(value = "networkSecurityGroupId", access = JsonProperty.Access.WRITE_ONLY) + private String networkSecurityGroupId; + + /* + * Extended properties of the lab used for experimental features + */ + @JsonProperty(value = "extendedProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map extendedProperties; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the defaultStorageAccount property: The lab's default storage account. + * + * @return the defaultStorageAccount value. + */ + public String defaultStorageAccount() { + return this.defaultStorageAccount; + } + + /** + * Get the defaultPremiumStorageAccount property: The lab's default premium storage account. + * + * @return the defaultPremiumStorageAccount value. + */ + public String defaultPremiumStorageAccount() { + return this.defaultPremiumStorageAccount; + } + + /** + * Get the artifactsStorageAccount property: The lab's artifact storage account. + * + * @return the artifactsStorageAccount value. + */ + public String artifactsStorageAccount() { + return this.artifactsStorageAccount; + } + + /** + * Get the premiumDataDiskStorageAccount property: The lab's premium data disk storage account. + * + * @return the premiumDataDiskStorageAccount value. + */ + public String premiumDataDiskStorageAccount() { + return this.premiumDataDiskStorageAccount; + } + + /** + * Get the vaultName property: The lab's Key vault. + * + * @return the vaultName value. + */ + public String vaultName() { + return this.vaultName; + } + + /** + * Get the labStorageType property: Type of storage used by the lab. It can be either Premium or Standard. Default + * is Premium. + * + * @return the labStorageType value. + */ + public StorageType labStorageType() { + return this.labStorageType; + } + + /** + * Set the labStorageType property: Type of storage used by the lab. It can be either Premium or Standard. Default + * is Premium. + * + * @param labStorageType the labStorageType value to set. + * @return the LabProperties object itself. + */ + public LabProperties withLabStorageType(StorageType labStorageType) { + this.labStorageType = labStorageType; + return this; + } + + /** + * Get the mandatoryArtifactsResourceIdsLinux property: The ordered list of artifact resource IDs that should be + * applied on all Linux VM creations by default, prior to the artifacts specified by the user. + * + * @return the mandatoryArtifactsResourceIdsLinux value. + */ + public List mandatoryArtifactsResourceIdsLinux() { + return this.mandatoryArtifactsResourceIdsLinux; + } + + /** + * Set the mandatoryArtifactsResourceIdsLinux property: The ordered list of artifact resource IDs that should be + * applied on all Linux VM creations by default, prior to the artifacts specified by the user. + * + * @param mandatoryArtifactsResourceIdsLinux the mandatoryArtifactsResourceIdsLinux value to set. + * @return the LabProperties object itself. + */ + public LabProperties withMandatoryArtifactsResourceIdsLinux(List mandatoryArtifactsResourceIdsLinux) { + this.mandatoryArtifactsResourceIdsLinux = mandatoryArtifactsResourceIdsLinux; + return this; + } + + /** + * Get the mandatoryArtifactsResourceIdsWindows property: The ordered list of artifact resource IDs that should be + * applied on all Windows VM creations by default, prior to the artifacts specified by the user. + * + * @return the mandatoryArtifactsResourceIdsWindows value. + */ + public List mandatoryArtifactsResourceIdsWindows() { + return this.mandatoryArtifactsResourceIdsWindows; + } + + /** + * Set the mandatoryArtifactsResourceIdsWindows property: The ordered list of artifact resource IDs that should be + * applied on all Windows VM creations by default, prior to the artifacts specified by the user. + * + * @param mandatoryArtifactsResourceIdsWindows the mandatoryArtifactsResourceIdsWindows value to set. + * @return the LabProperties object itself. + */ + public LabProperties withMandatoryArtifactsResourceIdsWindows(List mandatoryArtifactsResourceIdsWindows) { + this.mandatoryArtifactsResourceIdsWindows = mandatoryArtifactsResourceIdsWindows; + return this; + } + + /** + * Get the createdDate property: The creation date of the lab. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the premiumDataDisks property: The setting to enable usage of premium data disks. When its value is + * 'Enabled', creation of standard or premium data disks is allowed. When its value is 'Disabled', only creation of + * standard data disks is allowed. + * + * @return the premiumDataDisks value. + */ + public PremiumDataDisk premiumDataDisks() { + return this.premiumDataDisks; + } + + /** + * Set the premiumDataDisks property: The setting to enable usage of premium data disks. When its value is + * 'Enabled', creation of standard or premium data disks is allowed. When its value is 'Disabled', only creation of + * standard data disks is allowed. + * + * @param premiumDataDisks the premiumDataDisks value to set. + * @return the LabProperties object itself. + */ + public LabProperties withPremiumDataDisks(PremiumDataDisk premiumDataDisks) { + this.premiumDataDisks = premiumDataDisks; + return this; + } + + /** + * Get the environmentPermission property: The access rights to be granted to the user when provisioning an + * environment. + * + * @return the environmentPermission value. + */ + public EnvironmentPermission environmentPermission() { + return this.environmentPermission; + } + + /** + * Set the environmentPermission property: The access rights to be granted to the user when provisioning an + * environment. + * + * @param environmentPermission the environmentPermission value to set. + * @return the LabProperties object itself. + */ + public LabProperties withEnvironmentPermission(EnvironmentPermission environmentPermission) { + this.environmentPermission = environmentPermission; + return this; + } + + /** + * Get the announcement property: The properties of any lab announcement associated with this lab. + * + * @return the announcement value. + */ + public LabAnnouncementProperties announcement() { + return this.announcement; + } + + /** + * Set the announcement property: The properties of any lab announcement associated with this lab. + * + * @param announcement the announcement value to set. + * @return the LabProperties object itself. + */ + public LabProperties withAnnouncement(LabAnnouncementProperties announcement) { + this.announcement = announcement; + return this; + } + + /** + * Get the support property: The properties of any lab support message associated with this lab. + * + * @return the support value. + */ + public LabSupportProperties support() { + return this.support; + } + + /** + * Set the support property: The properties of any lab support message associated with this lab. + * + * @param support the support value to set. + * @return the LabProperties object itself. + */ + public LabProperties withSupport(LabSupportProperties support) { + this.support = support; + return this; + } + + /** + * Get the vmCreationResourceGroup property: The resource group in which all new lab virtual machines will be + * created. To let DevTest Labs manage resource group creation, set this value to null. + * + * @return the vmCreationResourceGroup value. + */ + public String vmCreationResourceGroup() { + return this.vmCreationResourceGroup; + } + + /** + * Get the publicIpId property: The public IP address for the lab's load balancer. + * + * @return the publicIpId value. + */ + public String publicIpId() { + return this.publicIpId; + } + + /** + * Get the loadBalancerId property: The load balancer used to for lab VMs that use shared IP address. + * + * @return the loadBalancerId value. + */ + public String loadBalancerId() { + return this.loadBalancerId; + } + + /** + * Get the networkSecurityGroupId property: The Network Security Group attached to the lab VMs Network interfaces to + * restrict open ports. + * + * @return the networkSecurityGroupId value. + */ + public String networkSecurityGroupId() { + return this.networkSecurityGroupId; + } + + /** + * Get the extendedProperties property: Extended properties of the lab used for experimental features. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: Extended properties of the lab used for experimental features. + * + * @param extendedProperties the extendedProperties value to set. + * @return the LabProperties object itself. + */ + public LabProperties withExtendedProperties(Map extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + 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(); + } + } +} 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 new file mode 100644 index 000000000000..e8ed873ffac6 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterProperties.java @@ -0,0 +1,689 @@ +// 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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.BulkCreationParameters; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; +import com.azure.resourcemanager.devtestlabs.models.NetworkInterfaceProperties; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties for virtual machine creation. */ +@Fluent +public final class LabVirtualMachineCreationParameterProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(LabVirtualMachineCreationParameterProperties.class); + + /* + * The number of virtual machine instances to create. + */ + @JsonProperty(value = "bulkCreationParameters") + private BulkCreationParameters bulkCreationParameters; + + /* + * The notes of the virtual machine. + */ + @JsonProperty(value = "notes") + private String notes; + + /* + * The object identifier of the owner of the virtual machine. + */ + @JsonProperty(value = "ownerObjectId") + private String ownerObjectId; + + /* + * The user principal name of the virtual machine owner. + */ + @JsonProperty(value = "ownerUserPrincipalName") + private String ownerUserPrincipalName; + + /* + * The creation date of the virtual machine. + */ + @JsonProperty(value = "createdDate") + private OffsetDateTime createdDate; + + /* + * The custom image identifier of the virtual machine. + */ + @JsonProperty(value = "customImageId") + private String customImageId; + + /* + * The size of the virtual machine. + */ + @JsonProperty(value = "size") + private String size; + + /* + * The user name of the virtual machine. + */ + @JsonProperty(value = "userName") + private String username; + + /* + * The password of the virtual machine administrator. + */ + @JsonProperty(value = "password") + private String password; + + /* + * The SSH key of the virtual machine administrator. + */ + @JsonProperty(value = "sshKey") + private String sshKey; + + /* + * Indicates whether this virtual machine uses an SSH key for + * authentication. + */ + @JsonProperty(value = "isAuthenticationWithSshKey") + private Boolean isAuthenticationWithSshKey; + + /* + * The lab subnet name of the virtual machine. + */ + @JsonProperty(value = "labSubnetName") + private String labSubnetName; + + /* + * The lab virtual network identifier of the virtual machine. + */ + @JsonProperty(value = "labVirtualNetworkId") + private String labVirtualNetworkId; + + /* + * Indicates whether the virtual machine is to be created without a public + * IP address. + */ + @JsonProperty(value = "disallowPublicIpAddress") + private Boolean disallowPublicIpAddress; + + /* + * The artifacts to be installed on the virtual machine. + */ + @JsonProperty(value = "artifacts") + private List artifacts; + + /* + * The Microsoft Azure Marketplace image reference of the virtual machine. + */ + @JsonProperty(value = "galleryImageReference") + private GalleryImageReference galleryImageReference; + + /* + * The id of the plan associated with the virtual machine image + */ + @JsonProperty(value = "planId") + private String planId; + + /* + * The network interface properties. + */ + @JsonProperty(value = "networkInterface") + private NetworkInterfaceProperties networkInterface; + + /* + * The expiration date for VM. + */ + @JsonProperty(value = "expirationDate") + private OffsetDateTime expirationDate; + + /* + * Indicates whether another user can take ownership of the virtual machine + */ + @JsonProperty(value = "allowClaim") + private Boolean allowClaim; + + /* + * Storage type to use for virtual machine (i.e. Standard, Premium). + */ + @JsonProperty(value = "storageType") + private String storageType; + + /* + * The resource ID of the environment that contains this virtual machine, + * if any. + */ + @JsonProperty(value = "environmentId") + private String environmentId; + + /* + * New or existing data disks to attach to the virtual machine after + * creation + */ + @JsonProperty(value = "dataDiskParameters") + private List dataDiskParameters; + + /* + * Virtual Machine schedules to be created + */ + @JsonProperty(value = "scheduleParameters") + private List scheduleParameters; + + /** + * Get the bulkCreationParameters property: The number of virtual machine instances to create. + * + * @return the bulkCreationParameters value. + */ + public BulkCreationParameters bulkCreationParameters() { + return this.bulkCreationParameters; + } + + /** + * Set the bulkCreationParameters property: The number of virtual machine instances to create. + * + * @param bulkCreationParameters the bulkCreationParameters value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withBulkCreationParameters( + BulkCreationParameters bulkCreationParameters) { + this.bulkCreationParameters = bulkCreationParameters; + return this; + } + + /** + * Get the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: The notes of the virtual machine. + * + * @param notes the notes value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Get the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + public String ownerObjectId() { + return this.ownerObjectId; + } + + /** + * Set the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @param ownerObjectId the ownerObjectId value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withOwnerObjectId(String ownerObjectId) { + this.ownerObjectId = ownerObjectId; + return this; + } + + /** + * Get the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @return the ownerUserPrincipalName value. + */ + public String ownerUserPrincipalName() { + return this.ownerUserPrincipalName; + } + + /** + * Set the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @param ownerUserPrincipalName the ownerUserPrincipalName value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withOwnerUserPrincipalName(String ownerUserPrincipalName) { + this.ownerUserPrincipalName = ownerUserPrincipalName; + return this; + } + + /** + * Get the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: The creation date of the virtual machine. + * + * @param createdDate the createdDate value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. + */ + public String customImageId() { + return this.customImageId; + } + + /** + * Set the customImageId property: The custom image identifier of the virtual machine. + * + * @param customImageId the customImageId value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withCustomImageId(String customImageId) { + this.customImageId = customImageId; + return this; + } + + /** + * Get the size property: The size of the virtual machine. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The size of the virtual machine. + * + * @param size the size value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the username property: The user name of the virtual machine. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The user name of the virtual machine. + * + * @param username the username value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password of the virtual machine administrator. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password of the virtual machine administrator. + * + * @param password the password value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. + */ + public String sshKey() { + return this.sshKey; + } + + /** + * Set the sshKey property: The SSH key of the virtual machine administrator. + * + * @param sshKey the sshKey value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withSshKey(String sshKey) { + this.sshKey = sshKey; + return this; + } + + /** + * Get the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @return the isAuthenticationWithSshKey value. + */ + public Boolean isAuthenticationWithSshKey() { + return this.isAuthenticationWithSshKey; + } + + /** + * Set the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @param isAuthenticationWithSshKey the isAuthenticationWithSshKey value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withIsAuthenticationWithSshKey( + Boolean isAuthenticationWithSshKey) { + this.isAuthenticationWithSshKey = isAuthenticationWithSshKey; + return this; + } + + /** + * Get the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. + */ + public String labSubnetName() { + return this.labSubnetName; + } + + /** + * Set the labSubnetName property: The lab subnet name of the virtual machine. + * + * @param labSubnetName the labSubnetName value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withLabSubnetName(String labSubnetName) { + this.labSubnetName = labSubnetName; + return this; + } + + /** + * Get the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. + */ + public String labVirtualNetworkId() { + return this.labVirtualNetworkId; + } + + /** + * Set the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @param labVirtualNetworkId the labVirtualNetworkId value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withLabVirtualNetworkId(String labVirtualNetworkId) { + this.labVirtualNetworkId = labVirtualNetworkId; + return this; + } + + /** + * Get the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @return the disallowPublicIpAddress value. + */ + public Boolean disallowPublicIpAddress() { + return this.disallowPublicIpAddress; + } + + /** + * Set the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @param disallowPublicIpAddress the disallowPublicIpAddress value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withDisallowPublicIpAddress(Boolean disallowPublicIpAddress) { + this.disallowPublicIpAddress = disallowPublicIpAddress; + return this; + } + + /** + * Get the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.artifacts; + } + + /** + * Set the artifacts property: The artifacts to be installed on the virtual machine. + * + * @param artifacts the artifacts value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withArtifacts(List artifacts) { + this.artifacts = artifacts; + return this; + } + + /** + * Get the galleryImageReference property: The Microsoft Azure Marketplace image reference of the virtual machine. + * + * @return the galleryImageReference value. + */ + public GalleryImageReference galleryImageReference() { + return this.galleryImageReference; + } + + /** + * Set the galleryImageReference property: The Microsoft Azure Marketplace image reference of the virtual machine. + * + * @param galleryImageReference the galleryImageReference value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withGalleryImageReference( + GalleryImageReference galleryImageReference) { + this.galleryImageReference = galleryImageReference; + return this; + } + + /** + * Get the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Set the planId property: The id of the plan associated with the virtual machine image. + * + * @param planId the planId value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withPlanId(String planId) { + this.planId = planId; + return this; + } + + /** + * Get the networkInterface property: The network interface properties. + * + * @return the networkInterface value. + */ + public NetworkInterfaceProperties networkInterface() { + return this.networkInterface; + } + + /** + * Set the networkInterface property: The network interface properties. + * + * @param networkInterface the networkInterface value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withNetworkInterface( + NetworkInterfaceProperties networkInterface) { + this.networkInterface = networkInterface; + return this; + } + + /** + * Get the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.expirationDate; + } + + /** + * Set the expirationDate property: The expiration date for VM. + * + * @param expirationDate the expirationDate value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withExpirationDate(OffsetDateTime expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. + */ + public Boolean allowClaim() { + return this.allowClaim; + } + + /** + * Set the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @param allowClaim the allowClaim value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withAllowClaim(Boolean allowClaim) { + this.allowClaim = allowClaim; + return this; + } + + /** + * Get the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium). + * + * @return the storageType value. + */ + public String storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium). + * + * @param storageType the storageType value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withStorageType(String storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @param environmentId the environmentId value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. + */ + public List dataDiskParameters() { + return this.dataDiskParameters; + } + + /** + * Set the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @param dataDiskParameters the dataDiskParameters value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withDataDiskParameters( + List dataDiskParameters) { + this.dataDiskParameters = dataDiskParameters; + return this; + } + + /** + * Get the scheduleParameters property: Virtual Machine schedules to be created. + * + * @return the scheduleParameters value. + */ + public List scheduleParameters() { + return this.scheduleParameters; + } + + /** + * Set the scheduleParameters property: Virtual Machine schedules to be created. + * + * @param scheduleParameters the scheduleParameters value to set. + * @return the LabVirtualMachineCreationParameterProperties object itself. + */ + public LabVirtualMachineCreationParameterProperties withScheduleParameters( + List scheduleParameters) { + this.scheduleParameters = 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()); + } + } +} 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 5bad56a004e4..f3d4fe2564c9 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.ArtifactDeploymentStatusProperties; @@ -23,224 +22,38 @@ import java.util.Map; /** A virtual machine. */ -@JsonFlatten @Fluent -public class LabVirtualMachineInner extends Resource { +public final class LabVirtualMachineInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabVirtualMachineInner.class); /* - * The notes of the virtual machine. + * The properties of the resource. */ - @JsonProperty(value = "properties.notes") - private String notes; + @JsonProperty(value = "properties", required = true) + private LabVirtualMachinePropertiesInner innerProperties = new LabVirtualMachinePropertiesInner(); - /* - * The object identifier of the owner of the virtual machine. - */ - @JsonProperty(value = "properties.ownerObjectId") - private String ownerObjectId; - - /* - * The user principal name of the virtual machine owner. - */ - @JsonProperty(value = "properties.ownerUserPrincipalName") - private String ownerUserPrincipalName; - - /* - * The object identifier of the creator of the virtual machine. - */ - @JsonProperty(value = "properties.createdByUserId", access = JsonProperty.Access.WRITE_ONLY) - private String createdByUserId; - - /* - * The email address of creator of the virtual machine. - */ - @JsonProperty(value = "properties.createdByUser", access = JsonProperty.Access.WRITE_ONLY) - private String createdByUser; - - /* - * The creation date of the virtual machine. - */ - @JsonProperty(value = "properties.createdDate") - private OffsetDateTime createdDate; - - /* - * The resource identifier (Microsoft.Compute) of the virtual machine. - */ - @JsonProperty(value = "properties.computeId", access = JsonProperty.Access.WRITE_ONLY) - private String computeId; - - /* - * The custom image identifier of the virtual machine. - */ - @JsonProperty(value = "properties.customImageId") - private String customImageId; - - /* - * The OS type of the virtual machine. - */ - @JsonProperty(value = "properties.osType", access = JsonProperty.Access.WRITE_ONLY) - private String osType; - - /* - * The size of the virtual machine. - */ - @JsonProperty(value = "properties.size") - private String size; - - /* - * The user name of the virtual machine. - */ - @JsonProperty(value = "properties.userName") - private String username; - - /* - * The password of the virtual machine administrator. - */ - @JsonProperty(value = "properties.password") - private String password; - - /* - * The SSH key of the virtual machine administrator. - */ - @JsonProperty(value = "properties.sshKey") - private String sshKey; - - /* - * Indicates whether this virtual machine uses an SSH key for - * authentication. - */ - @JsonProperty(value = "properties.isAuthenticationWithSshKey") - private Boolean isAuthenticationWithSshKey; - - /* - * The fully-qualified domain name of the virtual machine. - */ - @JsonProperty(value = "properties.fqdn", access = JsonProperty.Access.WRITE_ONLY) - private String fqdn; - - /* - * The lab subnet name of the virtual machine. - */ - @JsonProperty(value = "properties.labSubnetName") - private String labSubnetName; - - /* - * The lab virtual network identifier of the virtual machine. - */ - @JsonProperty(value = "properties.labVirtualNetworkId") - private String labVirtualNetworkId; - - /* - * Indicates whether the virtual machine is to be created without a public - * IP address. - */ - @JsonProperty(value = "properties.disallowPublicIpAddress") - private Boolean disallowPublicIpAddress; - - /* - * The artifacts to be installed on the virtual machine. - */ - @JsonProperty(value = "properties.artifacts") - private List artifacts; - - /* - * The artifact deployment status for the virtual machine. - */ - @JsonProperty(value = "properties.artifactDeploymentStatus", access = JsonProperty.Access.WRITE_ONLY) - private ArtifactDeploymentStatusProperties artifactDeploymentStatus; - - /* - * The Microsoft Azure Marketplace image reference of the virtual machine. - */ - @JsonProperty(value = "properties.galleryImageReference") - private GalleryImageReference galleryImageReference; - - /* - * The id of the plan associated with the virtual machine image - */ - @JsonProperty(value = "properties.planId") - private String planId; - - /* - * The compute virtual machine properties. - */ - @JsonProperty(value = "properties.computeVm", access = JsonProperty.Access.WRITE_ONLY) - private ComputeVmProperties computeVm; - - /* - * The network interface properties. - */ - @JsonProperty(value = "properties.networkInterface") - private NetworkInterfaceProperties networkInterface; - - /* - * The applicable schedule for the virtual machine. - */ - @JsonProperty(value = "properties.applicableSchedule", access = JsonProperty.Access.WRITE_ONLY) - private ApplicableScheduleInner applicableSchedule; - - /* - * The expiration date for VM. - */ - @JsonProperty(value = "properties.expirationDate") - private OffsetDateTime expirationDate; - - /* - * Indicates whether another user can take ownership of the virtual machine - */ - @JsonProperty(value = "properties.allowClaim") - private Boolean allowClaim; - - /* - * Storage type to use for virtual machine (i.e. Standard, Premium). - */ - @JsonProperty(value = "properties.storageType") - private String storageType; - - /* - * Tells source of creation of lab virtual machine. Output property only. - */ - @JsonProperty(value = "properties.virtualMachineCreationSource", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineCreationSource virtualMachineCreationSource; - - /* - * The resource ID of the environment that contains this virtual machine, - * if any. - */ - @JsonProperty(value = "properties.environmentId") - private String environmentId; - - /* - * New or existing data disks to attach to the virtual machine after - * creation - */ - @JsonProperty(value = "properties.dataDiskParameters") - private List dataDiskParameters; - - /* - * Virtual Machine schedules to be created - */ - @JsonProperty(value = "properties.scheduleParameters") - private List scheduleParameters; - - /* - * Last known compute power state captured in DTL + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.lastKnownPowerState", access = JsonProperty.Access.WRITE_ONLY) - private String lastKnownPowerState; + private LabVirtualMachinePropertiesInner innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public LabVirtualMachineInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public LabVirtualMachineInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the notes property: The notes of the virtual machine. @@ -248,7 +61,7 @@ public class LabVirtualMachineInner extends Resource { * @return the notes value. */ public String notes() { - return this.notes; + return this.innerProperties() == null ? null : this.innerProperties().notes(); } /** @@ -258,7 +71,10 @@ public String notes() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withNotes(String notes) { - this.notes = notes; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withNotes(notes); return this; } @@ -268,7 +84,7 @@ public LabVirtualMachineInner withNotes(String notes) { * @return the ownerObjectId value. */ public String ownerObjectId() { - return this.ownerObjectId; + return this.innerProperties() == null ? null : this.innerProperties().ownerObjectId(); } /** @@ -278,7 +94,10 @@ public String ownerObjectId() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withOwnerObjectId(String ownerObjectId) { - this.ownerObjectId = ownerObjectId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withOwnerObjectId(ownerObjectId); return this; } @@ -288,7 +107,7 @@ public LabVirtualMachineInner withOwnerObjectId(String ownerObjectId) { * @return the ownerUserPrincipalName value. */ public String ownerUserPrincipalName() { - return this.ownerUserPrincipalName; + return this.innerProperties() == null ? null : this.innerProperties().ownerUserPrincipalName(); } /** @@ -298,7 +117,10 @@ public String ownerUserPrincipalName() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withOwnerUserPrincipalName(String ownerUserPrincipalName) { - this.ownerUserPrincipalName = ownerUserPrincipalName; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withOwnerUserPrincipalName(ownerUserPrincipalName); return this; } @@ -308,7 +130,7 @@ public LabVirtualMachineInner withOwnerUserPrincipalName(String ownerUserPrincip * @return the createdByUserId value. */ public String createdByUserId() { - return this.createdByUserId; + return this.innerProperties() == null ? null : this.innerProperties().createdByUserId(); } /** @@ -317,7 +139,7 @@ public String createdByUserId() { * @return the createdByUser value. */ public String createdByUser() { - return this.createdByUser; + return this.innerProperties() == null ? null : this.innerProperties().createdByUser(); } /** @@ -326,7 +148,7 @@ public String createdByUser() { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -336,7 +158,10 @@ public OffsetDateTime createdDate() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withCreatedDate(OffsetDateTime createdDate) { - this.createdDate = createdDate; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withCreatedDate(createdDate); return this; } @@ -346,7 +171,7 @@ public LabVirtualMachineInner withCreatedDate(OffsetDateTime createdDate) { * @return the computeId value. */ public String computeId() { - return this.computeId; + return this.innerProperties() == null ? null : this.innerProperties().computeId(); } /** @@ -355,7 +180,7 @@ public String computeId() { * @return the customImageId value. */ public String customImageId() { - return this.customImageId; + return this.innerProperties() == null ? null : this.innerProperties().customImageId(); } /** @@ -365,7 +190,10 @@ public String customImageId() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withCustomImageId(String customImageId) { - this.customImageId = customImageId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withCustomImageId(customImageId); return this; } @@ -375,7 +203,7 @@ public LabVirtualMachineInner withCustomImageId(String customImageId) { * @return the osType value. */ public String osType() { - return this.osType; + return this.innerProperties() == null ? null : this.innerProperties().osType(); } /** @@ -384,7 +212,7 @@ public String osType() { * @return the size value. */ public String size() { - return this.size; + return this.innerProperties() == null ? null : this.innerProperties().size(); } /** @@ -394,7 +222,10 @@ public String size() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withSize(String size) { - this.size = size; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withSize(size); return this; } @@ -404,7 +235,7 @@ public LabVirtualMachineInner withSize(String size) { * @return the username value. */ public String username() { - return this.username; + return this.innerProperties() == null ? null : this.innerProperties().username(); } /** @@ -414,7 +245,10 @@ public String username() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withUsername(String username) { - this.username = username; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withUsername(username); return this; } @@ -424,7 +258,7 @@ public LabVirtualMachineInner withUsername(String username) { * @return the password value. */ public String password() { - return this.password; + return this.innerProperties() == null ? null : this.innerProperties().password(); } /** @@ -434,7 +268,10 @@ public String password() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withPassword(String password) { - this.password = password; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withPassword(password); return this; } @@ -444,7 +281,7 @@ public LabVirtualMachineInner withPassword(String password) { * @return the sshKey value. */ public String sshKey() { - return this.sshKey; + return this.innerProperties() == null ? null : this.innerProperties().sshKey(); } /** @@ -454,7 +291,10 @@ public String sshKey() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withSshKey(String sshKey) { - this.sshKey = sshKey; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withSshKey(sshKey); return this; } @@ -465,7 +305,7 @@ public LabVirtualMachineInner withSshKey(String sshKey) { * @return the isAuthenticationWithSshKey value. */ public Boolean isAuthenticationWithSshKey() { - return this.isAuthenticationWithSshKey; + return this.innerProperties() == null ? null : this.innerProperties().isAuthenticationWithSshKey(); } /** @@ -476,7 +316,10 @@ public Boolean isAuthenticationWithSshKey() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withIsAuthenticationWithSshKey(Boolean isAuthenticationWithSshKey) { - this.isAuthenticationWithSshKey = isAuthenticationWithSshKey; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withIsAuthenticationWithSshKey(isAuthenticationWithSshKey); return this; } @@ -486,7 +329,7 @@ public LabVirtualMachineInner withIsAuthenticationWithSshKey(Boolean isAuthentic * @return the fqdn value. */ public String fqdn() { - return this.fqdn; + return this.innerProperties() == null ? null : this.innerProperties().fqdn(); } /** @@ -495,7 +338,7 @@ public String fqdn() { * @return the labSubnetName value. */ public String labSubnetName() { - return this.labSubnetName; + return this.innerProperties() == null ? null : this.innerProperties().labSubnetName(); } /** @@ -505,7 +348,10 @@ public String labSubnetName() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withLabSubnetName(String labSubnetName) { - this.labSubnetName = labSubnetName; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withLabSubnetName(labSubnetName); return this; } @@ -515,7 +361,7 @@ public LabVirtualMachineInner withLabSubnetName(String labSubnetName) { * @return the labVirtualNetworkId value. */ public String labVirtualNetworkId() { - return this.labVirtualNetworkId; + return this.innerProperties() == null ? null : this.innerProperties().labVirtualNetworkId(); } /** @@ -525,7 +371,10 @@ public String labVirtualNetworkId() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withLabVirtualNetworkId(String labVirtualNetworkId) { - this.labVirtualNetworkId = labVirtualNetworkId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withLabVirtualNetworkId(labVirtualNetworkId); return this; } @@ -536,7 +385,7 @@ public LabVirtualMachineInner withLabVirtualNetworkId(String labVirtualNetworkId * @return the disallowPublicIpAddress value. */ public Boolean disallowPublicIpAddress() { - return this.disallowPublicIpAddress; + return this.innerProperties() == null ? null : this.innerProperties().disallowPublicIpAddress(); } /** @@ -547,7 +396,10 @@ public Boolean disallowPublicIpAddress() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withDisallowPublicIpAddress(Boolean disallowPublicIpAddress) { - this.disallowPublicIpAddress = disallowPublicIpAddress; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withDisallowPublicIpAddress(disallowPublicIpAddress); return this; } @@ -557,7 +409,7 @@ public LabVirtualMachineInner withDisallowPublicIpAddress(Boolean disallowPublic * @return the artifacts value. */ public List artifacts() { - return this.artifacts; + return this.innerProperties() == null ? null : this.innerProperties().artifacts(); } /** @@ -567,7 +419,10 @@ public List artifacts() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withArtifacts(List artifacts) { - this.artifacts = artifacts; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withArtifacts(artifacts); return this; } @@ -577,7 +432,7 @@ public LabVirtualMachineInner withArtifacts(List arti * @return the artifactDeploymentStatus value. */ public ArtifactDeploymentStatusProperties artifactDeploymentStatus() { - return this.artifactDeploymentStatus; + return this.innerProperties() == null ? null : this.innerProperties().artifactDeploymentStatus(); } /** @@ -586,7 +441,7 @@ public ArtifactDeploymentStatusProperties artifactDeploymentStatus() { * @return the galleryImageReference value. */ public GalleryImageReference galleryImageReference() { - return this.galleryImageReference; + return this.innerProperties() == null ? null : this.innerProperties().galleryImageReference(); } /** @@ -596,7 +451,10 @@ public GalleryImageReference galleryImageReference() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withGalleryImageReference(GalleryImageReference galleryImageReference) { - this.galleryImageReference = galleryImageReference; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withGalleryImageReference(galleryImageReference); return this; } @@ -606,7 +464,7 @@ public LabVirtualMachineInner withGalleryImageReference(GalleryImageReference ga * @return the planId value. */ public String planId() { - return this.planId; + return this.innerProperties() == null ? null : this.innerProperties().planId(); } /** @@ -616,7 +474,10 @@ public String planId() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withPlanId(String planId) { - this.planId = planId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withPlanId(planId); return this; } @@ -626,7 +487,7 @@ public LabVirtualMachineInner withPlanId(String planId) { * @return the computeVm value. */ public ComputeVmProperties computeVm() { - return this.computeVm; + return this.innerProperties() == null ? null : this.innerProperties().computeVm(); } /** @@ -635,7 +496,7 @@ public ComputeVmProperties computeVm() { * @return the networkInterface value. */ public NetworkInterfaceProperties networkInterface() { - return this.networkInterface; + return this.innerProperties() == null ? null : this.innerProperties().networkInterface(); } /** @@ -645,7 +506,10 @@ public NetworkInterfaceProperties networkInterface() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withNetworkInterface(NetworkInterfaceProperties networkInterface) { - this.networkInterface = networkInterface; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withNetworkInterface(networkInterface); return this; } @@ -655,7 +519,7 @@ public LabVirtualMachineInner withNetworkInterface(NetworkInterfaceProperties ne * @return the applicableSchedule value. */ public ApplicableScheduleInner applicableSchedule() { - return this.applicableSchedule; + return this.innerProperties() == null ? null : this.innerProperties().applicableSchedule(); } /** @@ -664,7 +528,7 @@ public ApplicableScheduleInner applicableSchedule() { * @return the expirationDate value. */ public OffsetDateTime expirationDate() { - return this.expirationDate; + return this.innerProperties() == null ? null : this.innerProperties().expirationDate(); } /** @@ -674,7 +538,10 @@ public OffsetDateTime expirationDate() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withExpirationDate(OffsetDateTime expirationDate) { - this.expirationDate = expirationDate; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withExpirationDate(expirationDate); return this; } @@ -684,7 +551,7 @@ public LabVirtualMachineInner withExpirationDate(OffsetDateTime expirationDate) * @return the allowClaim value. */ public Boolean allowClaim() { - return this.allowClaim; + return this.innerProperties() == null ? null : this.innerProperties().allowClaim(); } /** @@ -694,7 +561,10 @@ public Boolean allowClaim() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withAllowClaim(Boolean allowClaim) { - this.allowClaim = allowClaim; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withAllowClaim(allowClaim); return this; } @@ -704,7 +574,7 @@ public LabVirtualMachineInner withAllowClaim(Boolean allowClaim) { * @return the storageType value. */ public String storageType() { - return this.storageType; + return this.innerProperties() == null ? null : this.innerProperties().storageType(); } /** @@ -714,7 +584,10 @@ public String storageType() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withStorageType(String storageType) { - this.storageType = storageType; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withStorageType(storageType); return this; } @@ -725,7 +598,7 @@ public LabVirtualMachineInner withStorageType(String storageType) { * @return the virtualMachineCreationSource value. */ public VirtualMachineCreationSource virtualMachineCreationSource() { - return this.virtualMachineCreationSource; + return this.innerProperties() == null ? null : this.innerProperties().virtualMachineCreationSource(); } /** @@ -734,7 +607,7 @@ public VirtualMachineCreationSource virtualMachineCreationSource() { * @return the environmentId value. */ public String environmentId() { - return this.environmentId; + return this.innerProperties() == null ? null : this.innerProperties().environmentId(); } /** @@ -744,7 +617,10 @@ public String environmentId() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withEnvironmentId(String environmentId) { - this.environmentId = environmentId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withEnvironmentId(environmentId); return this; } @@ -754,7 +630,7 @@ public LabVirtualMachineInner withEnvironmentId(String environmentId) { * @return the dataDiskParameters value. */ public List dataDiskParameters() { - return this.dataDiskParameters; + return this.innerProperties() == null ? null : this.innerProperties().dataDiskParameters(); } /** @@ -764,7 +640,10 @@ public List dataDiskParameters() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withDataDiskParameters(List dataDiskParameters) { - this.dataDiskParameters = dataDiskParameters; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withDataDiskParameters(dataDiskParameters); return this; } @@ -774,7 +653,7 @@ public LabVirtualMachineInner withDataDiskParameters(List da * @return the scheduleParameters value. */ public List scheduleParameters() { - return this.scheduleParameters; + return this.innerProperties() == null ? null : this.innerProperties().scheduleParameters(); } /** @@ -784,7 +663,10 @@ public List scheduleParameters() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withScheduleParameters(List scheduleParameters) { - this.scheduleParameters = scheduleParameters; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withScheduleParameters(scheduleParameters); return this; } @@ -794,7 +676,7 @@ public LabVirtualMachineInner withScheduleParameters(List tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -835,29 +703,13 @@ public LabVirtualMachineInner withTags(Map tags) { * @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()); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model LabVirtualMachineInner")); + } else { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..999465cc4b46 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachinePropertiesInner.java @@ -0,0 +1,845 @@ +// 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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ArtifactDeploymentStatusProperties; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmProperties; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; +import com.azure.resourcemanager.devtestlabs.models.NetworkInterfaceProperties; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of a virtual machine. */ +@Fluent +public final class LabVirtualMachinePropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabVirtualMachinePropertiesInner.class); + + /* + * The notes of the virtual machine. + */ + @JsonProperty(value = "notes") + private String notes; + + /* + * The object identifier of the owner of the virtual machine. + */ + @JsonProperty(value = "ownerObjectId") + private String ownerObjectId; + + /* + * The user principal name of the virtual machine owner. + */ + @JsonProperty(value = "ownerUserPrincipalName") + private String ownerUserPrincipalName; + + /* + * The object identifier of the creator of the virtual machine. + */ + @JsonProperty(value = "createdByUserId", access = JsonProperty.Access.WRITE_ONLY) + private String createdByUserId; + + /* + * The email address of creator of the virtual machine. + */ + @JsonProperty(value = "createdByUser", access = JsonProperty.Access.WRITE_ONLY) + private String createdByUser; + + /* + * The creation date of the virtual machine. + */ + @JsonProperty(value = "createdDate") + private OffsetDateTime createdDate; + + /* + * The resource identifier (Microsoft.Compute) of the virtual machine. + */ + @JsonProperty(value = "computeId", access = JsonProperty.Access.WRITE_ONLY) + private String computeId; + + /* + * The custom image identifier of the virtual machine. + */ + @JsonProperty(value = "customImageId") + private String customImageId; + + /* + * The OS type of the virtual machine. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private String osType; + + /* + * The size of the virtual machine. + */ + @JsonProperty(value = "size") + private String size; + + /* + * The user name of the virtual machine. + */ + @JsonProperty(value = "userName") + private String username; + + /* + * The password of the virtual machine administrator. + */ + @JsonProperty(value = "password") + private String password; + + /* + * The SSH key of the virtual machine administrator. + */ + @JsonProperty(value = "sshKey") + private String sshKey; + + /* + * Indicates whether this virtual machine uses an SSH key for + * authentication. + */ + @JsonProperty(value = "isAuthenticationWithSshKey") + private Boolean isAuthenticationWithSshKey; + + /* + * The fully-qualified domain name of the virtual machine. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * The lab subnet name of the virtual machine. + */ + @JsonProperty(value = "labSubnetName") + private String labSubnetName; + + /* + * The lab virtual network identifier of the virtual machine. + */ + @JsonProperty(value = "labVirtualNetworkId") + private String labVirtualNetworkId; + + /* + * Indicates whether the virtual machine is to be created without a public + * IP address. + */ + @JsonProperty(value = "disallowPublicIpAddress") + private Boolean disallowPublicIpAddress; + + /* + * The artifacts to be installed on the virtual machine. + */ + @JsonProperty(value = "artifacts") + private List artifacts; + + /* + * The artifact deployment status for the virtual machine. + */ + @JsonProperty(value = "artifactDeploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private ArtifactDeploymentStatusProperties artifactDeploymentStatus; + + /* + * The Microsoft Azure Marketplace image reference of the virtual machine. + */ + @JsonProperty(value = "galleryImageReference") + private GalleryImageReference galleryImageReference; + + /* + * The id of the plan associated with the virtual machine image + */ + @JsonProperty(value = "planId") + private String planId; + + /* + * The compute virtual machine properties. + */ + @JsonProperty(value = "computeVm", access = JsonProperty.Access.WRITE_ONLY) + private ComputeVmProperties computeVm; + + /* + * The network interface properties. + */ + @JsonProperty(value = "networkInterface") + private NetworkInterfaceProperties networkInterface; + + /* + * The applicable schedule for the virtual machine. + */ + @JsonProperty(value = "applicableSchedule", access = JsonProperty.Access.WRITE_ONLY) + private ApplicableScheduleInner applicableSchedule; + + /* + * The expiration date for VM. + */ + @JsonProperty(value = "expirationDate") + private OffsetDateTime expirationDate; + + /* + * Indicates whether another user can take ownership of the virtual machine + */ + @JsonProperty(value = "allowClaim") + private Boolean allowClaim; + + /* + * Storage type to use for virtual machine (i.e. Standard, Premium). + */ + @JsonProperty(value = "storageType") + private String storageType; + + /* + * Tells source of creation of lab virtual machine. Output property only. + */ + @JsonProperty(value = "virtualMachineCreationSource", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineCreationSource virtualMachineCreationSource; + + /* + * The resource ID of the environment that contains this virtual machine, + * if any. + */ + @JsonProperty(value = "environmentId") + private String environmentId; + + /* + * New or existing data disks to attach to the virtual machine after + * creation + */ + @JsonProperty(value = "dataDiskParameters") + private List dataDiskParameters; + + /* + * Virtual Machine schedules to be created + */ + @JsonProperty(value = "scheduleParameters") + private List scheduleParameters; + + /* + * Last known compute power state captured in DTL + */ + @JsonProperty(value = "lastKnownPowerState", access = JsonProperty.Access.WRITE_ONLY) + private String lastKnownPowerState; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: The notes of the virtual machine. + * + * @param notes the notes value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Get the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + public String ownerObjectId() { + return this.ownerObjectId; + } + + /** + * Set the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @param ownerObjectId the ownerObjectId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withOwnerObjectId(String ownerObjectId) { + this.ownerObjectId = ownerObjectId; + return this; + } + + /** + * Get the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @return the ownerUserPrincipalName value. + */ + public String ownerUserPrincipalName() { + return this.ownerUserPrincipalName; + } + + /** + * Set the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @param ownerUserPrincipalName the ownerUserPrincipalName value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withOwnerUserPrincipalName(String ownerUserPrincipalName) { + this.ownerUserPrincipalName = ownerUserPrincipalName; + return this; + } + + /** + * Get the createdByUserId property: The object identifier of the creator of the virtual machine. + * + * @return the createdByUserId value. + */ + public String createdByUserId() { + return this.createdByUserId; + } + + /** + * Get the createdByUser property: The email address of creator of the virtual machine. + * + * @return the createdByUser value. + */ + public String createdByUser() { + return this.createdByUser; + } + + /** + * Get the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: The creation date of the virtual machine. + * + * @param createdDate the createdDate value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the computeId property: The resource identifier (Microsoft.Compute) of the virtual machine. + * + * @return the computeId value. + */ + public String computeId() { + return this.computeId; + } + + /** + * Get the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. + */ + public String customImageId() { + return this.customImageId; + } + + /** + * Set the customImageId property: The custom image identifier of the virtual machine. + * + * @param customImageId the customImageId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withCustomImageId(String customImageId) { + this.customImageId = customImageId; + return this; + } + + /** + * Get the osType property: The OS type of the virtual machine. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the size property: The size of the virtual machine. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The size of the virtual machine. + * + * @param size the size value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the username property: The user name of the virtual machine. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The user name of the virtual machine. + * + * @param username the username value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password of the virtual machine administrator. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password of the virtual machine administrator. + * + * @param password the password value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. + */ + public String sshKey() { + return this.sshKey; + } + + /** + * Set the sshKey property: The SSH key of the virtual machine administrator. + * + * @param sshKey the sshKey value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withSshKey(String sshKey) { + this.sshKey = sshKey; + return this; + } + + /** + * Get the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @return the isAuthenticationWithSshKey value. + */ + public Boolean isAuthenticationWithSshKey() { + return this.isAuthenticationWithSshKey; + } + + /** + * Set the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @param isAuthenticationWithSshKey the isAuthenticationWithSshKey value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withIsAuthenticationWithSshKey(Boolean isAuthenticationWithSshKey) { + this.isAuthenticationWithSshKey = isAuthenticationWithSshKey; + return this; + } + + /** + * Get the fqdn property: The fully-qualified domain name of the virtual machine. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. + */ + public String labSubnetName() { + return this.labSubnetName; + } + + /** + * Set the labSubnetName property: The lab subnet name of the virtual machine. + * + * @param labSubnetName the labSubnetName value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withLabSubnetName(String labSubnetName) { + this.labSubnetName = labSubnetName; + return this; + } + + /** + * Get the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. + */ + public String labVirtualNetworkId() { + return this.labVirtualNetworkId; + } + + /** + * Set the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @param labVirtualNetworkId the labVirtualNetworkId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withLabVirtualNetworkId(String labVirtualNetworkId) { + this.labVirtualNetworkId = labVirtualNetworkId; + return this; + } + + /** + * Get the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @return the disallowPublicIpAddress value. + */ + public Boolean disallowPublicIpAddress() { + return this.disallowPublicIpAddress; + } + + /** + * Set the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @param disallowPublicIpAddress the disallowPublicIpAddress value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withDisallowPublicIpAddress(Boolean disallowPublicIpAddress) { + this.disallowPublicIpAddress = disallowPublicIpAddress; + return this; + } + + /** + * Get the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.artifacts; + } + + /** + * Set the artifacts property: The artifacts to be installed on the virtual machine. + * + * @param artifacts the artifacts value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withArtifacts(List artifacts) { + this.artifacts = artifacts; + return this; + } + + /** + * Get the artifactDeploymentStatus property: The artifact deployment status for the virtual machine. + * + * @return the artifactDeploymentStatus value. + */ + public ArtifactDeploymentStatusProperties artifactDeploymentStatus() { + return this.artifactDeploymentStatus; + } + + /** + * Get the galleryImageReference property: The Microsoft Azure Marketplace image reference of the virtual machine. + * + * @return the galleryImageReference value. + */ + public GalleryImageReference galleryImageReference() { + return this.galleryImageReference; + } + + /** + * Set the galleryImageReference property: The Microsoft Azure Marketplace image reference of the virtual machine. + * + * @param galleryImageReference the galleryImageReference value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withGalleryImageReference(GalleryImageReference galleryImageReference) { + this.galleryImageReference = galleryImageReference; + return this; + } + + /** + * Get the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Set the planId property: The id of the plan associated with the virtual machine image. + * + * @param planId the planId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withPlanId(String planId) { + this.planId = planId; + return this; + } + + /** + * Get the computeVm property: The compute virtual machine properties. + * + * @return the computeVm value. + */ + public ComputeVmProperties computeVm() { + return this.computeVm; + } + + /** + * Get the networkInterface property: The network interface properties. + * + * @return the networkInterface value. + */ + public NetworkInterfaceProperties networkInterface() { + return this.networkInterface; + } + + /** + * Set the networkInterface property: The network interface properties. + * + * @param networkInterface the networkInterface value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withNetworkInterface(NetworkInterfaceProperties networkInterface) { + this.networkInterface = networkInterface; + return this; + } + + /** + * Get the applicableSchedule property: The applicable schedule for the virtual machine. + * + * @return the applicableSchedule value. + */ + public ApplicableScheduleInner applicableSchedule() { + return this.applicableSchedule; + } + + /** + * Get the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.expirationDate; + } + + /** + * Set the expirationDate property: The expiration date for VM. + * + * @param expirationDate the expirationDate value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withExpirationDate(OffsetDateTime expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. + */ + public Boolean allowClaim() { + return this.allowClaim; + } + + /** + * Set the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @param allowClaim the allowClaim value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withAllowClaim(Boolean allowClaim) { + this.allowClaim = allowClaim; + return this; + } + + /** + * Get the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium). + * + * @return the storageType value. + */ + public String storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium). + * + * @param storageType the storageType value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withStorageType(String storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property + * only. + * + * @return the virtualMachineCreationSource value. + */ + public VirtualMachineCreationSource virtualMachineCreationSource() { + return this.virtualMachineCreationSource; + } + + /** + * Get the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @param environmentId the environmentId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. + */ + public List dataDiskParameters() { + return this.dataDiskParameters; + } + + /** + * Set the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @param dataDiskParameters the dataDiskParameters value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withDataDiskParameters(List dataDiskParameters) { + this.dataDiskParameters = dataDiskParameters; + return this; + } + + /** + * Get the scheduleParameters property: Virtual Machine schedules to be created. + * + * @return the scheduleParameters value. + */ + public List scheduleParameters() { + return this.scheduleParameters; + } + + /** + * Set the scheduleParameters property: Virtual Machine schedules to be created. + * + * @param scheduleParameters the scheduleParameters value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withScheduleParameters(List scheduleParameters) { + this.scheduleParameters = scheduleParameters; + return this; + } + + /** + * Get the lastKnownPowerState property: Last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value. + */ + public String lastKnownPowerState() { + return this.lastKnownPowerState; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + 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()); + } + } +} 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 a58c1b1518d5..6f0fbf2e7cd9 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.Event; @@ -16,60 +15,38 @@ import java.util.Map; /** A notification. */ -@JsonFlatten @Fluent -public class NotificationChannelInner extends Resource { +public final class NotificationChannelInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationChannelInner.class); /* - * The webhook URL to send notifications to. + * The properties of the resource. */ - @JsonProperty(value = "properties.webHookUrl") - private String webhookUrl; + @JsonProperty(value = "properties", required = true) + private NotificationChannelProperties innerProperties = new NotificationChannelProperties(); - /* - * The email recipient to send notifications to (can be a list of - * semi-colon separated email addresses). - */ - @JsonProperty(value = "properties.emailRecipient") - private String emailRecipient; - - /* - * The locale to use when sending a notification (fallback for unsupported - * languages is EN). - */ - @JsonProperty(value = "properties.notificationLocale") - private String notificationLocale; - - /* - * Description of notification. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * The list of event for which this notification is enabled. - */ - @JsonProperty(value = "properties.events") - private List events; - - /* - * The creation date of the notification channel. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + private NotificationChannelProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public NotificationChannelInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public NotificationChannelInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the webhookUrl property: The webhook URL to send notifications to. @@ -77,7 +54,7 @@ public class NotificationChannelInner extends Resource { * @return the webhookUrl value. */ public String webhookUrl() { - return this.webhookUrl; + return this.innerProperties() == null ? null : this.innerProperties().webhookUrl(); } /** @@ -87,7 +64,10 @@ public String webhookUrl() { * @return the NotificationChannelInner object itself. */ public NotificationChannelInner withWebhookUrl(String webhookUrl) { - this.webhookUrl = webhookUrl; + if (this.innerProperties() == null) { + this.innerProperties = new NotificationChannelProperties(); + } + this.innerProperties().withWebhookUrl(webhookUrl); return this; } @@ -98,7 +78,7 @@ public NotificationChannelInner withWebhookUrl(String webhookUrl) { * @return the emailRecipient value. */ public String emailRecipient() { - return this.emailRecipient; + return this.innerProperties() == null ? null : this.innerProperties().emailRecipient(); } /** @@ -109,7 +89,10 @@ public String emailRecipient() { * @return the NotificationChannelInner object itself. */ public NotificationChannelInner withEmailRecipient(String emailRecipient) { - this.emailRecipient = emailRecipient; + if (this.innerProperties() == null) { + this.innerProperties = new NotificationChannelProperties(); + } + this.innerProperties().withEmailRecipient(emailRecipient); return this; } @@ -120,7 +103,7 @@ public NotificationChannelInner withEmailRecipient(String emailRecipient) { * @return the notificationLocale value. */ public String notificationLocale() { - return this.notificationLocale; + return this.innerProperties() == null ? null : this.innerProperties().notificationLocale(); } /** @@ -131,7 +114,10 @@ public String notificationLocale() { * @return the NotificationChannelInner object itself. */ public NotificationChannelInner withNotificationLocale(String notificationLocale) { - this.notificationLocale = notificationLocale; + if (this.innerProperties() == null) { + this.innerProperties = new NotificationChannelProperties(); + } + this.innerProperties().withNotificationLocale(notificationLocale); return this; } @@ -141,7 +127,7 @@ public NotificationChannelInner withNotificationLocale(String notificationLocale * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -151,7 +137,10 @@ public String description() { * @return the NotificationChannelInner object itself. */ public NotificationChannelInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new NotificationChannelProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -161,7 +150,7 @@ public NotificationChannelInner withDescription(String description) { * @return the events value. */ public List events() { - return this.events; + return this.innerProperties() == null ? null : this.innerProperties().events(); } /** @@ -171,7 +160,10 @@ public List events() { * @return the NotificationChannelInner object itself. */ public NotificationChannelInner withEvents(List events) { - this.events = events; + if (this.innerProperties() == null) { + this.innerProperties = new NotificationChannelProperties(); + } + this.innerProperties().withEvents(events); return this; } @@ -181,7 +173,7 @@ public NotificationChannelInner withEvents(List events) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -190,7 +182,7 @@ public OffsetDateTime createdDate() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -199,21 +191,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public NotificationChannelInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public NotificationChannelInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -222,8 +200,13 @@ public NotificationChannelInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (events() != null) { - events().forEach(e -> e.validate()); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model NotificationChannelInner")); + } else { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..5153fd6f21e7 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelProperties.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.Event; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of a schedule. */ +@Fluent +public final class NotificationChannelProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationChannelProperties.class); + + /* + * The webhook URL to send notifications to. + */ + @JsonProperty(value = "webHookUrl") + private String webhookUrl; + + /* + * The email recipient to send notifications to (can be a list of + * semi-colon separated email addresses). + */ + @JsonProperty(value = "emailRecipient") + private String emailRecipient; + + /* + * The locale to use when sending a notification (fallback for unsupported + * languages is EN). + */ + @JsonProperty(value = "notificationLocale") + private String notificationLocale; + + /* + * Description of notification. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The list of event for which this notification is enabled. + */ + @JsonProperty(value = "events") + private List events; + + /* + * The creation date of the notification channel. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the webhookUrl property: The webhook URL to send notifications to. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.webhookUrl; + } + + /** + * Set the webhookUrl property: The webhook URL to send notifications to. + * + * @param webhookUrl the webhookUrl value to set. + * @return the NotificationChannelProperties object itself. + */ + public NotificationChannelProperties withWebhookUrl(String webhookUrl) { + this.webhookUrl = webhookUrl; + return this; + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.emailRecipient; + } + + /** + * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @param emailRecipient the emailRecipient value to set. + * @return the NotificationChannelProperties object itself. + */ + public NotificationChannelProperties withEmailRecipient(String emailRecipient) { + this.emailRecipient = emailRecipient; + return this; + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.notificationLocale; + } + + /** + * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @param notificationLocale the notificationLocale value to set. + * @return the NotificationChannelProperties object itself. + */ + public NotificationChannelProperties withNotificationLocale(String notificationLocale) { + this.notificationLocale = notificationLocale; + return this; + } + + /** + * Get the description property: Description of notification. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of notification. + * + * @param description the description value to set. + * @return the NotificationChannelProperties object itself. + */ + public NotificationChannelProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the events property: The list of event for which this notification is enabled. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Set the events property: The list of event for which this notification is enabled. + * + * @param events the events value to set. + * @return the NotificationChannelProperties object itself. + */ + public NotificationChannelProperties withEvents(List events) { + this.events = events; + return this; + } + + /** + * Get the createdDate property: The creation date of the notification channel. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + 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()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyInner.java index c8ede6a5a05e..37ac97a573ae 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.PolicyEvaluatorType; @@ -17,67 +16,38 @@ import java.util.Map; /** A Policy. */ -@JsonFlatten @Fluent -public class PolicyInner extends Resource { +public final class PolicyInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyInner.class); /* - * The description of the policy. + * The properties of the resource. */ - @JsonProperty(value = "properties.description") - private String description; + @JsonProperty(value = "properties", required = true) + private PolicyProperties innerProperties = new PolicyProperties(); - /* - * The status of the policy. - */ - @JsonProperty(value = "properties.status") - private PolicyStatus status; - - /* - * The fact name of the policy (e.g. LabVmCount, LabVmSize, - * MaxVmsAllowedPerLab, etc. - */ - @JsonProperty(value = "properties.factName") - private PolicyFactName factName; - - /* - * The fact data of the policy. - */ - @JsonProperty(value = "properties.factData") - private String factData; - - /* - * The threshold of the policy (i.e. a number for MaxValuePolicy, and a - * JSON array of values for AllowedValuesPolicy). - */ - @JsonProperty(value = "properties.threshold") - private String threshold; - - /* - * The evaluator type of the policy (i.e. AllowedValuesPolicy, - * MaxValuePolicy). - */ - @JsonProperty(value = "properties.evaluatorType") - private PolicyEvaluatorType evaluatorType; - - /* - * The creation date of the policy. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + private PolicyProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public PolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public PolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the description property: The description of the policy. @@ -85,7 +55,7 @@ public class PolicyInner extends Resource { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -95,7 +65,10 @@ public String description() { * @return the PolicyInner object itself. */ public PolicyInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new PolicyProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -105,7 +78,7 @@ public PolicyInner withDescription(String description) { * @return the status value. */ public PolicyStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -115,7 +88,10 @@ public PolicyStatus status() { * @return the PolicyInner object itself. */ public PolicyInner withStatus(PolicyStatus status) { - this.status = status; + if (this.innerProperties() == null) { + this.innerProperties = new PolicyProperties(); + } + this.innerProperties().withStatus(status); return this; } @@ -125,7 +101,7 @@ public PolicyInner withStatus(PolicyStatus status) { * @return the factName value. */ public PolicyFactName factName() { - return this.factName; + return this.innerProperties() == null ? null : this.innerProperties().factName(); } /** @@ -135,7 +111,10 @@ public PolicyFactName factName() { * @return the PolicyInner object itself. */ public PolicyInner withFactName(PolicyFactName factName) { - this.factName = factName; + if (this.innerProperties() == null) { + this.innerProperties = new PolicyProperties(); + } + this.innerProperties().withFactName(factName); return this; } @@ -145,7 +124,7 @@ public PolicyInner withFactName(PolicyFactName factName) { * @return the factData value. */ public String factData() { - return this.factData; + return this.innerProperties() == null ? null : this.innerProperties().factData(); } /** @@ -155,7 +134,10 @@ public String factData() { * @return the PolicyInner object itself. */ public PolicyInner withFactData(String factData) { - this.factData = factData; + if (this.innerProperties() == null) { + this.innerProperties = new PolicyProperties(); + } + this.innerProperties().withFactData(factData); return this; } @@ -166,7 +148,7 @@ public PolicyInner withFactData(String factData) { * @return the threshold value. */ public String threshold() { - return this.threshold; + return this.innerProperties() == null ? null : this.innerProperties().threshold(); } /** @@ -177,7 +159,10 @@ public String threshold() { * @return the PolicyInner object itself. */ public PolicyInner withThreshold(String threshold) { - this.threshold = threshold; + if (this.innerProperties() == null) { + this.innerProperties = new PolicyProperties(); + } + this.innerProperties().withThreshold(threshold); return this; } @@ -187,7 +172,7 @@ public PolicyInner withThreshold(String threshold) { * @return the evaluatorType value. */ public PolicyEvaluatorType evaluatorType() { - return this.evaluatorType; + return this.innerProperties() == null ? null : this.innerProperties().evaluatorType(); } /** @@ -197,7 +182,10 @@ public PolicyEvaluatorType evaluatorType() { * @return the PolicyInner object itself. */ public PolicyInner withEvaluatorType(PolicyEvaluatorType evaluatorType) { - this.evaluatorType = evaluatorType; + if (this.innerProperties() == null) { + this.innerProperties = new PolicyProperties(); + } + this.innerProperties().withEvaluatorType(evaluatorType); return this; } @@ -207,7 +195,7 @@ public PolicyInner withEvaluatorType(PolicyEvaluatorType evaluatorType) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -216,7 +204,7 @@ public OffsetDateTime createdDate() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -225,21 +213,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public PolicyInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public PolicyInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -248,5 +222,12 @@ public PolicyInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model PolicyInner")); + } else { + innerProperties().validate(); + } } } 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 new file mode 100644 index 000000000000..ed324f712920 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyProperties.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.PolicyEvaluatorType; +import com.azure.resourcemanager.devtestlabs.models.PolicyFactName; +import com.azure.resourcemanager.devtestlabs.models.PolicyStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of a Policy. */ +@Fluent +public final class PolicyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyProperties.class); + + /* + * The description of the policy. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The status of the policy. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /* + * The fact name of the policy (e.g. LabVmCount, LabVmSize, + * MaxVmsAllowedPerLab, etc. + */ + @JsonProperty(value = "factName") + private PolicyFactName factName; + + /* + * The fact data of the policy. + */ + @JsonProperty(value = "factData") + private String factData; + + /* + * The threshold of the policy (i.e. a number for MaxValuePolicy, and a + * JSON array of values for AllowedValuesPolicy). + */ + @JsonProperty(value = "threshold") + private String threshold; + + /* + * The evaluator type of the policy (i.e. AllowedValuesPolicy, + * MaxValuePolicy). + */ + @JsonProperty(value = "evaluatorType") + private PolicyEvaluatorType evaluatorType; + + /* + * The creation date of the policy. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the description property: The description of the policy. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the policy. + * + * @param description the description value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: The status of the policy. + * + * @return the status value. + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the policy. + * + * @param status the status value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withStatus(PolicyStatus status) { + this.status = status; + return this; + } + + /** + * Get the factName property: The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc. + * + * @return the factName value. + */ + public PolicyFactName factName() { + return this.factName; + } + + /** + * Set the factName property: The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc. + * + * @param factName the factName value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withFactName(PolicyFactName factName) { + this.factName = factName; + return this; + } + + /** + * Get the factData property: The fact data of the policy. + * + * @return the factData value. + */ + public String factData() { + return this.factData; + } + + /** + * Set the factData property: The fact data of the policy. + * + * @param factData the factData value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withFactData(String factData) { + this.factData = factData; + return this; + } + + /** + * Get the threshold property: The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of + * values for AllowedValuesPolicy). + * + * @return the threshold value. + */ + public String threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of + * values for AllowedValuesPolicy). + * + * @param threshold the threshold value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withThreshold(String threshold) { + this.threshold = threshold; + return this; + } + + /** + * Get the evaluatorType property: The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy). + * + * @return the evaluatorType value. + */ + public PolicyEvaluatorType evaluatorType() { + return this.evaluatorType; + } + + /** + * Set the evaluatorType property: The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy). + * + * @param evaluatorType the evaluatorType value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withEvaluatorType(PolicyEvaluatorType evaluatorType) { + this.evaluatorType = evaluatorType; + return this; + } + + /** + * Get the createdDate property: The creation date of the policy. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleCreationParameterProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleCreationParameterProperties.java new file mode 100644 index 000000000000..909f4ec597d7 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleCreationParameterProperties.java @@ -0,0 +1,258 @@ +// 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.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties for schedule creation. */ +@Fluent +public final class ScheduleCreationParameterProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleCreationParameterProperties.class); + + /* + * The status of the schedule (i.e. Enabled, Disabled) + */ + @JsonProperty(value = "status") + private EnableStatus status; + + /* + * The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + */ + @JsonProperty(value = "taskType") + private String taskType; + + /* + * If the schedule will occur only some days of the week, specify the + * weekly recurrence. + */ + @JsonProperty(value = "weeklyRecurrence") + private WeekDetails weeklyRecurrence; + + /* + * If the schedule will occur once each day of the week, specify the daily + * recurrence. + */ + @JsonProperty(value = "dailyRecurrence") + private DayDetails dailyRecurrence; + + /* + * If the schedule will occur multiple times a day, specify the hourly + * recurrence. + */ + @JsonProperty(value = "hourlyRecurrence") + private HourDetails hourlyRecurrence; + + /* + * The time zone ID (e.g. Pacific Standard time). + */ + @JsonProperty(value = "timeZoneId") + private String timeZoneId; + + /* + * Notification settings. + */ + @JsonProperty(value = "notificationSettings") + private NotificationSettings notificationSettings; + + /* + * The resource ID to which the schedule belongs + */ + @JsonProperty(value = "targetResourceId") + private String targetResourceId; + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @param status the status value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withStatus(EnableStatus status) { + this.status = status; + return this; + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.taskType; + } + + /** + * Set the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @param taskType the taskType value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withTaskType(String taskType) { + this.taskType = taskType; + return this; + } + + /** + * Get the weeklyRecurrence property: If the schedule will occur only some days of the week, specify the weekly + * recurrence. + * + * @return the weeklyRecurrence value. + */ + public WeekDetails weeklyRecurrence() { + return this.weeklyRecurrence; + } + + /** + * Set the weeklyRecurrence property: If the schedule will occur only some days of the week, specify the weekly + * recurrence. + * + * @param weeklyRecurrence the weeklyRecurrence value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withWeeklyRecurrence(WeekDetails weeklyRecurrence) { + this.weeklyRecurrence = weeklyRecurrence; + return this; + } + + /** + * Get the dailyRecurrence property: If the schedule will occur once each day of the week, specify the daily + * recurrence. + * + * @return the dailyRecurrence value. + */ + public DayDetails dailyRecurrence() { + return this.dailyRecurrence; + } + + /** + * Set the dailyRecurrence property: If the schedule will occur once each day of the week, specify the daily + * recurrence. + * + * @param dailyRecurrence the dailyRecurrence value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withDailyRecurrence(DayDetails dailyRecurrence) { + this.dailyRecurrence = dailyRecurrence; + return this; + } + + /** + * Get the hourlyRecurrence property: If the schedule will occur multiple times a day, specify the hourly + * recurrence. + * + * @return the hourlyRecurrence value. + */ + public HourDetails hourlyRecurrence() { + return this.hourlyRecurrence; + } + + /** + * Set the hourlyRecurrence property: If the schedule will occur multiple times a day, specify the hourly + * recurrence. + * + * @param hourlyRecurrence the hourlyRecurrence value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withHourlyRecurrence(HourDetails hourlyRecurrence) { + this.hourlyRecurrence = hourlyRecurrence; + return this; + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.timeZoneId; + } + + /** + * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @param timeZoneId the timeZoneId value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withTimeZoneId(String timeZoneId) { + this.timeZoneId = timeZoneId; + return this; + } + + /** + * Get the notificationSettings property: Notification settings. + * + * @return the notificationSettings value. + */ + public NotificationSettings notificationSettings() { + return this.notificationSettings; + } + + /** + * Set the notificationSettings property: Notification settings. + * + * @param notificationSettings the notificationSettings value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withNotificationSettings(NotificationSettings notificationSettings) { + this.notificationSettings = notificationSettings; + return this; + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The resource ID to which the schedule belongs. + * + * @param targetResourceId the targetResourceId value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * 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(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleInner.java index 21f71b94a9d1..76531fc06a7e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.DayDetails; @@ -19,79 +18,38 @@ import java.util.Map; /** A schedule. */ -@JsonFlatten @Fluent -public class ScheduleInner extends Resource { +public final class ScheduleInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleInner.class); /* - * The status of the schedule (i.e. Enabled, Disabled) + * The properties of the resource. */ - @JsonProperty(value = "properties.status") - private EnableStatus status; + @JsonProperty(value = "properties", required = true) + private ScheduleProperties innerProperties = new ScheduleProperties(); - /* - * The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). - */ - @JsonProperty(value = "properties.taskType") - private String taskType; - - /* - * If the schedule will occur only some days of the week, specify the - * weekly recurrence. - */ - @JsonProperty(value = "properties.weeklyRecurrence") - private WeekDetails weeklyRecurrence; - - /* - * If the schedule will occur once each day of the week, specify the daily - * recurrence. - */ - @JsonProperty(value = "properties.dailyRecurrence") - private DayDetails dailyRecurrence; - - /* - * If the schedule will occur multiple times a day, specify the hourly - * recurrence. - */ - @JsonProperty(value = "properties.hourlyRecurrence") - private HourDetails hourlyRecurrence; - - /* - * The time zone ID (e.g. Pacific Standard time). - */ - @JsonProperty(value = "properties.timeZoneId") - private String timeZoneId; - - /* - * Notification settings. - */ - @JsonProperty(value = "properties.notificationSettings") - private NotificationSettings notificationSettings; - - /* - * The creation date of the schedule. - */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; - - /* - * The resource ID to which the schedule belongs + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.targetResourceId") - private String targetResourceId; + private ScheduleProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public ScheduleInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@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). @@ -99,7 +57,7 @@ public class ScheduleInner extends Resource { * @return the status value. */ public EnableStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -109,7 +67,10 @@ public EnableStatus status() { * @return the ScheduleInner object itself. */ public ScheduleInner withStatus(EnableStatus status) { - this.status = status; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withStatus(status); return this; } @@ -119,7 +80,7 @@ public ScheduleInner withStatus(EnableStatus status) { * @return the taskType value. */ public String taskType() { - return this.taskType; + return this.innerProperties() == null ? null : this.innerProperties().taskType(); } /** @@ -129,7 +90,10 @@ public String taskType() { * @return the ScheduleInner object itself. */ public ScheduleInner withTaskType(String taskType) { - this.taskType = taskType; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withTaskType(taskType); return this; } @@ -140,7 +104,7 @@ public ScheduleInner withTaskType(String taskType) { * @return the weeklyRecurrence value. */ public WeekDetails weeklyRecurrence() { - return this.weeklyRecurrence; + return this.innerProperties() == null ? null : this.innerProperties().weeklyRecurrence(); } /** @@ -151,7 +115,10 @@ public WeekDetails weeklyRecurrence() { * @return the ScheduleInner object itself. */ public ScheduleInner withWeeklyRecurrence(WeekDetails weeklyRecurrence) { - this.weeklyRecurrence = weeklyRecurrence; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withWeeklyRecurrence(weeklyRecurrence); return this; } @@ -162,7 +129,7 @@ public ScheduleInner withWeeklyRecurrence(WeekDetails weeklyRecurrence) { * @return the dailyRecurrence value. */ public DayDetails dailyRecurrence() { - return this.dailyRecurrence; + return this.innerProperties() == null ? null : this.innerProperties().dailyRecurrence(); } /** @@ -173,7 +140,10 @@ public DayDetails dailyRecurrence() { * @return the ScheduleInner object itself. */ public ScheduleInner withDailyRecurrence(DayDetails dailyRecurrence) { - this.dailyRecurrence = dailyRecurrence; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withDailyRecurrence(dailyRecurrence); return this; } @@ -184,7 +154,7 @@ public ScheduleInner withDailyRecurrence(DayDetails dailyRecurrence) { * @return the hourlyRecurrence value. */ public HourDetails hourlyRecurrence() { - return this.hourlyRecurrence; + return this.innerProperties() == null ? null : this.innerProperties().hourlyRecurrence(); } /** @@ -195,7 +165,10 @@ public HourDetails hourlyRecurrence() { * @return the ScheduleInner object itself. */ public ScheduleInner withHourlyRecurrence(HourDetails hourlyRecurrence) { - this.hourlyRecurrence = hourlyRecurrence; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withHourlyRecurrence(hourlyRecurrence); return this; } @@ -205,7 +178,7 @@ public ScheduleInner withHourlyRecurrence(HourDetails hourlyRecurrence) { * @return the timeZoneId value. */ public String timeZoneId() { - return this.timeZoneId; + return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); } /** @@ -215,7 +188,10 @@ public String timeZoneId() { * @return the ScheduleInner object itself. */ public ScheduleInner withTimeZoneId(String timeZoneId) { - this.timeZoneId = timeZoneId; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withTimeZoneId(timeZoneId); return this; } @@ -225,7 +201,7 @@ public ScheduleInner withTimeZoneId(String timeZoneId) { * @return the notificationSettings value. */ public NotificationSettings notificationSettings() { - return this.notificationSettings; + return this.innerProperties() == null ? null : this.innerProperties().notificationSettings(); } /** @@ -235,7 +211,10 @@ public NotificationSettings notificationSettings() { * @return the ScheduleInner object itself. */ public ScheduleInner withNotificationSettings(NotificationSettings notificationSettings) { - this.notificationSettings = notificationSettings; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withNotificationSettings(notificationSettings); return this; } @@ -245,7 +224,7 @@ public ScheduleInner withNotificationSettings(NotificationSettings notificationS * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -254,7 +233,7 @@ public OffsetDateTime createdDate() { * @return the targetResourceId value. */ public String targetResourceId() { - return this.targetResourceId; + return this.innerProperties() == null ? null : this.innerProperties().targetResourceId(); } /** @@ -264,7 +243,10 @@ public String targetResourceId() { * @return the ScheduleInner object itself. */ public ScheduleInner withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withTargetResourceId(targetResourceId); return this; } @@ -274,7 +256,7 @@ public ScheduleInner withTargetResourceId(String targetResourceId) { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -283,21 +265,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public ScheduleInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ScheduleInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -306,17 +274,12 @@ public ScheduleInner withTags(Map tags) { * @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(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model ScheduleInner")); + } else { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..fdcc3f993b1b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleProperties.java @@ -0,0 +1,304 @@ +// 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.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of a schedule. */ +@Fluent +public final class ScheduleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleProperties.class); + + /* + * The status of the schedule (i.e. Enabled, Disabled) + */ + @JsonProperty(value = "status") + private EnableStatus status; + + /* + * The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + */ + @JsonProperty(value = "taskType") + private String taskType; + + /* + * If the schedule will occur only some days of the week, specify the + * weekly recurrence. + */ + @JsonProperty(value = "weeklyRecurrence") + private WeekDetails weeklyRecurrence; + + /* + * If the schedule will occur once each day of the week, specify the daily + * recurrence. + */ + @JsonProperty(value = "dailyRecurrence") + private DayDetails dailyRecurrence; + + /* + * If the schedule will occur multiple times a day, specify the hourly + * recurrence. + */ + @JsonProperty(value = "hourlyRecurrence") + private HourDetails hourlyRecurrence; + + /* + * The time zone ID (e.g. Pacific Standard time). + */ + @JsonProperty(value = "timeZoneId") + private String timeZoneId; + + /* + * Notification settings. + */ + @JsonProperty(value = "notificationSettings") + private NotificationSettings notificationSettings; + + /* + * The creation date of the schedule. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The resource ID to which the schedule belongs + */ + @JsonProperty(value = "targetResourceId") + private String targetResourceId; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @param status the status value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withStatus(EnableStatus status) { + this.status = status; + return this; + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.taskType; + } + + /** + * Set the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @param taskType the taskType value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withTaskType(String taskType) { + this.taskType = taskType; + return this; + } + + /** + * Get the weeklyRecurrence property: If the schedule will occur only some days of the week, specify the weekly + * recurrence. + * + * @return the weeklyRecurrence value. + */ + public WeekDetails weeklyRecurrence() { + return this.weeklyRecurrence; + } + + /** + * Set the weeklyRecurrence property: If the schedule will occur only some days of the week, specify the weekly + * recurrence. + * + * @param weeklyRecurrence the weeklyRecurrence value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withWeeklyRecurrence(WeekDetails weeklyRecurrence) { + this.weeklyRecurrence = weeklyRecurrence; + return this; + } + + /** + * Get the dailyRecurrence property: If the schedule will occur once each day of the week, specify the daily + * recurrence. + * + * @return the dailyRecurrence value. + */ + public DayDetails dailyRecurrence() { + return this.dailyRecurrence; + } + + /** + * Set the dailyRecurrence property: If the schedule will occur once each day of the week, specify the daily + * recurrence. + * + * @param dailyRecurrence the dailyRecurrence value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withDailyRecurrence(DayDetails dailyRecurrence) { + this.dailyRecurrence = dailyRecurrence; + return this; + } + + /** + * Get the hourlyRecurrence property: If the schedule will occur multiple times a day, specify the hourly + * recurrence. + * + * @return the hourlyRecurrence value. + */ + public HourDetails hourlyRecurrence() { + return this.hourlyRecurrence; + } + + /** + * Set the hourlyRecurrence property: If the schedule will occur multiple times a day, specify the hourly + * recurrence. + * + * @param hourlyRecurrence the hourlyRecurrence value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withHourlyRecurrence(HourDetails hourlyRecurrence) { + this.hourlyRecurrence = hourlyRecurrence; + return this; + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.timeZoneId; + } + + /** + * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @param timeZoneId the timeZoneId value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withTimeZoneId(String timeZoneId) { + this.timeZoneId = timeZoneId; + return this; + } + + /** + * Get the notificationSettings property: Notification settings. + * + * @return the notificationSettings value. + */ + public NotificationSettings notificationSettings() { + return this.notificationSettings; + } + + /** + * Set the notificationSettings property: Notification settings. + * + * @param notificationSettings the notificationSettings value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withNotificationSettings(NotificationSettings notificationSettings) { + this.notificationSettings = notificationSettings; + return this; + } + + /** + * Get the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The resource ID to which the schedule belongs. + * + * @param targetResourceId the targetResourceId value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + 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(); + } + } +} 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 3f6f0af07f97..2057fcdbc1fa 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -13,28 +12,38 @@ import java.util.Map; /** A secret. */ -@JsonFlatten @Fluent -public class SecretInner extends Resource { +public final class SecretInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretInner.class); /* - * The value of the secret for secret creation. + * The properties of the resource. */ - @JsonProperty(value = "properties.value") - private String value; + @JsonProperty(value = "properties", required = true) + private SecretProperties innerProperties = new SecretProperties(); - /* - * The provisioning status of the resource. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private SecretProperties innerProperties() { + return this.innerProperties; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@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. @@ -42,7 +51,7 @@ public class SecretInner extends Resource { * @return the value value. */ public String value() { - return this.value; + return this.innerProperties() == null ? null : this.innerProperties().value(); } /** @@ -52,7 +61,10 @@ public String value() { * @return the SecretInner object itself. */ public SecretInner withValue(String value) { - this.value = value; + if (this.innerProperties() == null) { + this.innerProperties = new SecretProperties(); + } + this.innerProperties().withValue(value); return this; } @@ -62,7 +74,7 @@ public SecretInner withValue(String value) { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -71,21 +83,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public SecretInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecretInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -94,5 +92,12 @@ public SecretInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model SecretInner")); + } else { + innerProperties().validate(); + } } } 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 new file mode 100644 index 000000000000..925ad43c638e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretProperties.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a secret. */ +@Fluent +public final class SecretProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretProperties.class); + + /* + * The value of the secret for secret creation. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the value property: The value of the secret for secret creation. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the secret for secret creation. + * + * @param value the value value to set. + * @return the SecretProperties object itself. + */ + public SecretProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 fcc1dbed870a..f1757b3ea509 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -13,41 +12,38 @@ import java.util.Map; /** A Service Fabric. */ -@JsonFlatten @Fluent -public class ServiceFabricInner extends Resource { +public final class ServiceFabricInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceFabricInner.class); /* - * The backing service fabric resource's id + * The properties of the resource. */ - @JsonProperty(value = "properties.externalServiceFabricId") - private String externalServiceFabricId; + @JsonProperty(value = "properties", required = true) + private ServiceFabricPropertiesInner innerProperties = new ServiceFabricPropertiesInner(); - /* - * The resource id of the environment under which the service fabric - * resource is present - */ - @JsonProperty(value = "properties.environmentId") - private String environmentId; - - /* - * The applicable schedule for the virtual machine. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.applicableSchedule", access = JsonProperty.Access.WRITE_ONLY) - private ApplicableScheduleInner applicableSchedule; + private ServiceFabricPropertiesInner innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public ServiceFabricInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public ServiceFabricInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the externalServiceFabricId property: The backing service fabric resource's id. @@ -55,7 +51,7 @@ public class ServiceFabricInner extends Resource { * @return the externalServiceFabricId value. */ public String externalServiceFabricId() { - return this.externalServiceFabricId; + return this.innerProperties() == null ? null : this.innerProperties().externalServiceFabricId(); } /** @@ -65,7 +61,10 @@ public String externalServiceFabricId() { * @return the ServiceFabricInner object itself. */ public ServiceFabricInner withExternalServiceFabricId(String externalServiceFabricId) { - this.externalServiceFabricId = externalServiceFabricId; + if (this.innerProperties() == null) { + this.innerProperties = new ServiceFabricPropertiesInner(); + } + this.innerProperties().withExternalServiceFabricId(externalServiceFabricId); return this; } @@ -76,7 +75,7 @@ public ServiceFabricInner withExternalServiceFabricId(String externalServiceFabr * @return the environmentId value. */ public String environmentId() { - return this.environmentId; + return this.innerProperties() == null ? null : this.innerProperties().environmentId(); } /** @@ -87,7 +86,10 @@ public String environmentId() { * @return the ServiceFabricInner object itself. */ public ServiceFabricInner withEnvironmentId(String environmentId) { - this.environmentId = environmentId; + if (this.innerProperties() == null) { + this.innerProperties = new ServiceFabricPropertiesInner(); + } + this.innerProperties().withEnvironmentId(environmentId); return this; } @@ -97,7 +99,7 @@ public ServiceFabricInner withEnvironmentId(String environmentId) { * @return the applicableSchedule value. */ public ApplicableScheduleInner applicableSchedule() { - return this.applicableSchedule; + return this.innerProperties() == null ? null : this.innerProperties().applicableSchedule(); } /** @@ -106,7 +108,7 @@ public ApplicableScheduleInner applicableSchedule() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -115,21 +117,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public ServiceFabricInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServiceFabricInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -138,8 +126,13 @@ public ServiceFabricInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (applicableSchedule() != null) { - applicableSchedule().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ServiceFabricInner")); + } else { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..9f6083d2e5c0 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricPropertiesInner.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a service fabric. */ +@Fluent +public final class ServiceFabricPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceFabricPropertiesInner.class); + + /* + * The backing service fabric resource's id + */ + @JsonProperty(value = "externalServiceFabricId") + private String externalServiceFabricId; + + /* + * The resource id of the environment under which the service fabric + * resource is present + */ + @JsonProperty(value = "environmentId") + private String environmentId; + + /* + * The applicable schedule for the virtual machine. + */ + @JsonProperty(value = "applicableSchedule", access = JsonProperty.Access.WRITE_ONLY) + private ApplicableScheduleInner applicableSchedule; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the externalServiceFabricId property: The backing service fabric resource's id. + * + * @return the externalServiceFabricId value. + */ + public String externalServiceFabricId() { + return this.externalServiceFabricId; + } + + /** + * Set the externalServiceFabricId property: The backing service fabric resource's id. + * + * @param externalServiceFabricId the externalServiceFabricId value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withExternalServiceFabricId(String externalServiceFabricId) { + this.externalServiceFabricId = externalServiceFabricId; + return this; + } + + /** + * Get the environmentId property: The resource id of the environment under which the service fabric resource is + * present. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: The resource id of the environment under which the service fabric resource is + * present. + * + * @param environmentId the environmentId value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the applicableSchedule property: The applicable schedule for the virtual machine. + * + * @return the applicableSchedule value. + */ + public ApplicableScheduleInner applicableSchedule() { + return this.applicableSchedule; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + 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(); + } + } +} 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 a502dbe76746..4d52cd3b24ab 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.UserIdentity; @@ -16,40 +15,38 @@ import java.util.Map; /** Profile of a lab user. */ -@JsonFlatten @Fluent -public class UserInner extends Resource { +public final class UserInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(UserInner.class); /* - * The identity of the user. + * The properties of the resource. */ - @JsonProperty(value = "properties.identity") - private UserIdentity identity; + @JsonProperty(value = "properties") + private UserProperties innerProperties; - /* - * The secret store of the user. - */ - @JsonProperty(value = "properties.secretStore") - private UserSecretStore secretStore; - - /* - * The creation date of the user profile. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + private UserProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public UserInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public UserInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the identity property: The identity of the user. @@ -57,7 +54,7 @@ public class UserInner extends Resource { * @return the identity value. */ public UserIdentity identity() { - return this.identity; + return this.innerProperties() == null ? null : this.innerProperties().identity(); } /** @@ -67,7 +64,10 @@ public UserIdentity identity() { * @return the UserInner object itself. */ public UserInner withIdentity(UserIdentity identity) { - this.identity = identity; + if (this.innerProperties() == null) { + this.innerProperties = new UserProperties(); + } + this.innerProperties().withIdentity(identity); return this; } @@ -77,7 +77,7 @@ public UserInner withIdentity(UserIdentity identity) { * @return the secretStore value. */ public UserSecretStore secretStore() { - return this.secretStore; + return this.innerProperties() == null ? null : this.innerProperties().secretStore(); } /** @@ -87,7 +87,10 @@ public UserSecretStore secretStore() { * @return the UserInner object itself. */ public UserInner withSecretStore(UserSecretStore secretStore) { - this.secretStore = secretStore; + if (this.innerProperties() == null) { + this.innerProperties = new UserProperties(); + } + this.innerProperties().withSecretStore(secretStore); return this; } @@ -97,7 +100,7 @@ public UserInner withSecretStore(UserSecretStore secretStore) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -106,7 +109,7 @@ public OffsetDateTime createdDate() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -115,21 +118,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public UserInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public UserInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -138,11 +127,8 @@ public UserInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (identity() != null) { - identity().validate(); - } - if (secretStore() != null) { - secretStore().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..4492c045447f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.UserIdentity; +import com.azure.resourcemanager.devtestlabs.models.UserSecretStore; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of a lab user profile. */ +@Fluent +public final class UserProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserProperties.class); + + /* + * The identity of the user. + */ + @JsonProperty(value = "identity") + private UserIdentity identity; + + /* + * The secret store of the user. + */ + @JsonProperty(value = "secretStore") + private UserSecretStore secretStore; + + /* + * The creation date of the user profile. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the identity property: The identity of the user. + * + * @return the identity value. + */ + public UserIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the user. + * + * @param identity the identity value to set. + * @return the UserProperties object itself. + */ + public UserProperties withIdentity(UserIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the secretStore property: The secret store of the user. + * + * @return the secretStore value. + */ + public UserSecretStore secretStore() { + return this.secretStore; + } + + /** + * Set the secretStore property: The secret store of the user. + * + * @param secretStore the secretStore value to set. + * @return the UserProperties object itself. + */ + public UserProperties withSecretStore(UserSecretStore secretStore) { + this.secretStore = secretStore; + return this; + } + + /** + * Get the createdDate property: The creation date of the user profile. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + 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(); + } + } +} 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 80f7fd88eee8..cdc348b3eb9b 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.ExternalSubnet; @@ -18,58 +17,38 @@ import java.util.Map; /** A virtual network. */ -@JsonFlatten @Fluent -public class VirtualNetworkInner extends Resource { +public final class VirtualNetworkInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkInner.class); /* - * The allowed subnets of the virtual network. + * The properties of the resource. */ - @JsonProperty(value = "properties.allowedSubnets") - private List allowedSubnets; + @JsonProperty(value = "properties") + private VirtualNetworkProperties innerProperties; - /* - * The description of the virtual network. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * The Microsoft.Network resource identifier of the virtual network. - */ - @JsonProperty(value = "properties.externalProviderResourceId") - private String externalProviderResourceId; - - /* - * The external subnet properties. - */ - @JsonProperty(value = "properties.externalSubnets", access = JsonProperty.Access.WRITE_ONLY) - private List externalSubnets; - - /* - * The subnet overrides of the virtual network. - */ - @JsonProperty(value = "properties.subnetOverrides") - private List subnetOverrides; - - /* - * The creation date of the virtual network. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + private VirtualNetworkProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public VirtualNetworkInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public VirtualNetworkInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the allowedSubnets property: The allowed subnets of the virtual network. @@ -77,7 +56,7 @@ public class VirtualNetworkInner extends Resource { * @return the allowedSubnets value. */ public List allowedSubnets() { - return this.allowedSubnets; + return this.innerProperties() == null ? null : this.innerProperties().allowedSubnets(); } /** @@ -87,7 +66,10 @@ public List allowedSubnets() { * @return the VirtualNetworkInner object itself. */ public VirtualNetworkInner withAllowedSubnets(List allowedSubnets) { - this.allowedSubnets = allowedSubnets; + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkProperties(); + } + this.innerProperties().withAllowedSubnets(allowedSubnets); return this; } @@ -97,7 +79,7 @@ public VirtualNetworkInner withAllowedSubnets(List allowedSubnets) { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -107,7 +89,10 @@ public String description() { * @return the VirtualNetworkInner object itself. */ public VirtualNetworkInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -117,7 +102,7 @@ public VirtualNetworkInner withDescription(String description) { * @return the externalProviderResourceId value. */ public String externalProviderResourceId() { - return this.externalProviderResourceId; + return this.innerProperties() == null ? null : this.innerProperties().externalProviderResourceId(); } /** @@ -127,7 +112,10 @@ public String externalProviderResourceId() { * @return the VirtualNetworkInner object itself. */ public VirtualNetworkInner withExternalProviderResourceId(String externalProviderResourceId) { - this.externalProviderResourceId = externalProviderResourceId; + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkProperties(); + } + this.innerProperties().withExternalProviderResourceId(externalProviderResourceId); return this; } @@ -137,7 +125,7 @@ public VirtualNetworkInner withExternalProviderResourceId(String externalProvide * @return the externalSubnets value. */ public List externalSubnets() { - return this.externalSubnets; + return this.innerProperties() == null ? null : this.innerProperties().externalSubnets(); } /** @@ -146,7 +134,7 @@ public List externalSubnets() { * @return the subnetOverrides value. */ public List subnetOverrides() { - return this.subnetOverrides; + return this.innerProperties() == null ? null : this.innerProperties().subnetOverrides(); } /** @@ -156,7 +144,10 @@ public List subnetOverrides() { * @return the VirtualNetworkInner object itself. */ public VirtualNetworkInner withSubnetOverrides(List subnetOverrides) { - this.subnetOverrides = subnetOverrides; + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkProperties(); + } + this.innerProperties().withSubnetOverrides(subnetOverrides); return this; } @@ -166,7 +157,7 @@ public VirtualNetworkInner withSubnetOverrides(List subnetOverri * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -175,7 +166,7 @@ public OffsetDateTime createdDate() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -184,21 +175,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -207,14 +184,8 @@ public VirtualNetworkInner withTags(Map tags) { * @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()); + if (innerProperties() != null) { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..b270d1f2e2c9 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkProperties.java @@ -0,0 +1,202 @@ +// 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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ExternalSubnet; +import com.azure.resourcemanager.devtestlabs.models.Subnet; +import com.azure.resourcemanager.devtestlabs.models.SubnetOverride; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of a virtual network. */ +@Fluent +public final class VirtualNetworkProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkProperties.class); + + /* + * The allowed subnets of the virtual network. + */ + @JsonProperty(value = "allowedSubnets") + private List allowedSubnets; + + /* + * The description of the virtual network. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The Microsoft.Network resource identifier of the virtual network. + */ + @JsonProperty(value = "externalProviderResourceId") + private String externalProviderResourceId; + + /* + * The external subnet properties. + */ + @JsonProperty(value = "externalSubnets", access = JsonProperty.Access.WRITE_ONLY) + private List externalSubnets; + + /* + * The subnet overrides of the virtual network. + */ + @JsonProperty(value = "subnetOverrides") + private List subnetOverrides; + + /* + * The creation date of the virtual network. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the allowedSubnets property: The allowed subnets of the virtual network. + * + * @return the allowedSubnets value. + */ + public List allowedSubnets() { + return this.allowedSubnets; + } + + /** + * Set the allowedSubnets property: The allowed subnets of the virtual network. + * + * @param allowedSubnets the allowedSubnets value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withAllowedSubnets(List allowedSubnets) { + this.allowedSubnets = allowedSubnets; + return this; + } + + /** + * Get the description property: The description of the virtual network. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the virtual network. + * + * @param description the description value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the externalProviderResourceId property: The Microsoft.Network resource identifier of the virtual network. + * + * @return the externalProviderResourceId value. + */ + public String externalProviderResourceId() { + return this.externalProviderResourceId; + } + + /** + * Set the externalProviderResourceId property: The Microsoft.Network resource identifier of the virtual network. + * + * @param externalProviderResourceId the externalProviderResourceId value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withExternalProviderResourceId(String externalProviderResourceId) { + this.externalProviderResourceId = externalProviderResourceId; + return this; + } + + /** + * Get the externalSubnets property: The external subnet properties. + * + * @return the externalSubnets value. + */ + public List externalSubnets() { + return this.externalSubnets; + } + + /** + * Get the subnetOverrides property: The subnet overrides of the virtual network. + * + * @return the subnetOverrides value. + */ + public List subnetOverrides() { + return this.subnetOverrides; + } + + /** + * Set the subnetOverrides property: The subnet overrides of the virtual network. + * + * @param subnetOverrides the subnetOverrides value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withSubnetOverrides(List subnetOverrides) { + this.subnetOverrides = subnetOverrides; + return this; + } + + /** + * Get the createdDate property: The creation date of the virtual network. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + 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()); + } + } +} 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 new file mode 100644 index 000000000000..2d6612e90348 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableSchedulePropertiesImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableSchedulePropertiesInner; +import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; +import com.azure.resourcemanager.devtestlabs.models.ApplicableScheduleProperties; +import com.azure.resourcemanager.devtestlabs.models.Schedule; + +public final class ApplicableSchedulePropertiesImpl implements ApplicableScheduleProperties { + private ApplicableSchedulePropertiesInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + ApplicableSchedulePropertiesImpl( + ApplicableSchedulePropertiesInner innerObject, + com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Schedule labVmsShutdown() { + ScheduleInner inner = this.innerModel().labVmsShutdown(); + if (inner != null) { + return new ScheduleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Schedule labVmsStartup() { + ScheduleInner inner = this.innerModel().labVmsStartup(); + if (inner != null) { + return new ScheduleImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicableSchedulePropertiesInner 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/CustomImagesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesClientImpl.java index 99372da0c00e..db36f03a03cb 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 @@ -742,7 +742,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a custom image. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CustomImageInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, CustomImageInner customImage) { Mono>> mono = @@ -766,7 +766,7 @@ private PollerFlux, CustomImageInner> beginCreateOr * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a custom image. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -790,7 +790,7 @@ private PollerFlux, CustomImageInner> beginCreateOr * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a custom image. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CustomImageInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, CustomImageInner customImage) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, customImage).getSyncPoller(); @@ -809,7 +809,7 @@ public SyncPoller, CustomImageInner> beginCreateOrU * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a custom image. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CustomImageInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, CustomImageInner customImage, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, customImage, context).getSyncPoller(); @@ -1008,7 +1008,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); return this @@ -1028,7 +1028,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -1049,7 +1049,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { return beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -1066,7 +1066,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); 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 bb987f61fa98..1f04b190eebc 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 @@ -842,7 +842,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Disk. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DiskInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String username, String name, DiskInner disk) { Mono>> mono = @@ -867,7 +867,7 @@ private PollerFlux, DiskInner> beginCreateOrUpdateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Disk. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -892,7 +892,7 @@ private PollerFlux, DiskInner> beginCreateOrUpdateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Disk. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DiskInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, DiskInner disk) { return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, disk).getSyncPoller(); @@ -912,7 +912,7 @@ public SyncPoller, DiskInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Disk. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DiskInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, DiskInner disk, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, disk, context).getSyncPoller(); @@ -1126,7 +1126,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -1148,7 +1148,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -1171,7 +1171,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name) { return beginDeleteAsync(resourceGroupName, labName, username, name).getSyncPoller(); @@ -1190,7 +1190,7 @@ public SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); @@ -1614,7 +1614,7 @@ private Mono>> attachWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginAttachAsync( String resourceGroupName, String labName, @@ -1642,7 +1642,7 @@ private PollerFlux, Void> beginAttachAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginAttachAsync( String resourceGroupName, String labName, @@ -1671,7 +1671,7 @@ private PollerFlux, Void> beginAttachAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginAttach( String resourceGroupName, String labName, @@ -1695,7 +1695,7 @@ public SyncPoller, Void> beginAttach( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginAttach( String resourceGroupName, String labName, @@ -1960,7 +1960,7 @@ private Mono>> detachWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDetachAsync( String resourceGroupName, String labName, @@ -1989,7 +1989,7 @@ private PollerFlux, Void> beginDetachAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDetachAsync( String resourceGroupName, String labName, @@ -2019,7 +2019,7 @@ private PollerFlux, Void> beginDetachAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDetach( String resourceGroupName, String labName, @@ -2044,7 +2044,7 @@ public SyncPoller, Void> beginDetach( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDetach( String resourceGroupName, String labName, 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 4d2a24c43e5a..4104f81e881b 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 @@ -809,7 +809,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DtlEnvironmentInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String username, String name, DtlEnvironmentInner dtlEnvironment) { Mono>> mono = @@ -838,7 +838,7 @@ private PollerFlux, DtlEnvironmentInner> beginCr * @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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DtlEnvironmentInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, @@ -868,7 +868,7 @@ private PollerFlux, DtlEnvironmentInner> beginCr * @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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DtlEnvironmentInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, DtlEnvironmentInner dtlEnvironment) { return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, dtlEnvironment).getSyncPoller(); @@ -888,7 +888,7 @@ public SyncPoller, DtlEnvironmentInner> beginCre * @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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DtlEnvironmentInner> beginCreateOrUpdate( String resourceGroupName, String labName, @@ -1118,7 +1118,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -1140,7 +1140,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -1163,7 +1163,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name) { return beginDeleteAsync(resourceGroupName, labName, username, name).getSyncPoller(); @@ -1182,7 +1182,7 @@ public SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); 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 e60243fca89b..b2d0342dabe7 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 @@ -741,7 +741,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, FormulaInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, FormulaInner formula) { Mono>> mono = @@ -765,7 +765,7 @@ private PollerFlux, FormulaInner> beginCreateOrUpdateAs * @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) + @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); @@ -789,7 +789,7 @@ private PollerFlux, FormulaInner> beginCreateOrUpdateAs * @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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, FormulaInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, FormulaInner formula) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, formula).getSyncPoller(); @@ -808,7 +808,7 @@ public SyncPoller, FormulaInner> beginCreateOrUpdate( * @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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, FormulaInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, FormulaInner formula, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, formula, context).getSyncPoller(); 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 06eace1f8e65..3593357b1b1b 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 @@ -1389,7 +1389,7 @@ private Mono>> executeWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync(String resourceGroupName, String name) { Mono>> mono = executeWithResponseAsync(resourceGroupName, name); return this @@ -1408,7 +1408,7 @@ private PollerFlux, Void> beginExecuteAsync(String resourceGrou * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String name, Context context) { context = this.client.mergeContext(context); @@ -1428,7 +1428,7 @@ private PollerFlux, Void> beginExecuteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute(String resourceGroupName, String name) { return beginExecuteAsync(resourceGroupName, name).getSyncPoller(); } @@ -1444,7 +1444,7 @@ public SyncPoller, Void> beginExecute(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute(String resourceGroupName, String name, Context context) { return beginExecuteAsync(resourceGroupName, name, context).getSyncPoller(); } @@ -1636,7 +1636,7 @@ private Mono>> retargetWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRetargetAsync( String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties) { Mono>> mono = @@ -1658,7 +1658,7 @@ private PollerFlux, Void> beginRetargetAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRetargetAsync( String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties, Context context) { context = this.client.mergeContext(context); @@ -1680,7 +1680,7 @@ private PollerFlux, Void> beginRetargetAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRetarget( String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties) { return beginRetargetAsync(resourceGroupName, name, retargetScheduleProperties).getSyncPoller(); @@ -1698,7 +1698,7 @@ public SyncPoller, Void> beginRetarget( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRetarget( String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties, Context context) { return beginRetargetAsync(resourceGroupName, name, retargetScheduleProperties, context).getSyncPoller(); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachinePropertiesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachinePropertiesImpl.java new file mode 100644 index 000000000000..b6459cbfd9cb --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachinePropertiesImpl.java @@ -0,0 +1,202 @@ +// 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.ApplicableScheduleInner; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachinePropertiesInner; +import com.azure.resourcemanager.devtestlabs.models.ApplicableSchedule; +import com.azure.resourcemanager.devtestlabs.models.ArtifactDeploymentStatusProperties; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmProperties; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineProperties; +import com.azure.resourcemanager.devtestlabs.models.NetworkInterfaceProperties; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class LabVirtualMachinePropertiesImpl implements LabVirtualMachineProperties { + private LabVirtualMachinePropertiesInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + LabVirtualMachinePropertiesImpl( + LabVirtualMachinePropertiesInner innerObject, + com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String notes() { + return this.innerModel().notes(); + } + + public String ownerObjectId() { + return this.innerModel().ownerObjectId(); + } + + public String ownerUserPrincipalName() { + return this.innerModel().ownerUserPrincipalName(); + } + + public String createdByUserId() { + return this.innerModel().createdByUserId(); + } + + public String createdByUser() { + return this.innerModel().createdByUser(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String computeId() { + return this.innerModel().computeId(); + } + + public String customImageId() { + return this.innerModel().customImageId(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public String size() { + return this.innerModel().size(); + } + + public String username() { + return this.innerModel().username(); + } + + public String password() { + return this.innerModel().password(); + } + + public String sshKey() { + return this.innerModel().sshKey(); + } + + public Boolean isAuthenticationWithSshKey() { + return this.innerModel().isAuthenticationWithSshKey(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public String labSubnetName() { + return this.innerModel().labSubnetName(); + } + + public String labVirtualNetworkId() { + return this.innerModel().labVirtualNetworkId(); + } + + public Boolean disallowPublicIpAddress() { + return this.innerModel().disallowPublicIpAddress(); + } + + public List artifacts() { + List inner = this.innerModel().artifacts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ArtifactDeploymentStatusProperties artifactDeploymentStatus() { + return this.innerModel().artifactDeploymentStatus(); + } + + public GalleryImageReference galleryImageReference() { + return this.innerModel().galleryImageReference(); + } + + public String planId() { + return this.innerModel().planId(); + } + + public ComputeVmProperties computeVm() { + return this.innerModel().computeVm(); + } + + public NetworkInterfaceProperties networkInterface() { + return this.innerModel().networkInterface(); + } + + public ApplicableSchedule applicableSchedule() { + ApplicableScheduleInner inner = this.innerModel().applicableSchedule(); + if (inner != null) { + return new ApplicableScheduleImpl(inner, this.manager()); + } else { + return null; + } + } + + public OffsetDateTime expirationDate() { + return this.innerModel().expirationDate(); + } + + public Boolean allowClaim() { + return this.innerModel().allowClaim(); + } + + public String storageType() { + return this.innerModel().storageType(); + } + + public VirtualMachineCreationSource virtualMachineCreationSource() { + return this.innerModel().virtualMachineCreationSource(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public List dataDiskParameters() { + List inner = this.innerModel().dataDiskParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List scheduleParameters() { + List inner = this.innerModel().scheduleParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String lastKnownPowerState() { + return this.innerModel().lastKnownPowerState(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public LabVirtualMachinePropertiesInner 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/LabsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsClientImpl.java index 9bb8b8514d2f..ce8d14ea39a7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsClientImpl.java @@ -1010,7 +1010,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a lab. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LabInner> beginCreateOrUpdateAsync( String resourceGroupName, String name, LabInner lab) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, lab); @@ -1032,7 +1032,7 @@ private PollerFlux, LabInner> beginCreateOrUpdateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a lab. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LabInner> beginCreateOrUpdateAsync( String resourceGroupName, String name, LabInner lab, Context context) { context = this.client.mergeContext(context); @@ -1054,7 +1054,7 @@ private PollerFlux, LabInner> beginCreateOrUpdateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a lab. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LabInner> beginCreateOrUpdate( String resourceGroupName, String name, LabInner lab) { return beginCreateOrUpdateAsync(resourceGroupName, name, lab).getSyncPoller(); @@ -1072,7 +1072,7 @@ public SyncPoller, LabInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a lab. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LabInner> beginCreateOrUpdate( String resourceGroupName, String name, LabInner lab, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, name, lab, context).getSyncPoller(); @@ -1251,7 +1251,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); return this @@ -1270,7 +1270,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String name, Context context) { context = this.client.mergeContext(context); @@ -1290,7 +1290,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { return beginDeleteAsync(resourceGroupName, name).getSyncPoller(); } @@ -1306,7 +1306,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { return beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); } @@ -1639,7 +1639,7 @@ private Mono>> claimAnyVmWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginClaimAnyVmAsync(String resourceGroupName, String name) { Mono>> mono = claimAnyVmWithResponseAsync(resourceGroupName, name); return this @@ -1658,7 +1658,7 @@ private PollerFlux, Void> beginClaimAnyVmAsync(String resourceG * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginClaimAnyVmAsync( String resourceGroupName, String name, Context context) { context = this.client.mergeContext(context); @@ -1678,7 +1678,7 @@ private PollerFlux, Void> beginClaimAnyVmAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaimAnyVm(String resourceGroupName, String name) { return beginClaimAnyVmAsync(resourceGroupName, name).getSyncPoller(); } @@ -1694,7 +1694,7 @@ public SyncPoller, Void> beginClaimAnyVm(String resourceGroupNa * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaimAnyVm(String resourceGroupName, String name, Context context) { return beginClaimAnyVmAsync(resourceGroupName, name, context).getSyncPoller(); } @@ -1889,7 +1889,7 @@ private Mono>> createEnvironmentWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginCreateEnvironmentAsync( String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { Mono>> mono = @@ -1911,7 +1911,7 @@ private PollerFlux, Void> beginCreateEnvironmentAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginCreateEnvironmentAsync( String resourceGroupName, String name, @@ -1936,7 +1936,7 @@ private PollerFlux, Void> beginCreateEnvironmentAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginCreateEnvironment( String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { return beginCreateEnvironmentAsync(resourceGroupName, name, labVirtualMachineCreationParameter).getSyncPoller(); @@ -1954,7 +1954,7 @@ public SyncPoller, Void> beginCreateEnvironment( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginCreateEnvironment( String resourceGroupName, String name, @@ -2170,7 +2170,7 @@ private Mono>> exportResourceUsageWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExportResourceUsageAsync( String resourceGroupName, String name, ExportResourceUsageParameters exportResourceUsageParameters) { Mono>> mono = @@ -2192,7 +2192,7 @@ private PollerFlux, Void> beginExportResourceUsageAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExportResourceUsageAsync( String resourceGroupName, String name, @@ -2217,7 +2217,7 @@ private PollerFlux, Void> beginExportResourceUsageAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExportResourceUsage( String resourceGroupName, String name, ExportResourceUsageParameters exportResourceUsageParameters) { return beginExportResourceUsageAsync(resourceGroupName, name, exportResourceUsageParameters).getSyncPoller(); @@ -2235,7 +2235,7 @@ public SyncPoller, Void> beginExportResourceUsage( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExportResourceUsage( String resourceGroupName, String name, @@ -2628,7 +2628,7 @@ private Mono>> importVirtualMachineWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginImportVirtualMachineAsync( String resourceGroupName, String name, ImportLabVirtualMachineRequest importLabVirtualMachineRequest) { Mono>> mono = @@ -2651,7 +2651,7 @@ private PollerFlux, Void> beginImportVirtualMachineAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginImportVirtualMachineAsync( String resourceGroupName, String name, @@ -2677,7 +2677,7 @@ private PollerFlux, Void> beginImportVirtualMachineAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginImportVirtualMachine( String resourceGroupName, String name, ImportLabVirtualMachineRequest importLabVirtualMachineRequest) { return beginImportVirtualMachineAsync(resourceGroupName, name, importLabVirtualMachineRequest).getSyncPoller(); @@ -2696,7 +2696,7 @@ public SyncPoller, Void> beginImportVirtualMachine( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginImportVirtualMachine( String resourceGroupName, String name, 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 a06ac0f58a08..fea73aef1b20 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 @@ -1281,7 +1281,7 @@ private Mono>> executeWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String labName, String name) { Mono>> mono = executeWithResponseAsync(resourceGroupName, labName, name); @@ -1302,7 +1302,7 @@ private PollerFlux, Void> beginExecuteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -1323,7 +1323,7 @@ private PollerFlux, Void> beginExecuteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String name) { return beginExecuteAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -1340,7 +1340,7 @@ public SyncPoller, Void> beginExecute(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String name, Context context) { return beginExecuteAsync(resourceGroupName, labName, name, context).getSyncPoller(); 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 0627f5e5dfdb..cd40338d66e9 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 @@ -803,7 +803,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a secret. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SecretInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String username, String name, SecretInner secret) { Mono>> mono = @@ -828,7 +828,7 @@ private PollerFlux, SecretInner> beginCreateOrUpdateAsyn * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a secret. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -853,7 +853,7 @@ private PollerFlux, SecretInner> beginCreateOrUpdateAsyn * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a secret. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SecretInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, SecretInner secret) { return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, secret).getSyncPoller(); @@ -873,7 +873,7 @@ public SyncPoller, SecretInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a secret. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SecretInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, SecretInner secret, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, secret, context).getSyncPoller(); 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 new file mode 100644 index 000000000000..ac4418dbe76a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricPropertiesImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner; +import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricPropertiesInner; +import com.azure.resourcemanager.devtestlabs.models.ApplicableSchedule; +import com.azure.resourcemanager.devtestlabs.models.ServiceFabricProperties; + +public final class ServiceFabricPropertiesImpl implements ServiceFabricProperties { + private ServiceFabricPropertiesInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + ServiceFabricPropertiesImpl( + ServiceFabricPropertiesInner innerObject, + com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String externalServiceFabricId() { + return this.innerModel().externalServiceFabricId(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public ApplicableSchedule applicableSchedule() { + ApplicableScheduleInner inner = this.innerModel().applicableSchedule(); + if (inner != null) { + return new ApplicableScheduleImpl(inner, this.manager()); + } else { + return null; + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public ServiceFabricPropertiesInner 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/ServiceFabricSchedulesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesClientImpl.java index b7d38893ec42..1d494d0f3378 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 @@ -1573,7 +1573,7 @@ private Mono>> executeWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String labName, String username, String serviceFabricName, String name) { Mono>> mono = @@ -1597,7 +1597,7 @@ private PollerFlux, Void> beginExecuteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String labName, @@ -1626,7 +1626,7 @@ private PollerFlux, Void> beginExecuteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String username, String serviceFabricName, String name) { return beginExecuteAsync(resourceGroupName, labName, username, serviceFabricName, name).getSyncPoller(); @@ -1646,7 +1646,7 @@ public SyncPoller, Void> beginExecute( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute( String resourceGroupName, String labName, 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 43f01fd55391..e428ba4f9df9 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 @@ -862,7 +862,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Service Fabric. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServiceFabricInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String username, String name, ServiceFabricInner serviceFabric) { Mono>> mono = @@ -887,7 +887,7 @@ private PollerFlux, ServiceFabricInner> beginCrea * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Service Fabric. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServiceFabricInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, @@ -917,7 +917,7 @@ private PollerFlux, ServiceFabricInner> beginCrea * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Service Fabric. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServiceFabricInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, ServiceFabricInner serviceFabric) { return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, serviceFabric).getSyncPoller(); @@ -937,7 +937,7 @@ public SyncPoller, ServiceFabricInner> beginCreat * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Service Fabric. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServiceFabricInner> beginCreateOrUpdate( String resourceGroupName, String labName, @@ -1167,7 +1167,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -1189,7 +1189,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -1212,7 +1212,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name) { return beginDeleteAsync(resourceGroupName, labName, username, name).getSyncPoller(); @@ -1231,7 +1231,7 @@ public SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); @@ -1817,7 +1817,7 @@ private Mono>> startWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -1839,7 +1839,7 @@ private PollerFlux, Void> beginStartAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -1862,7 +1862,7 @@ private PollerFlux, Void> beginStartAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStart( String resourceGroupName, String labName, String username, String name) { return beginStartAsync(resourceGroupName, labName, username, name).getSyncPoller(); @@ -1881,7 +1881,7 @@ public SyncPoller, Void> beginStart( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStart( String resourceGroupName, String labName, String username, String name, Context context) { return beginStartAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); @@ -2086,7 +2086,7 @@ private Mono>> stopWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -2108,7 +2108,7 @@ private PollerFlux, Void> beginStopAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -2131,7 +2131,7 @@ private PollerFlux, Void> beginStopAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStop( String resourceGroupName, String labName, String username, String name) { return beginStopAsync(resourceGroupName, labName, username, name).getSyncPoller(); @@ -2150,7 +2150,7 @@ public SyncPoller, Void> beginStop( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStop( String resourceGroupName, String labName, String username, String name, Context context) { return beginStopAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); 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 c02c18145d71..e3e0b770129b 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 @@ -741,7 +741,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return profile of a lab user. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -764,7 +764,7 @@ private PollerFlux, UserInner> beginCreateOrUpdateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return profile of a lab user. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -788,7 +788,7 @@ private PollerFlux, UserInner> beginCreateOrUpdateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return profile of a lab user. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, UserInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, UserInner user) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, user).getSyncPoller(); @@ -807,7 +807,7 @@ public SyncPoller, UserInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return profile of a lab user. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, UserInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, UserInner user, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, user, context).getSyncPoller(); @@ -1004,7 +1004,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); return this @@ -1024,7 +1024,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -1045,7 +1045,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { return beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -1062,7 +1062,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); 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 f48ffd17e939..1d44766bcb24 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 @@ -1410,7 +1410,7 @@ private Mono>> executeWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String labName, String virtualMachineName, String name) { Mono>> mono = @@ -1433,7 +1433,7 @@ private PollerFlux, Void> beginExecuteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -1456,7 +1456,7 @@ private PollerFlux, Void> beginExecuteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String virtualMachineName, String name) { return beginExecuteAsync(resourceGroupName, labName, virtualMachineName, name).getSyncPoller(); @@ -1475,7 +1475,7 @@ public SyncPoller, Void> beginExecute( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String virtualMachineName, String name, Context context) { return beginExecuteAsync(resourceGroupName, labName, virtualMachineName, name, context).getSyncPoller(); 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 6b29a2bf4d84..07ebe868887d 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 @@ -977,7 +977,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LabVirtualMachineInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine) { Mono>> mono = @@ -1005,7 +1005,7 @@ private PollerFlux, LabVirtualMachineInner> b * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LabVirtualMachineInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, @@ -1037,7 +1037,7 @@ private PollerFlux, LabVirtualMachineInner> b * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LabVirtualMachineInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, labVirtualMachine).getSyncPoller(); @@ -1056,7 +1056,7 @@ public SyncPoller, LabVirtualMachineInner> be * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LabVirtualMachineInner> beginCreateOrUpdate( String resourceGroupName, String labName, @@ -1267,7 +1267,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); return this @@ -1287,7 +1287,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -1308,7 +1308,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { return beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -1325,7 +1325,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -1720,7 +1720,7 @@ private Mono>> addDataDiskWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginAddDataDiskAsync( String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties) { Mono>> mono = @@ -1743,7 +1743,7 @@ private PollerFlux, Void> beginAddDataDiskAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -1766,7 +1766,7 @@ private PollerFlux, Void> beginAddDataDiskAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginAddDataDisk( String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties) { return beginAddDataDiskAsync(resourceGroupName, labName, name, dataDiskProperties).getSyncPoller(); @@ -1785,7 +1785,7 @@ public SyncPoller, Void> beginAddDataDisk( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginAddDataDisk( String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties, Context context) { return beginAddDataDiskAsync(resourceGroupName, labName, name, dataDiskProperties, context).getSyncPoller(); @@ -2003,7 +2003,7 @@ private Mono>> applyArtifactsWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginApplyArtifactsAsync( String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest) { Mono>> mono = @@ -2026,7 +2026,7 @@ private PollerFlux, Void> beginApplyArtifactsAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginApplyArtifactsAsync( String resourceGroupName, String labName, @@ -2053,7 +2053,7 @@ private PollerFlux, Void> beginApplyArtifactsAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginApplyArtifacts( String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest) { return beginApplyArtifactsAsync(resourceGroupName, labName, name, applyArtifactsRequest).getSyncPoller(); @@ -2072,7 +2072,7 @@ public SyncPoller, Void> beginApplyArtifacts( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginApplyArtifacts( String resourceGroupName, String labName, @@ -2282,7 +2282,7 @@ private Mono>> claimWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginClaimAsync(String resourceGroupName, String labName, String name) { Mono>> mono = claimWithResponseAsync(resourceGroupName, labName, name); return this @@ -2302,7 +2302,7 @@ private PollerFlux, Void> beginClaimAsync(String resourceGroupN * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginClaimAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -2323,7 +2323,7 @@ private PollerFlux, Void> beginClaimAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaim(String resourceGroupName, String labName, String name) { return beginClaimAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -2340,7 +2340,7 @@ public SyncPoller, Void> beginClaim(String resourceGroupName, S * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaim( String resourceGroupName, String labName, String name, Context context) { return beginClaimAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -2550,7 +2550,7 @@ private Mono>> detachDataDiskWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDetachDataDiskAsync( String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties) { Mono>> mono = @@ -2573,7 +2573,7 @@ private PollerFlux, Void> beginDetachDataDiskAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDetachDataDiskAsync( String resourceGroupName, String labName, @@ -2600,7 +2600,7 @@ private PollerFlux, Void> beginDetachDataDiskAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDetachDataDisk( String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties) { return beginDetachDataDiskAsync(resourceGroupName, labName, name, detachDataDiskProperties).getSyncPoller(); @@ -2619,7 +2619,7 @@ public SyncPoller, Void> beginDetachDataDisk( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDetachDataDisk( String resourceGroupName, String labName, @@ -3154,7 +3154,7 @@ private Mono>> redeployWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRedeployAsync( String resourceGroupName, String labName, String name) { Mono>> mono = redeployWithResponseAsync(resourceGroupName, labName, name); @@ -3175,7 +3175,7 @@ private PollerFlux, Void> beginRedeployAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRedeployAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -3196,7 +3196,7 @@ private PollerFlux, Void> beginRedeployAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRedeploy(String resourceGroupName, String labName, String name) { return beginRedeployAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -3213,7 +3213,7 @@ public SyncPoller, Void> beginRedeploy(String resourceGroupName * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRedeploy( String resourceGroupName, String labName, String name, Context context) { return beginRedeployAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -3430,7 +3430,7 @@ private Mono>> resizeWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginResizeAsync( String resourceGroupName, String labName, @@ -3456,7 +3456,7 @@ private PollerFlux, Void> beginResizeAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginResizeAsync( String resourceGroupName, String labName, @@ -3483,7 +3483,7 @@ private PollerFlux, Void> beginResizeAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginResize( String resourceGroupName, String labName, @@ -3505,7 +3505,7 @@ public SyncPoller, Void> beginResize( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginResize( String resourceGroupName, String labName, @@ -3721,7 +3721,7 @@ private Mono>> restartWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRestartAsync( String resourceGroupName, String labName, String name) { Mono>> mono = restartWithResponseAsync(resourceGroupName, labName, name); @@ -3742,7 +3742,7 @@ private PollerFlux, Void> beginRestartAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRestartAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -3763,7 +3763,7 @@ private PollerFlux, Void> beginRestartAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRestart(String resourceGroupName, String labName, String name) { return beginRestartAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -3780,7 +3780,7 @@ public SyncPoller, Void> beginRestart(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRestart( String resourceGroupName, String labName, String name, Context context) { return beginRestartAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -3969,7 +3969,7 @@ private Mono>> startWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStartAsync(String resourceGroupName, String labName, String name) { Mono>> mono = startWithResponseAsync(resourceGroupName, labName, name); return this @@ -3989,7 +3989,7 @@ private PollerFlux, Void> beginStartAsync(String resourceGroupN * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStartAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -4010,7 +4010,7 @@ private PollerFlux, Void> beginStartAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStart(String resourceGroupName, String labName, String name) { return beginStartAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -4027,7 +4027,7 @@ public SyncPoller, Void> beginStart(String resourceGroupName, S * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStart( String resourceGroupName, String labName, String name, Context context) { return beginStartAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -4214,7 +4214,7 @@ private Mono>> stopWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStopAsync(String resourceGroupName, String labName, String name) { Mono>> mono = stopWithResponseAsync(resourceGroupName, labName, name); return this @@ -4234,7 +4234,7 @@ private PollerFlux, Void> beginStopAsync(String resourceGroupNa * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStopAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -4255,7 +4255,7 @@ private PollerFlux, Void> beginStopAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStop(String resourceGroupName, String labName, String name) { return beginStopAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -4272,7 +4272,7 @@ public SyncPoller, Void> beginStop(String resourceGroupName, St * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStop( String resourceGroupName, String labName, String name, Context context) { return beginStopAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -4462,7 +4462,7 @@ private Mono>> transferDisksWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTransferDisksAsync( String resourceGroupName, String labName, String name) { Mono>> mono = transferDisksWithResponseAsync(resourceGroupName, labName, name); @@ -4484,7 +4484,7 @@ private PollerFlux, Void> beginTransferDisksAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTransferDisksAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -4507,7 +4507,7 @@ private PollerFlux, Void> beginTransferDisksAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTransferDisks( String resourceGroupName, String labName, String name) { return beginTransferDisksAsync(resourceGroupName, labName, name).getSyncPoller(); @@ -4526,7 +4526,7 @@ public SyncPoller, Void> beginTransferDisks( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTransferDisks( String resourceGroupName, String labName, String name, Context context) { return beginTransferDisksAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -4719,7 +4719,7 @@ private Mono>> unClaimWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginUnClaimAsync( String resourceGroupName, String labName, String name) { Mono>> mono = unClaimWithResponseAsync(resourceGroupName, labName, name); @@ -4740,7 +4740,7 @@ private PollerFlux, Void> beginUnClaimAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginUnClaimAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -4761,7 +4761,7 @@ private PollerFlux, Void> beginUnClaimAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUnClaim(String resourceGroupName, String labName, String name) { return beginUnClaimAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -4778,7 +4778,7 @@ public SyncPoller, Void> beginUnClaim(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUnClaim( String resourceGroupName, String labName, String name, Context context) { return beginUnClaimAsync(resourceGroupName, labName, name, context).getSyncPoller(); 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 00c64127a8d9..7e3c448f2320 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 @@ -742,7 +742,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual network. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork) { Mono>> mono = @@ -770,7 +770,7 @@ private PollerFlux, VirtualNetworkInner> beginCr * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual network. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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); @@ -794,7 +794,7 @@ private PollerFlux, VirtualNetworkInner> beginCr * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual network. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, virtualNetwork).getSyncPoller(); @@ -813,7 +813,7 @@ public SyncPoller, VirtualNetworkInner> beginCre * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a virtual network. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, virtualNetwork, context).getSyncPoller(); @@ -1012,7 +1012,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); return this @@ -1032,7 +1032,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -1053,7 +1053,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { return beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -1070,7 +1070,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); 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 index 8d58391939e9..4be84dcc7970 100644 --- 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** Schedules applicable to a virtual machine. The schedules may have been defined on a VM or on lab level. */ -@Immutable +@Fluent public final class ApplicableScheduleFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicableScheduleFragment.class); 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 new file mode 100644 index 000000000000..7cdc8c948b7b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleProperties.java @@ -0,0 +1,32 @@ +// 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.ApplicableSchedulePropertiesInner; + +/** An immutable client-side representation of ApplicableScheduleProperties. */ +public interface ApplicableScheduleProperties { + /** + * Gets the labVmsShutdown property: The auto-shutdown schedule, if one has been set at the lab or lab resource + * level. + * + * @return the labVmsShutdown value. + */ + Schedule labVmsShutdown(); + + /** + * Gets the labVmsStartup property: The auto-startup schedule, if one has been set at the lab or lab resource level. + * + * @return the labVmsStartup value. + */ + Schedule labVmsStartup(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableSchedulePropertiesInner object. + * + * @return the inner object. + */ + ApplicableSchedulePropertiesInner innerModel(); +} 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 3f85e8bbbb64..1ad33d68305c 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** Properties of an artifact source. */ -@Immutable +@Fluent public final class ArtifactSourceFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactSourceFragment.class); 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 d4cf59c9c3ee..ff411d4ab422 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** A custom image. */ -@Immutable +@Fluent public final class CustomImageFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomImageFragment.class); 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 e3e0362be522..d8e18de9a79d 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** A Disk. */ -@Immutable +@Fluent public final class DiskFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskFragment.class); 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 a7a1654b7145..e88dc2993123 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** An environment, which is essentially an ARM template deployment. */ -@Immutable +@Fluent public final class DtlEnvironmentFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DtlEnvironmentFragment.class); 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 c55a002df1bf..967d6de410f7 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** A formula for creating a VM, specifying an image base and other parameters. */ -@Immutable +@Fluent public final class FormulaFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(FormulaFragment.class); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabFragment.java index 18296f1d5f5f..5477fe3f711a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabFragment.java @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** A lab. */ -@Immutable +@Fluent public final class LabFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabFragment.class); 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 d4954b1acd96..dd41e7c24a00 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 @@ -5,20 +5,26 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterProperties; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; /** Properties for creating a virtual machine. */ -@JsonFlatten @Fluent -public class LabVirtualMachineCreationParameter { +public final class LabVirtualMachineCreationParameter { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabVirtualMachineCreationParameter.class); + /* + * The properties of the resource. + */ + @JsonProperty(value = "properties") + private LabVirtualMachineCreationParameterProperties innerProperties; + /* * The name of the virtual machine or environment */ @@ -35,155 +41,17 @@ public class LabVirtualMachineCreationParameter { * The tags of the resource. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /* - * The number of virtual machine instances to create. - */ - @JsonProperty(value = "properties.bulkCreationParameters") - private BulkCreationParameters bulkCreationParameters; - - /* - * The notes of the virtual machine. - */ - @JsonProperty(value = "properties.notes") - private String notes; - - /* - * The object identifier of the owner of the virtual machine. - */ - @JsonProperty(value = "properties.ownerObjectId") - private String ownerObjectId; - - /* - * The user principal name of the virtual machine owner. - */ - @JsonProperty(value = "properties.ownerUserPrincipalName") - private String ownerUserPrincipalName; - - /* - * The creation date of the virtual machine. - */ - @JsonProperty(value = "properties.createdDate") - private OffsetDateTime createdDate; - - /* - * The custom image identifier of the virtual machine. - */ - @JsonProperty(value = "properties.customImageId") - private String customImageId; - - /* - * The size of the virtual machine. - */ - @JsonProperty(value = "properties.size") - private String size; - - /* - * The user name of the virtual machine. - */ - @JsonProperty(value = "properties.userName") - private String username; - - /* - * The password of the virtual machine administrator. - */ - @JsonProperty(value = "properties.password") - private String password; - - /* - * The SSH key of the virtual machine administrator. - */ - @JsonProperty(value = "properties.sshKey") - private String sshKey; - - /* - * Indicates whether this virtual machine uses an SSH key for - * authentication. - */ - @JsonProperty(value = "properties.isAuthenticationWithSshKey") - private Boolean isAuthenticationWithSshKey; - - /* - * The lab subnet name of the virtual machine. - */ - @JsonProperty(value = "properties.labSubnetName") - private String labSubnetName; - - /* - * The lab virtual network identifier of the virtual machine. - */ - @JsonProperty(value = "properties.labVirtualNetworkId") - private String labVirtualNetworkId; - - /* - * Indicates whether the virtual machine is to be created without a public - * IP address. - */ - @JsonProperty(value = "properties.disallowPublicIpAddress") - private Boolean disallowPublicIpAddress; - - /* - * The artifacts to be installed on the virtual machine. - */ - @JsonProperty(value = "properties.artifacts") - private List artifacts; - - /* - * The Microsoft Azure Marketplace image reference of the virtual machine. - */ - @JsonProperty(value = "properties.galleryImageReference") - private GalleryImageReference galleryImageReference; - - /* - * The id of the plan associated with the virtual machine image - */ - @JsonProperty(value = "properties.planId") - private String planId; - - /* - * The network interface properties. - */ - @JsonProperty(value = "properties.networkInterface") - private NetworkInterfaceProperties networkInterface; - - /* - * The expiration date for VM. - */ - @JsonProperty(value = "properties.expirationDate") - private OffsetDateTime expirationDate; - - /* - * Indicates whether another user can take ownership of the virtual machine - */ - @JsonProperty(value = "properties.allowClaim") - private Boolean allowClaim; - - /* - * Storage type to use for virtual machine (i.e. Standard, Premium). - */ - @JsonProperty(value = "properties.storageType") - private String storageType; - - /* - * The resource ID of the environment that contains this virtual machine, - * if any. - */ - @JsonProperty(value = "properties.environmentId") - private String environmentId; - - /* - * New or existing data disks to attach to the virtual machine after - * creation - */ - @JsonProperty(value = "properties.dataDiskParameters") - private List dataDiskParameters; - - /* - * Virtual Machine schedules to be created + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.scheduleParameters") - private List scheduleParameters; + private LabVirtualMachineCreationParameterProperties innerProperties() { + return this.innerProperties; + } /** * Get the name property: The name of the virtual machine or environment. @@ -251,7 +119,7 @@ public LabVirtualMachineCreationParameter withTags(Map tags) { * @return the bulkCreationParameters value. */ public BulkCreationParameters bulkCreationParameters() { - return this.bulkCreationParameters; + return this.innerProperties() == null ? null : this.innerProperties().bulkCreationParameters(); } /** @@ -262,7 +130,10 @@ public BulkCreationParameters bulkCreationParameters() { */ public LabVirtualMachineCreationParameter withBulkCreationParameters( BulkCreationParameters bulkCreationParameters) { - this.bulkCreationParameters = bulkCreationParameters; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withBulkCreationParameters(bulkCreationParameters); return this; } @@ -272,7 +143,7 @@ public LabVirtualMachineCreationParameter withBulkCreationParameters( * @return the notes value. */ public String notes() { - return this.notes; + return this.innerProperties() == null ? null : this.innerProperties().notes(); } /** @@ -282,7 +153,10 @@ public String notes() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withNotes(String notes) { - this.notes = notes; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withNotes(notes); return this; } @@ -292,7 +166,7 @@ public LabVirtualMachineCreationParameter withNotes(String notes) { * @return the ownerObjectId value. */ public String ownerObjectId() { - return this.ownerObjectId; + return this.innerProperties() == null ? null : this.innerProperties().ownerObjectId(); } /** @@ -302,7 +176,10 @@ public String ownerObjectId() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withOwnerObjectId(String ownerObjectId) { - this.ownerObjectId = ownerObjectId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withOwnerObjectId(ownerObjectId); return this; } @@ -312,7 +189,7 @@ public LabVirtualMachineCreationParameter withOwnerObjectId(String ownerObjectId * @return the ownerUserPrincipalName value. */ public String ownerUserPrincipalName() { - return this.ownerUserPrincipalName; + return this.innerProperties() == null ? null : this.innerProperties().ownerUserPrincipalName(); } /** @@ -322,7 +199,10 @@ public String ownerUserPrincipalName() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withOwnerUserPrincipalName(String ownerUserPrincipalName) { - this.ownerUserPrincipalName = ownerUserPrincipalName; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withOwnerUserPrincipalName(ownerUserPrincipalName); return this; } @@ -332,7 +212,7 @@ public LabVirtualMachineCreationParameter withOwnerUserPrincipalName(String owne * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -342,7 +222,10 @@ public OffsetDateTime createdDate() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withCreatedDate(OffsetDateTime createdDate) { - this.createdDate = createdDate; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withCreatedDate(createdDate); return this; } @@ -352,7 +235,7 @@ public LabVirtualMachineCreationParameter withCreatedDate(OffsetDateTime created * @return the customImageId value. */ public String customImageId() { - return this.customImageId; + return this.innerProperties() == null ? null : this.innerProperties().customImageId(); } /** @@ -362,7 +245,10 @@ public String customImageId() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withCustomImageId(String customImageId) { - this.customImageId = customImageId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withCustomImageId(customImageId); return this; } @@ -372,7 +258,7 @@ public LabVirtualMachineCreationParameter withCustomImageId(String customImageId * @return the size value. */ public String size() { - return this.size; + return this.innerProperties() == null ? null : this.innerProperties().size(); } /** @@ -382,7 +268,10 @@ public String size() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withSize(String size) { - this.size = size; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withSize(size); return this; } @@ -392,7 +281,7 @@ public LabVirtualMachineCreationParameter withSize(String size) { * @return the username value. */ public String username() { - return this.username; + return this.innerProperties() == null ? null : this.innerProperties().username(); } /** @@ -402,7 +291,10 @@ public String username() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withUsername(String username) { - this.username = username; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withUsername(username); return this; } @@ -412,7 +304,7 @@ public LabVirtualMachineCreationParameter withUsername(String username) { * @return the password value. */ public String password() { - return this.password; + return this.innerProperties() == null ? null : this.innerProperties().password(); } /** @@ -422,7 +314,10 @@ public String password() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withPassword(String password) { - this.password = password; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withPassword(password); return this; } @@ -432,7 +327,7 @@ public LabVirtualMachineCreationParameter withPassword(String password) { * @return the sshKey value. */ public String sshKey() { - return this.sshKey; + return this.innerProperties() == null ? null : this.innerProperties().sshKey(); } /** @@ -442,7 +337,10 @@ public String sshKey() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withSshKey(String sshKey) { - this.sshKey = sshKey; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withSshKey(sshKey); return this; } @@ -453,7 +351,7 @@ public LabVirtualMachineCreationParameter withSshKey(String sshKey) { * @return the isAuthenticationWithSshKey value. */ public Boolean isAuthenticationWithSshKey() { - return this.isAuthenticationWithSshKey; + return this.innerProperties() == null ? null : this.innerProperties().isAuthenticationWithSshKey(); } /** @@ -464,7 +362,10 @@ public Boolean isAuthenticationWithSshKey() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withIsAuthenticationWithSshKey(Boolean isAuthenticationWithSshKey) { - this.isAuthenticationWithSshKey = isAuthenticationWithSshKey; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withIsAuthenticationWithSshKey(isAuthenticationWithSshKey); return this; } @@ -474,7 +375,7 @@ public LabVirtualMachineCreationParameter withIsAuthenticationWithSshKey(Boolean * @return the labSubnetName value. */ public String labSubnetName() { - return this.labSubnetName; + return this.innerProperties() == null ? null : this.innerProperties().labSubnetName(); } /** @@ -484,7 +385,10 @@ public String labSubnetName() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withLabSubnetName(String labSubnetName) { - this.labSubnetName = labSubnetName; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withLabSubnetName(labSubnetName); return this; } @@ -494,7 +398,7 @@ public LabVirtualMachineCreationParameter withLabSubnetName(String labSubnetName * @return the labVirtualNetworkId value. */ public String labVirtualNetworkId() { - return this.labVirtualNetworkId; + return this.innerProperties() == null ? null : this.innerProperties().labVirtualNetworkId(); } /** @@ -504,7 +408,10 @@ public String labVirtualNetworkId() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withLabVirtualNetworkId(String labVirtualNetworkId) { - this.labVirtualNetworkId = labVirtualNetworkId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withLabVirtualNetworkId(labVirtualNetworkId); return this; } @@ -515,7 +422,7 @@ public LabVirtualMachineCreationParameter withLabVirtualNetworkId(String labVirt * @return the disallowPublicIpAddress value. */ public Boolean disallowPublicIpAddress() { - return this.disallowPublicIpAddress; + return this.innerProperties() == null ? null : this.innerProperties().disallowPublicIpAddress(); } /** @@ -526,7 +433,10 @@ public Boolean disallowPublicIpAddress() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withDisallowPublicIpAddress(Boolean disallowPublicIpAddress) { - this.disallowPublicIpAddress = disallowPublicIpAddress; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withDisallowPublicIpAddress(disallowPublicIpAddress); return this; } @@ -536,7 +446,7 @@ public LabVirtualMachineCreationParameter withDisallowPublicIpAddress(Boolean di * @return the artifacts value. */ public List artifacts() { - return this.artifacts; + return this.innerProperties() == null ? null : this.innerProperties().artifacts(); } /** @@ -546,7 +456,10 @@ public List artifacts() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withArtifacts(List artifacts) { - this.artifacts = artifacts; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withArtifacts(artifacts); return this; } @@ -556,7 +469,7 @@ public LabVirtualMachineCreationParameter withArtifacts(List dataDiskParameters() { - return this.dataDiskParameters; + return this.innerProperties() == null ? null : this.innerProperties().dataDiskParameters(); } /** @@ -706,7 +640,10 @@ public List dataDiskParameters() { * @return the LabVirtualMachineCreationParameter object itself. */ public LabVirtualMachineCreationParameter withDataDiskParameters(List dataDiskParameters) { - this.dataDiskParameters = dataDiskParameters; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withDataDiskParameters(dataDiskParameters); return this; } @@ -716,7 +653,7 @@ public LabVirtualMachineCreationParameter withDataDiskParameters(List scheduleParameters() { - return this.scheduleParameters; + return this.innerProperties() == null ? null : this.innerProperties().scheduleParameters(); } /** @@ -727,7 +664,10 @@ public List scheduleParameters() { */ public LabVirtualMachineCreationParameter withScheduleParameters( List scheduleParameters) { - this.scheduleParameters = scheduleParameters; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterProperties(); + } + this.innerProperties().withScheduleParameters(scheduleParameters); return this; } @@ -737,23 +677,8 @@ public LabVirtualMachineCreationParameter withScheduleParameters( * @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()); + if (innerProperties() != null) { + innerProperties().validate(); } } } 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 60feabce04c6..16d2b8d49e4a 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** A virtual machine. */ -@Immutable +@Fluent public final class LabVirtualMachineFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabVirtualMachineFragment.class); 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 new file mode 100644 index 000000000000..e433eee18330 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineProperties.java @@ -0,0 +1,267 @@ +// 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.LabVirtualMachinePropertiesInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of LabVirtualMachineProperties. */ +public interface LabVirtualMachineProperties { + /** + * Gets the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + String notes(); + + /** + * Gets the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + String ownerObjectId(); + + /** + * Gets the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @return the ownerUserPrincipalName value. + */ + String ownerUserPrincipalName(); + + /** + * Gets the createdByUserId property: The object identifier of the creator of the virtual machine. + * + * @return the createdByUserId value. + */ + String createdByUserId(); + + /** + * Gets the createdByUser property: The email address of creator of the virtual machine. + * + * @return the createdByUser value. + */ + String createdByUser(); + + /** + * Gets the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the computeId property: The resource identifier (Microsoft.Compute) of the virtual machine. + * + * @return the computeId value. + */ + String computeId(); + + /** + * Gets the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. + */ + String customImageId(); + + /** + * Gets the osType property: The OS type of the virtual machine. + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the size property: The size of the virtual machine. + * + * @return the size value. + */ + String size(); + + /** + * Gets the username property: The user name of the virtual machine. + * + * @return the username value. + */ + String username(); + + /** + * Gets the password property: The password of the virtual machine administrator. + * + * @return the password value. + */ + String password(); + + /** + * Gets the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. + */ + String sshKey(); + + /** + * Gets the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @return the isAuthenticationWithSshKey value. + */ + Boolean isAuthenticationWithSshKey(); + + /** + * Gets the fqdn property: The fully-qualified domain name of the virtual machine. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. + */ + String labSubnetName(); + + /** + * Gets the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. + */ + String labVirtualNetworkId(); + + /** + * Gets the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a + * public IP address. + * + * @return the disallowPublicIpAddress value. + */ + Boolean disallowPublicIpAddress(); + + /** + * Gets the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. + */ + List artifacts(); + + /** + * Gets the artifactDeploymentStatus property: The artifact deployment status for the virtual machine. + * + * @return the artifactDeploymentStatus value. + */ + ArtifactDeploymentStatusProperties artifactDeploymentStatus(); + + /** + * Gets the galleryImageReference property: The Microsoft Azure Marketplace image reference of the virtual machine. + * + * @return the galleryImageReference value. + */ + GalleryImageReference galleryImageReference(); + + /** + * Gets the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. + */ + String planId(); + + /** + * Gets the computeVm property: The compute virtual machine properties. + * + * @return the computeVm value. + */ + ComputeVmProperties computeVm(); + + /** + * Gets the networkInterface property: The network interface properties. + * + * @return the networkInterface value. + */ + NetworkInterfaceProperties networkInterface(); + + /** + * Gets the applicableSchedule property: The applicable schedule for the virtual machine. + * + * @return the applicableSchedule value. + */ + ApplicableSchedule applicableSchedule(); + + /** + * Gets the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. + */ + OffsetDateTime expirationDate(); + + /** + * Gets the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. + */ + Boolean allowClaim(); + + /** + * Gets the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium). + * + * @return the storageType value. + */ + String storageType(); + + /** + * Gets the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property + * only. + * + * @return the virtualMachineCreationSource value. + */ + VirtualMachineCreationSource virtualMachineCreationSource(); + + /** + * Gets the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. + */ + List dataDiskParameters(); + + /** + * Gets the scheduleParameters property: Virtual Machine schedules to be created. + * + * @return the scheduleParameters value. + */ + List scheduleParameters(); + + /** + * Gets the lastKnownPowerState property: Last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value. + */ + String lastKnownPowerState(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachinePropertiesInner object. + * + * @return the inner object. + */ + LabVirtualMachinePropertiesInner innerModel(); +} 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 f95756995d12..8784237383df 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** A notification. */ -@Immutable +@Fluent public final class NotificationChannelFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationChannelFragment.class); 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 92b3b1f13b57..e95b2df7125e 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** A Policy. */ -@Immutable +@Fluent public final class PolicyFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyFragment.class); 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 df984223e28b..9b9ea69f7d95 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 @@ -5,18 +5,24 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleCreationParameterProperties; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Properties for creating a schedule. */ -@JsonFlatten @Fluent -public class ScheduleCreationParameter { +public final class ScheduleCreationParameter { @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleCreationParameter.class); + /* + * The properties of the schedule. + */ + @JsonProperty(value = "properties") + private ScheduleCreationParameterProperties innerProperties; + /* * The name of the virtual machine or environment */ @@ -26,65 +32,24 @@ public class ScheduleCreationParameter { /* * The location of the new virtual machine or environment */ - @JsonProperty(value = "location") + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; /* * The tags of the resource. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /* - * The status of the schedule (i.e. Enabled, Disabled) - */ - @JsonProperty(value = "properties.status") - private EnableStatus status; - - /* - * The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). - */ - @JsonProperty(value = "properties.taskType") - private String taskType; - - /* - * If the schedule will occur only some days of the week, specify the - * weekly recurrence. - */ - @JsonProperty(value = "properties.weeklyRecurrence") - private WeekDetails weeklyRecurrence; - - /* - * If the schedule will occur once each day of the week, specify the daily - * recurrence. - */ - @JsonProperty(value = "properties.dailyRecurrence") - private DayDetails dailyRecurrence; - - /* - * If the schedule will occur multiple times a day, specify the hourly - * recurrence. - */ - @JsonProperty(value = "properties.hourlyRecurrence") - private HourDetails hourlyRecurrence; - - /* - * The time zone ID (e.g. Pacific Standard time). - */ - @JsonProperty(value = "properties.timeZoneId") - private String timeZoneId; - - /* - * Notification settings. - */ - @JsonProperty(value = "properties.notificationSettings") - private NotificationSettings notificationSettings; - - /* - * The resource ID to which the schedule belongs + /** + * Get the innerProperties property: The properties of the schedule. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.targetResourceId") - private String targetResourceId; + private ScheduleCreationParameterProperties innerProperties() { + return this.innerProperties; + } /** * Get the name property: The name of the virtual machine or environment. @@ -115,17 +80,6 @@ public String location() { return this.location; } - /** - * Set the location property: The location of the new virtual machine or environment. - * - * @param location the location value to set. - * @return the ScheduleCreationParameter object itself. - */ - public ScheduleCreationParameter withLocation(String location) { - this.location = location; - return this; - } - /** * Get the tags property: The tags of the resource. * @@ -152,7 +106,7 @@ public ScheduleCreationParameter withTags(Map tags) { * @return the status value. */ public EnableStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -162,7 +116,10 @@ public EnableStatus status() { * @return the ScheduleCreationParameter object itself. */ public ScheduleCreationParameter withStatus(EnableStatus status) { - this.status = status; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withStatus(status); return this; } @@ -172,7 +129,7 @@ public ScheduleCreationParameter withStatus(EnableStatus status) { * @return the taskType value. */ public String taskType() { - return this.taskType; + return this.innerProperties() == null ? null : this.innerProperties().taskType(); } /** @@ -182,7 +139,10 @@ public String taskType() { * @return the ScheduleCreationParameter object itself. */ public ScheduleCreationParameter withTaskType(String taskType) { - this.taskType = taskType; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withTaskType(taskType); return this; } @@ -193,7 +153,7 @@ public ScheduleCreationParameter withTaskType(String taskType) { * @return the weeklyRecurrence value. */ public WeekDetails weeklyRecurrence() { - return this.weeklyRecurrence; + return this.innerProperties() == null ? null : this.innerProperties().weeklyRecurrence(); } /** @@ -204,7 +164,10 @@ public WeekDetails weeklyRecurrence() { * @return the ScheduleCreationParameter object itself. */ public ScheduleCreationParameter withWeeklyRecurrence(WeekDetails weeklyRecurrence) { - this.weeklyRecurrence = weeklyRecurrence; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withWeeklyRecurrence(weeklyRecurrence); return this; } @@ -215,7 +178,7 @@ public ScheduleCreationParameter withWeeklyRecurrence(WeekDetails weeklyRecurren * @return the dailyRecurrence value. */ public DayDetails dailyRecurrence() { - return this.dailyRecurrence; + return this.innerProperties() == null ? null : this.innerProperties().dailyRecurrence(); } /** @@ -226,7 +189,10 @@ public DayDetails dailyRecurrence() { * @return the ScheduleCreationParameter object itself. */ public ScheduleCreationParameter withDailyRecurrence(DayDetails dailyRecurrence) { - this.dailyRecurrence = dailyRecurrence; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withDailyRecurrence(dailyRecurrence); return this; } @@ -237,7 +203,7 @@ public ScheduleCreationParameter withDailyRecurrence(DayDetails dailyRecurrence) * @return the hourlyRecurrence value. */ public HourDetails hourlyRecurrence() { - return this.hourlyRecurrence; + return this.innerProperties() == null ? null : this.innerProperties().hourlyRecurrence(); } /** @@ -248,7 +214,10 @@ public HourDetails hourlyRecurrence() { * @return the ScheduleCreationParameter object itself. */ public ScheduleCreationParameter withHourlyRecurrence(HourDetails hourlyRecurrence) { - this.hourlyRecurrence = hourlyRecurrence; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withHourlyRecurrence(hourlyRecurrence); return this; } @@ -258,7 +227,7 @@ public ScheduleCreationParameter withHourlyRecurrence(HourDetails hourlyRecurren * @return the timeZoneId value. */ public String timeZoneId() { - return this.timeZoneId; + return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); } /** @@ -268,7 +237,10 @@ public String timeZoneId() { * @return the ScheduleCreationParameter object itself. */ public ScheduleCreationParameter withTimeZoneId(String timeZoneId) { - this.timeZoneId = timeZoneId; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withTimeZoneId(timeZoneId); return this; } @@ -278,7 +250,7 @@ public ScheduleCreationParameter withTimeZoneId(String timeZoneId) { * @return the notificationSettings value. */ public NotificationSettings notificationSettings() { - return this.notificationSettings; + return this.innerProperties() == null ? null : this.innerProperties().notificationSettings(); } /** @@ -288,7 +260,10 @@ public NotificationSettings notificationSettings() { * @return the ScheduleCreationParameter object itself. */ public ScheduleCreationParameter withNotificationSettings(NotificationSettings notificationSettings) { - this.notificationSettings = notificationSettings; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withNotificationSettings(notificationSettings); return this; } @@ -298,7 +273,7 @@ public ScheduleCreationParameter withNotificationSettings(NotificationSettings n * @return the targetResourceId value. */ public String targetResourceId() { - return this.targetResourceId; + return this.innerProperties() == null ? null : this.innerProperties().targetResourceId(); } /** @@ -308,7 +283,10 @@ public String targetResourceId() { * @return the ScheduleCreationParameter object itself. */ public ScheduleCreationParameter withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withTargetResourceId(targetResourceId); return this; } @@ -318,17 +296,8 @@ public ScheduleCreationParameter withTargetResourceId(String targetResourceId) { * @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(); + if (innerProperties() != null) { + innerProperties().validate(); } } } 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 6b6cab823f1c..d1a699ec06eb 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** A schedule. */ -@Immutable +@Fluent public final class ScheduleFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleFragment.class); 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 979efbf3b2ad..0b136c5586f9 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** A secret. */ -@Immutable +@Fluent public final class SecretFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretFragment.class); 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 62f21e5a80ac..7db7019a9c9d 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** A Service Fabric. */ -@Immutable +@Fluent public final class ServiceFabricFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceFabricFragment.class); 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 new file mode 100644 index 000000000000..bf5c70a0b720 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricPropertiesInner; + +/** An immutable client-side representation of ServiceFabricProperties. */ +public interface ServiceFabricProperties { + /** + * Gets the externalServiceFabricId property: The backing service fabric resource's id. + * + * @return the externalServiceFabricId value. + */ + String externalServiceFabricId(); + + /** + * Gets the environmentId property: The resource id of the environment under which the service fabric resource is + * present. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the applicableSchedule property: The applicable schedule for the virtual machine. + * + * @return the applicableSchedule value. + */ + ApplicableSchedule applicableSchedule(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricPropertiesInner object. + * + * @return the inner object. + */ + ServiceFabricPropertiesInner innerModel(); +} 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 610fd09c3948..bde21d60c467 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 @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public class UpdateResource { * The tags of the resource. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map 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 e2b92acdcd07..e1c4e114ab05 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** Profile of a lab user. */ -@Immutable +@Fluent public final class UserFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(UserFragment.class); 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 c428930a8331..d7f20285147b 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 @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** A virtual network. */ -@Immutable +@Fluent public final class VirtualNetworkFragment extends UpdateResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkFragment.class); 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 new file mode 100644 index 000000000000..bd019adbc07d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ArmTemplates Get. */ +public final class ArmTemplatesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_Get.json + */ + /** + * Sample code: ArmTemplates_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void armTemplatesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .armTemplates() + .getWithResponse( + "resourceGroupName", "{labName}", "{artifactSourceName}", "{armTemplateName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..79c4a5998f9b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ArmTemplates List. */ +public final class ArmTemplatesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_List.json + */ + /** + * Sample code: ArmTemplates_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void armTemplatesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .armTemplates() + .list("resourceGroupName", "{labName}", "{artifactSourceName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..21c0ba449b6e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesCreateOrUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.SourceControlType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ArtifactSources CreateOrUpdate. */ +public final class ArtifactSourcesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_CreateOrUpdate.json + */ + /** + * Sample code: ArtifactSources_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + 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}") + .withUri("{artifactSourceUri}") + .withSourceType(SourceControlType.fromString("{VsoGit|GitHub|StorageAccount}")) + .withFolderPath("{folderPath}") + .withArmTemplateFolderPath("{armTemplateFolderPath}") + .withBranchRef("{branchRef}") + .withSecurityToken("{securityToken}") + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..06f05beee76b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ArtifactSources Delete. */ +public final class ArtifactSourcesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Delete.json + */ + /** + * Sample code: ArtifactSources_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifactSources() + .deleteWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..dbbe4fea4768 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ArtifactSources Get. */ +public final class ArtifactSourcesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Get.json + */ + /** + * Sample code: ArtifactSources_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifactSources() + .getWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..5c376795bcbb --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ArtifactSources List. */ +public final class ArtifactSourcesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_List.json + */ + /** + * Sample code: ArtifactSources_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.artifactSources().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..af21fe052756 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ArtifactSource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ArtifactSources Update. */ +public final class ArtifactSourcesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Update.json + */ + /** + * Sample code: ArtifactSources_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + ArtifactSource resource = + manager + .artifactSources() + .getWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..69528e342756 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.FileUploadOptions; +import com.azure.resourcemanager.devtestlabs.models.GenerateArmTemplateRequest; + +/** Samples for Artifacts GenerateArmTemplate. */ +public final class ArtifactsGenerateArmTemplateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_GenerateArmTemplate.json + */ + /** + * Sample code: Artifacts_GenerateArmTemplate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactsGenerateArmTemplate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifacts() + .generateArmTemplateWithResponse( + "resourceGroupName", + "{labName}", + "{artifactSourceName}", + "{artifactName}", + new GenerateArmTemplateRequest() + .withVirtualMachineName("{vmName}") + .withLocation("{location}") + .withFileUploadOptions(FileUploadOptions.NONE), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..cdf99a7a6998 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Artifacts Get. */ +public final class ArtifactsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_Get.json + */ + /** + * Sample code: Artifacts_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifacts() + .getWithResponse( + "resourceGroupName", "{labName}", "{artifactSourceName}", "{artifactName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..6e76245ce505 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Artifacts List. */ +public final class ArtifactsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_List.json + */ + /** + * Sample code: Artifacts_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifacts() + .list("resourceGroupName", "{labName}", "{artifactSourceName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..ba26ab776e6b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsCreateOrUpdateSamples.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.CostThresholdProperties; +import com.azure.resourcemanager.devtestlabs.models.CostThresholdStatus; +import com.azure.resourcemanager.devtestlabs.models.PercentageCostThresholdProperties; +import com.azure.resourcemanager.devtestlabs.models.ReportingCycleType; +import com.azure.resourcemanager.devtestlabs.models.TargetCostProperties; +import com.azure.resourcemanager.devtestlabs.models.TargetCostStatus; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Costs CreateOrUpdate. */ +public final class CostsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_CreateOrUpdate.json + */ + /** + * Sample code: Costs_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + 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) + .withCostThresholds( + Arrays + .asList( + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000001") + .withPercentageThreshold( + new PercentageCostThresholdProperties().withThresholdValue(25.0)) + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000002") + .withPercentageThreshold( + new PercentageCostThresholdProperties().withThresholdValue(50.0)) + .withDisplayOnChart(CostThresholdStatus.ENABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.ENABLED), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000003") + .withPercentageThreshold( + new PercentageCostThresholdProperties().withThresholdValue(75.0)) + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000004") + .withPercentageThreshold( + new PercentageCostThresholdProperties().withThresholdValue(100.0)) + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000005") + .withPercentageThreshold( + new PercentageCostThresholdProperties().withThresholdValue(125.0)) + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED))) + .withCycleStartDateTime(OffsetDateTime.parse("2020-12-01T00:00:00.000Z")) + .withCycleEndDateTime(OffsetDateTime.parse("2020-12-31T00:00:00.000Z")) + .withCycleType(ReportingCycleType.CALENDAR_MONTH)) + .withCurrencyCode("USD") + .withStartDateTime(OffsetDateTime.parse("2020-12-01T00:00:00Z")) + .withEndDateTime(OffsetDateTime.parse("2020-12-31T23:59:59Z")) + .create(); + } +} 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 new file mode 100644 index 000000000000..2ac339bdc314 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Costs Get. */ +public final class CostsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_Get.json + */ + /** + * Sample code: Costs_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void costsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.costs().getWithResponse("resourceGroupName", "{labName}", "targetCost", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..a2f335e768ea --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromVm; +import com.azure.resourcemanager.devtestlabs.models.LinuxOsInfo; +import com.azure.resourcemanager.devtestlabs.models.LinuxOsState; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CustomImages CreateOrUpdate. */ +public final class CustomImagesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_CreateOrUpdate.json + */ + /** + * Sample code: CustomImages_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + 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( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}") + .withLinuxOsInfo(new LinuxOsInfo().withLinuxOsState(LinuxOsState.NON_DEPROVISIONED))) + .withDescription("My Custom Image") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..e8d88afe2d15 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomImages Delete. */ +public final class CustomImagesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Delete.json + */ + /** + * Sample code: CustomImages_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.customImages().delete("resourceGroupName", "{labName}", "{customImageName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..6b89447df943 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomImages Get. */ +public final class CustomImagesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Get.json + */ + /** + * Sample code: CustomImages_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .customImages() + .getWithResponse("resourceGroupName", "{labName}", "{customImageName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..dba53ef3aa42 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomImages List. */ +public final class CustomImagesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_List.json + */ + /** + * Sample code: CustomImages_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.customImages().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..b93f58489968 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.CustomImage; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CustomImages Update. */ +public final class CustomImagesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Update.json + */ + /** + * Sample code: CustomImages_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + CustomImage resource = + manager + .customImages() + .getWithResponse("resourceGroupName", "{labName}", "{customImageName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..55d4a772bb70 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.AttachDiskProperties; + +/** Samples for Disks Attach. */ +public final class DisksAttachSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Attach.json + */ + /** + * Sample code: Disks_Attach. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksAttach(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .disks() + .attach( + "resourceGroupName", + "{labName}", + "{userId}", + "{diskName}", + new AttachDiskProperties() + .withLeasedByLabVmId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..f6b720a1c9bf --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.StorageType; + +/** Samples for Disks CreateOrUpdate. */ +public final class DisksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_CreateOrUpdate.json + */ + /** + * Sample code: Disks_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + 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) + .withLeasedByLabVmId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName") + .create(); + } +} 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 new file mode 100644 index 000000000000..ff4baa579633 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Disks Delete. */ +public final class DisksDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Delete.json + */ + /** + * Sample code: Disks_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.disks().delete("resourceGroupName", "{labName}", "{userId}", "{diskName}", 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 new file mode 100644 index 000000000000..4b499939bd20 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DetachDiskProperties; + +/** Samples for Disks Detach. */ +public final class DisksDetachSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Detach.json + */ + /** + * Sample code: Disks_Detach. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksDetach(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .disks() + .detach( + "resourceGroupName", + "{labName}", + "{userId}", + "{diskName}", + new DetachDiskProperties() + .withLeasedByLabVmId( + "/subscriptions/{subscriptionId}/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..f97f479e1105 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Disks Get. */ +public final class DisksGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Get.json + */ + /** + * Sample code: Disks_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.disks().getWithResponse("resourceGroupName", "{labName}", "@me", "{diskName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..7e415084f7dc --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Disks List. */ +public final class DisksListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_List.json + */ + /** + * Sample code: Disks_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.disks().list("resourceGroupName", "{labName}", "@me", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..e872edd0424f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Disk; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Disks Update. */ +public final class DisksUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Update.json + */ + /** + * Sample code: Disks_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Disk resource = + manager + .disks() + .getWithResponse("resourceGroupName", "{labName}", "@me", "diskName", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..940a0de10b3d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.EnvironmentDeploymentProperties; +import java.util.Arrays; + +/** Samples for Environments CreateOrUpdate. */ +public final class EnvironmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_CreateOrUpdate.json + */ + /** + * Sample code: Environments_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + 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}") + .withParameters(Arrays.asList())) + .create(); + } +} 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 new file mode 100644 index 000000000000..9b3f43cedef5 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Environments Delete. */ +public final class EnvironmentsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Delete.json + */ + /** + * Sample code: Environments_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.environments().delete("resourceGroupName", "{labName}", "@me", "{environmentName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..07940c169530 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Environments Get. */ +public final class EnvironmentsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Get.json + */ + /** + * Sample code: Environments_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .environments() + .getWithResponse("resourceGroupName", "{labName}", "@me", "{environmentName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..d75a1371f58c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Environments List. */ +public final class EnvironmentsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_List.json + */ + /** + * Sample code: Environments_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.environments().list("resourceGroupName", "{labName}", "@me", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..58bd14ea8fbb --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DtlEnvironment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Environments Update. */ +public final class EnvironmentsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Update.json + */ + /** + * Sample code: Environments_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + DtlEnvironment resource = + manager + .environments() + .getWithResponse("resourceGroupName", "{labName}", "@me", "{environmentName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..9ed89bc975a7 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.NetworkInterfaceProperties; +import com.azure.resourcemanager.devtestlabs.models.SharedPublicIpAddressConfiguration; +import com.azure.resourcemanager.devtestlabs.models.TransportProtocol; +import java.util.Arrays; + +/** Samples for Formulas CreateOrUpdate. */ +public final class FormulasCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_CreateOrUpdate.json + */ + /** + * Sample code: Formulas_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .formulas() + .define("{formulaName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withDescription("Formula using a Linux base") + .withFormulaContent( + new LabVirtualMachineCreationParameter() + .withLocation("{location}") + .withNotes("Ubuntu Server 20.10") + .withSize("Standard_B1ms") + .withUsername("user") + .withIsAuthenticationWithSshKey(false) + .withLabSubnetName("Dtl{labName}Subnet") + .withLabVirtualNetworkId("/virtualnetworks/dtl{labName}") + .withDisallowPublicIpAddress(true) + .withArtifacts( + Arrays + .asList( + new ArtifactInstallProperties() + .withArtifactId( + "/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs") + .withParameters(Arrays.asList()))) + .withGalleryImageReference( + new GalleryImageReference() + .withOffer("0001-com-ubuntu-server-groovy") + .withPublisher("canonical") + .withSku("20_10") + .withOsType("Linux") + .withVersion("latest")) + .withNetworkInterface( + new NetworkInterfaceProperties() + .withSharedPublicIpAddressConfiguration( + new SharedPublicIpAddressConfiguration() + .withInboundNatRules( + Arrays + .asList( + new InboundNatRule() + .withTransportProtocol(TransportProtocol.TCP) + .withBackendPort(22))))) + .withAllowClaim(false) + .withStorageType("Standard")) + .create(); + } +} 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 new file mode 100644 index 000000000000..5e1125793cfa --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Formulas Delete. */ +public final class FormulasDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Delete.json + */ + /** + * Sample code: Formulas_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.formulas().deleteWithResponse("resourceGroupName", "{labName}", "{formulaName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..d5961e8b6d34 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Formulas Get. */ +public final class FormulasGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Get.json + */ + /** + * Sample code: Formulas_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.formulas().getWithResponse("resourceGroupName", "{labName}", "{formulaName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..0d5b6f5020d2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Formulas List. */ +public final class FormulasListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_List.json + */ + /** + * Sample code: Formulas_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.formulas().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..9f1c4cd71400 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Formula; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Formulas Update. */ +public final class FormulasUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Update.json + */ + /** + * Sample code: Formulas_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Formula resource = + manager + .formulas() + .getWithResponse("resourceGroupName", "{labName}", "{formulaName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..fd317353ea35 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GalleryImages List. */ +public final class GalleryImagesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GalleryImages_List.json + */ + /** + * Sample code: GalleryImages_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void galleryImagesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.galleryImages().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..c8429d0eb8b3 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.WeekDetails; +import java.util.Arrays; + +/** Samples for GlobalSchedules CreateOrUpdate. */ +public final class GlobalSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_CreateOrUpdate.json + */ + /** + * Sample code: GlobalSchedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .globalSchedules() + .define("labvmautostart") + .withRegion((String) null) + .withExistingResourceGroup("resourceGroupName") + .withStatus(EnableStatus.ENABLED) + .withTaskType("LabVmsStartupTask") + .withWeeklyRecurrence( + new WeekDetails() + .withWeekdays(Arrays.asList("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")) + .withTime("0700")) + .withTimeZoneId("Hawaiian Standard Time") + .create(); + } +} 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 new file mode 100644 index 000000000000..e4db98888e3f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules Delete. */ +public final class GlobalSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Delete.json + */ + /** + * Sample code: GlobalSchedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().deleteWithResponse("resourceGroupName", "labvmautostart", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..e654e8e4191c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules Execute. */ +public final class GlobalSchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Execute.json + */ + /** + * Sample code: GlobalSchedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesExecute(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().execute("resourceGroupName", "labvmautostart", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..ec91bd259912 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules GetByResourceGroup. */ +public final class GlobalSchedulesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Get.json + */ + /** + * Sample code: GlobalSchedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .globalSchedules() + .getByResourceGroupWithResponse("resourceGroupName", "labvmautostart", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..17dbb5e886ce --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules ListByResourceGroup. */ +public final class GlobalSchedulesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListByResourceGroup.json + */ + /** + * Sample code: GlobalSchedules_ListByResourceGroup. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesListByResourceGroup( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().listByResourceGroup("resourceGroupName", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..824e6b1651e4 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules List. */ +public final class GlobalSchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListBySubscription.json + */ + /** + * Sample code: GlobalSchedules_ListBySubscription. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesListBySubscription( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().list(null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..8978dd40bf67 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.RetargetScheduleProperties; + +/** Samples for GlobalSchedules Retarget. */ +public final class GlobalSchedulesRetargetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Retarget.json + */ + /** + * Sample code: GlobalSchedules_Retarget. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesRetarget(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .globalSchedules() + .retarget( + "resourceGroupName", + "{scheduleName}", + new RetargetScheduleProperties() + .withCurrentResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{targetLab}") + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{currentLab}"), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..ec70efc3c84a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Schedule; +import java.util.HashMap; +import java.util.Map; + +/** Samples for GlobalSchedules Update. */ +public final class GlobalSchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Update.json + */ + /** + * Sample code: GlobalSchedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Schedule resource = + manager + .globalSchedules() + .getByResourceGroupWithResponse("resourceGroupName", "labvmautostart", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..320117c0659f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs ClaimAnyVm. */ +public final class LabsClaimAnyVmSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ClaimAnyVm.json + */ + /** + * Sample code: Labs_ClaimAnyVm. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsClaimAnyVm(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().claimAnyVm("resourceGroupName", "{labName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..8862eb684feb --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateEnvironmentSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Labs CreateEnvironment. */ +public final class LabsCreateEnvironmentSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateEnvironment.json + */ + /** + * Sample code: Labs_CreateEnvironment. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsCreateEnvironment(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .createEnvironment( + "resourceGroupName", + "{labName}", + new LabVirtualMachineCreationParameter() + .withName("{vmName}") + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withSize("Standard_A2_v2") + .withUsername("{userName}") + .withPassword("{userPassword}") + .withLabSubnetName("{virtualnetwork-subnet-name}") + .withLabVirtualNetworkId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}") + .withDisallowPublicIpAddress(true) + .withGalleryImageReference( + new GalleryImageReference() + .withOffer("UbuntuServer") + .withPublisher("Canonical") + .withSku("16.04-LTS") + .withOsType("Linux") + .withVersion("Latest")) + .withAllowClaim(true) + .withStorageType("Standard"), + Context.NONE); + } + + @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/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 new file mode 100644 index 000000000000..238fa88d64d7 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Labs CreateOrUpdate. */ +public final class LabsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateOrUpdate.json + */ + /** + * Sample code: Labs_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .define("{labName}") + .withRegion("{location}") + .withExistingResourceGroup("resourceGroupName") + .withTags(mapOf("tagName1", "tagValue1")) + .withLabStorageType(StorageType.fromString("{Standard|Premium}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..1377af858d56 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs Delete. */ +public final class LabsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Delete.json + */ + /** + * Sample code: Labs_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().delete("resourceGroupName", "{labName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..ffd96d42d76a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ExportResourceUsageParameters; +import java.time.OffsetDateTime; + +/** Samples for Labs ExportResourceUsage. */ +public final class LabsExportResourceUsageSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ExportResourceUsage.json + */ + /** + * Sample code: Labs_ExportResourceUsage. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsExportResourceUsage(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .exportResourceUsage( + "resourceGroupName", + "{labName}", + new ExportResourceUsageParameters() + .withBlobStorageAbsoluteSasUri( + "https://invalid.blob.core.windows.net/export.blob?sv=2015-07-08&sig={sas}&sp=rcw") + .withUsageStartDate(OffsetDateTime.parse("2020-12-01T00:00:00Z")), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..b91ba27e1e8f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriParameter; + +/** Samples for Labs GenerateUploadUri. */ +public final class LabsGenerateUploadUriSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_GenerateUploadUri.json + */ + /** + * Sample code: Labs_GenerateUploadUri. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsGenerateUploadUri(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .generateUploadUriWithResponse( + "resourceGroupName", + "{labName}", + new GenerateUploadUriParameter().withBlobName("{blob-name}"), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..7c45689ec037 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs GetByResourceGroup. */ +public final class LabsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Get.json + */ + /** + * Sample code: Labs_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().getByResourceGroupWithResponse("resourceGroupName", "{labName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..47b806911bed --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineSamples.java @@ -0,0 +1,32 @@ +// 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.Context; +import com.azure.resourcemanager.devtestlabs.models.ImportLabVirtualMachineRequest; + +/** Samples for Labs ImportVirtualMachine. */ +public final class LabsImportVirtualMachineSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ImportVirtualMachine.json + */ + /** + * Sample code: Labs_ImportVirtualMachine. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsImportVirtualMachine(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .importVirtualMachine( + "resourceGroupName", + "{labName}", + new ImportLabVirtualMachineRequest() + .withSourceVirtualMachineResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{otherResourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}") + .withDestinationVirtualMachineName("{vmName}"), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..a2e90a5745b8 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs ListByResourceGroup. */ +public final class LabsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListByResourceGroup.json + */ + /** + * Sample code: Labs_ListByResourceGroup. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsListByResourceGroup(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().listByResourceGroup("resourceGroupName", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..970ce0e9fea6 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs List. */ +public final class LabsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListBySubscription.json + */ + /** + * Sample code: Labs_ListBySubscription. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsListBySubscription(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().list(null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..84c759219a5f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs ListVhds. */ +public final class LabsListVhdsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListVhds.json + */ + /** + * Sample code: Labs_ListVhds. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsListVhds(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().listVhds("resourceGroupName", "{labName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..136cb20146a4 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Lab; + +/** Samples for Labs Update. */ +public final class LabsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Update.json + */ + /** + * Sample code: Labs_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Lab resource = + manager + .labs() + .getByResourceGroupWithResponse("resourceGroupName", "{labName}", null, Context.NONE) + .getValue(); + resource.update().apply(); + } +} 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 new file mode 100644 index 000000000000..5143e43d5969 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.Event; +import com.azure.resourcemanager.devtestlabs.models.NotificationChannelEventType; +import java.util.Arrays; + +/** Samples for NotificationChannels CreateOrUpdate. */ +public final class NotificationChannelsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_CreateOrUpdate.json + */ + /** + * Sample code: NotificationChannels_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsCreateOrUpdate( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .define("{notificationChannelName}") + .withRegion((String) null) + .withExistingLab("resourceGroupName", "{labName}") + .withWebhookUrl("{webhookUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("en") + .withDescription("Integration configured for auto-shutdown") + .withEvents(Arrays.asList(new Event().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN))) + .create(); + } +} 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 new file mode 100644 index 000000000000..9ad118677dcf --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for NotificationChannels Delete. */ +public final class NotificationChannelsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Delete.json + */ + /** + * Sample code: NotificationChannels_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .deleteWithResponse("resourceGroupName", "{labName}", "{notificationChannelName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..09351a1ce352 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for NotificationChannels Get. */ +public final class NotificationChannelsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Get.json + */ + /** + * Sample code: NotificationChannels_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .getWithResponse("resourceGroupName", "{labName}", "{notificationChannelName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..348d4847252f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for NotificationChannels List. */ +public final class NotificationChannelsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_List.json + */ + /** + * Sample code: NotificationChannels_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.notificationChannels().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..731f9ed8d4cb --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifySamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.NotificationChannelEventType; +import com.azure.resourcemanager.devtestlabs.models.NotifyParameters; + +/** Samples for NotificationChannels Notify. */ +public final class NotificationChannelsNotifySamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Notify.json + */ + /** + * Sample code: NotificationChannels_Notify. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsNotify(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .notifyWithResponse( + "resourceGroupName", + "{labName}", + "{notificationChannelName}", + new NotifyParameters() + .withEventName(NotificationChannelEventType.AUTO_SHUTDOWN) + .withJsonPayload( + "{\"eventType\":\"AutoShutdown\",\"subscriptionId\":\"{subscriptionId}\",\"resourceGroupName\":\"resourceGroupName\",\"labName\":\"{labName}\"}"), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..51120aa042a0 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.NotificationChannel; + +/** Samples for NotificationChannels Update. */ +public final class NotificationChannelsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Update.json + */ + /** + * Sample code: NotificationChannels_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + NotificationChannel resource = + manager + .notificationChannels() + .getWithResponse("resourceGroupName", "{labName}", "{notificationChannelName}", null, Context.NONE) + .getValue(); + resource.update().apply(); + } +} 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 new file mode 100644 index 000000000000..45389c28b7f3 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/OperationsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations Get. */ +public final class OperationsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Operations_Get.json + */ + /** + * Sample code: Operations_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void operationsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.operations().getWithResponse("{locationName}", "{operationName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..9ea2ebd33888 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.PolicyEvaluatorType; +import com.azure.resourcemanager.devtestlabs.models.PolicyFactName; +import com.azure.resourcemanager.devtestlabs.models.PolicyStatus; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Policies CreateOrUpdate. */ +public final class PoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_CreateOrUpdate.json + */ + /** + * Sample code: Policies_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .define("{policyName}") + .withRegion("{location}") + .withExistingPolicyset("resourceGroupName", "{labName}", "{policySetName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withDescription("{policyDescription}") + .withStatus(PolicyStatus.fromString("{policyStatus}")) + .withFactName(PolicyFactName.fromString("{policyFactName}")) + .withFactData("{policyFactData}") + .withThreshold("{policyThreshold}") + .withEvaluatorType(PolicyEvaluatorType.fromString("{policyEvaluatorType}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..c31551a26824 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Policies Delete. */ +public final class PoliciesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Delete.json + */ + /** + * Sample code: Policies_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .deleteWithResponse("resourceGroupName", "{labName}", "{policySetName}", "{policyName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..19bb785a60b2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Policies Get. */ +public final class PoliciesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Get.json + */ + /** + * Sample code: Policies_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .getWithResponse("resourceGroupName", "{labName}", "{policySetName}", "{policyName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..b70c76c71e9a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Policies List. */ +public final class PoliciesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_List.json + */ + /** + * Sample code: Policies_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .list("resourceGroupName", "{labName}", "{policySetName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..fc63d05182c0 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Policy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Policies Update. */ +public final class PoliciesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Update.json + */ + /** + * Sample code: Policies_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Policy resource = + manager + .policies() + .getWithResponse( + "resourceGroupName", "{labName}", "{policySetName}", "{policyName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..44a649bdc525 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PolicySetsEvaluatePoliciesSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesProperties; +import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesRequest; +import java.util.Arrays; + +/** Samples for PolicySets EvaluatePolicies. */ +public final class PolicySetsEvaluatePoliciesSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/PolicySets_EvaluatePolicies.json + */ + /** + * Sample code: PolicySets_EvaluatePolicies. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policySetsEvaluatePolicies(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policySets() + .evaluatePoliciesWithResponse( + "resourceGroupName", + "{labName}", + "{policySetName}", + new EvaluatePoliciesRequest() + .withPolicies( + Arrays + .asList(new EvaluatePoliciesProperties().withFactName("LabVmCount").withValueOffset("1"))), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..1766021a2d75 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ProviderOperations List. */ +public final class ProviderOperationsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ProviderOperations_List.json + */ + /** + * Sample code: ProviderOperations_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void providerOperationsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.providerOperations().list(Context.NONE); + } +} 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 new file mode 100644 index 000000000000..6a0f75b98006 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateSamples.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +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; + +/** Samples for Schedules CreateOrUpdate. */ +public final class SchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_CreateOrUpdate.json + */ + /** + * Sample code: Schedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .schedules() + .createOrUpdateWithResponse( + "resourceGroupName", + "{labName}", + "{scheduleName}", + new ScheduleInner() + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTaskType("{myLabVmTaskType}") + .withWeeklyRecurrence( + new WeekDetails() + .withWeekdays(Arrays.asList("Monday", "Wednesday", "Friday")) + .withTime("{timeOfTheDayTheScheduleWillOccurOnThoseDays}")) + .withDailyRecurrence(new DayDetails().withTime("{timeOfTheDayTheScheduleWillOccurEveryDay}")) + .withHourlyRecurrence(new HourDetails().withMinute(30)) + .withTimeZoneId("Pacific Standard Time") + .withNotificationSettings( + new NotificationSettings() + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTimeInMinutes(15) + .withWebhookUrl("{webhookUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("EN")) + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"), + Context.NONE); + } + + @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/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 new file mode 100644 index 000000000000..665dfedaa07a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules Delete. */ +public final class SchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Delete.json + */ + /** + * Sample code: Schedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().deleteWithResponse("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..3f055fcccfc0 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules Execute. */ +public final class SchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Execute.json + */ + /** + * Sample code: Schedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesExecute(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().execute("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..4503fb13ac2e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules Get. */ +public final class SchedulesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Get.json + */ + /** + * Sample code: Schedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().getWithResponse("resourceGroupName", "{labName}", "{scheduleName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..4891375d4120 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules ListApplicable. */ +public final class SchedulesListApplicableSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_ListApplicable.json + */ + /** + * Sample code: Schedules_ListApplicable. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesListApplicable(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().listApplicable("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..2a7a424ba648 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules List. */ +public final class SchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_List.json + */ + /** + * Sample code: Schedules_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..be1763bd351b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Schedules Update. */ +public final class SchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Update.json + */ + /** + * Sample code: Schedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .schedules() + .updateWithResponse( + "resourceGroupName", + "{labName}", + "{scheduleName}", + new ScheduleFragment().withTags(mapOf("tagName1", "tagValue1")), + Context.NONE); + } + + @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/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 new file mode 100644 index 000000000000..d4749b0cac0c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +/** Samples for Secrets CreateOrUpdate. */ +public final class SecretsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_CreateOrUpdate.json + */ + /** + * Sample code: Secrets_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + 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 new file mode 100644 index 000000000000..3f5b457650db --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Secrets Delete. */ +public final class SecretsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Delete.json + */ + /** + * Sample code: Secrets_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .secrets() + .deleteWithResponse("resourceGroupName", "{labName}", "{userName}", "{secretName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..d3f341d12ff8 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Secrets Get. */ +public final class SecretsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Get.json + */ + /** + * Sample code: Secrets_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .secrets() + .getWithResponse("resourceGroupName", "{labName}", "{userName}", "{secretName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..aaec5cb5aa2f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Secrets List. */ +public final class SecretsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_List.json + */ + /** + * Sample code: Secrets_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.secrets().list("resourceGroupName", "{labName}", "{userName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..dd68fa39f0e2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Secret; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Secrets Update. */ +public final class SecretsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Update.json + */ + /** + * Sample code: Secrets_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Secret resource = + manager + .secrets() + .getWithResponse("resourceGroupName", "{labName}", "{userName}", "{secretName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..207a65f5241e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateSamples.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +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; + +/** Samples for ServiceFabricSchedules CreateOrUpdate. */ +public final class ServiceFabricSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_CreateOrUpdate.json + */ + /** + * Sample code: ServiceFabricSchedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesCreateOrUpdate( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .createOrUpdateWithResponse( + "resourceGroupName", + "{labName}", + "@me", + "{serviceFrabicName}", + "{scheduleName}", + new ScheduleInner() + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTaskType( + "{Unknown|LabVmsShutdownTask|LabVmsStartupTask|LabVmReclamationTask|ComputeVmShutdownTask}") + .withWeeklyRecurrence( + new WeekDetails() + .withWeekdays( + Arrays + .asList( + "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")) + .withTime("19:00")) + .withDailyRecurrence(new DayDetails().withTime("19:00")) + .withHourlyRecurrence(new HourDetails().withMinute(0)) + .withTimeZoneId("Pacific Standard Time") + .withNotificationSettings( + new NotificationSettings() + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTimeInMinutes(15) + .withWebhookUrl("{webhoolUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("EN")) + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}"), + Context.NONE); + } + + @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/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 new file mode 100644 index 000000000000..b3099c51be7f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules Delete. */ +public final class ServiceFabricSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Delete.json + */ + /** + * Sample code: ServiceFabricSchedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .deleteWithResponse( + "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..2cc779dbfaca --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules Execute. */ +public final class ServiceFabricSchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Execute.json + */ + /** + * Sample code: ServiceFabricSchedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesExecute(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .execute("resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..8179893bce0d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules Get. */ +public final class ServiceFabricSchedulesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Get.json + */ + /** + * Sample code: ServiceFabricSchedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .getWithResponse( + "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..11abd500ce7c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules List. */ +public final class ServiceFabricSchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_List.json + */ + /** + * Sample code: ServiceFabricSchedules_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .list("resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..5c286c2f4529 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabricSchedules Update. */ +public final class ServiceFabricSchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Update.json + */ + /** + * Sample code: ServiceFabricSchedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .updateWithResponse( + "resourceGroupName", + "{labName}", + "@me", + "{serviceFrabicName}", + "{scheduleName}", + new ScheduleFragment().withTags(mapOf("tagName1", "tagValue1")), + Context.NONE); + } + + @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/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 new file mode 100644 index 000000000000..743725eaace2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabrics CreateOrUpdate. */ +public final class ServiceFabricsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_CreateOrUpdate.json + */ + /** + * Sample code: ServiceFabrics_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .define("{serviceFabricName}") + .withRegion("{location}") + .withExistingUser("resourceGroupName", "{labName}", "{userName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withExternalServiceFabricId("{serviceFabricId}") + .withEnvironmentId("{environmentId}") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..3b32348d4185 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Delete. */ +public final class ServiceFabricsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Delete.json + */ + /** + * Sample code: ServiceFabrics_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .delete("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..fc34ac9c0a00 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Get. */ +public final class ServiceFabricsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Get.json + */ + /** + * Sample code: ServiceFabrics_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .getWithResponse("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..a934bd1c1a24 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics ListApplicableSchedules. */ +public final class ServiceFabricsListApplicableSchedulesSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_ListApplicableSchedules.json + */ + /** + * Sample code: ServiceFabrics_ListApplicableSchedules. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsListApplicableSchedules( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .listApplicableSchedulesWithResponse( + "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..b80c169a7aa3 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics List. */ +public final class ServiceFabricsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_List.json + */ + /** + * Sample code: ServiceFabrics_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .list("resourceGroupName", "{labName}", "{userName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..621fa4f5d137 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Start. */ +public final class ServiceFabricsStartSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Start.json + */ + /** + * Sample code: ServiceFabrics_Start. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsStart(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .start("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..46d09443ce1b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Stop. */ +public final class ServiceFabricsStopSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Stop.json + */ + /** + * Sample code: ServiceFabrics_Stop. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsStop(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .stop("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..fd9fcac703df --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ServiceFabric; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabrics Update. */ +public final class ServiceFabricsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Update.json + */ + /** + * Sample code: ServiceFabrics_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + ServiceFabric resource = + manager + .serviceFabrics() + .getWithResponse( + "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..3525111da751 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersCreateOrUpdateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.IdentityProperties; +import com.azure.resourcemanager.devtestlabs.models.ManagedIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceRunners CreateOrUpdate. */ +public final class ServiceRunnersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_CreateOrUpdate.json + */ + /** + * Sample code: ServiceRunners_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceRunners() + .define("{servicerunnerName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{devtestlabName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withIdentity( + new IdentityProperties() + .withType(ManagedIdentityType.fromString("{identityType}")) + .withPrincipalId("{identityPrincipalId}") + .withTenantId("{identityTenantId}") + .withClientSecretUrl("{identityClientSecretUrl}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..c05d9faef517 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceRunners Delete. */ +public final class ServiceRunnersDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Delete.json + */ + /** + * Sample code: ServiceRunners_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceRunners() + .deleteWithResponse("resourceGroupName", "{devtestlabName}", "{servicerunnerName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..ae178eba7337 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceRunners Get. */ +public final class ServiceRunnersGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Get.json + */ + /** + * Sample code: ServiceRunners_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceRunners() + .getWithResponse("resourceGroupName", "{devtestlabName}", "{servicerunnerName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..6a7a1391a8a6 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersCreateOrUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.UserIdentity; +import com.azure.resourcemanager.devtestlabs.models.UserSecretStore; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Users CreateOrUpdate. */ +public final class UsersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_CreateOrUpdate.json + */ + /** + * Sample code: Users_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .users() + .define("{userName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{devtestlabName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withIdentity( + new UserIdentity() + .withPrincipalName("{principalName}") + .withPrincipalId("{principalId}") + .withTenantId("{tenantId}") + .withObjectId("{objectId}") + .withAppId("{appId}")) + .withSecretStore(new UserSecretStore().withKeyVaultUri("{keyVaultUri}").withKeyVaultId("{keyVaultId}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..99e3b1fa64ec --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Users Delete. */ +public final class UsersDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Delete.json + */ + /** + * Sample code: Users_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.users().delete("resourceGroupName", "{devtestlabName}", "{userName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..dfb95299341c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Users Get. */ +public final class UsersGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Get.json + */ + /** + * Sample code: Users_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.users().getWithResponse("resourceGroupName", "{devtestlabName}", "{userName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..c6b46d710657 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Users List. */ +public final class UsersListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_List.json + */ + /** + * Sample code: Users_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.users().list("resourceGroupName", "{devtestlabName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..2ce91c5ccdad --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.User; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Users Update. */ +public final class UsersUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Update.json + */ + /** + * Sample code: Users_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + User resource = + manager + .users() + .getWithResponse("resourceGroupName", "{devtestlabName}", "{userName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..dcd5fd3ece0b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateSamples.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +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; + +/** Samples for VirtualMachineSchedules CreateOrUpdate. */ +public final class VirtualMachineSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_CreateOrUpdate.json + */ + /** + * Sample code: VirtualMachineSchedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesCreateOrUpdate( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .createOrUpdateWithResponse( + "resourceGroupName", + "{labName}", + "{vmName}", + "LabVmsShutdown", + new ScheduleInner() + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withStatus(EnableStatus.ENABLED) + .withTaskType("LabVmsShutdownTask") + .withWeeklyRecurrence( + new WeekDetails().withWeekdays(Arrays.asList("Friday", "Saturday", "Sunday")).withTime("1700")) + .withDailyRecurrence(new DayDetails().withTime("1900")) + .withHourlyRecurrence(new HourDetails().withMinute(30)) + .withTimeZoneId("Pacific Standard Time") + .withNotificationSettings( + new NotificationSettings() + .withStatus(EnableStatus.ENABLED) + .withTimeInMinutes(30) + .withWebhookUrl("{webhookUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("EN")) + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}"), + Context.NONE); + } + + @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/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 new file mode 100644 index 000000000000..87040349fa08 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules Delete. */ +public final class VirtualMachineSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Delete.json + */ + /** + * Sample code: VirtualMachineSchedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .deleteWithResponse("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..8c0b1202761b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules Execute. */ +public final class VirtualMachineSchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Execute.json + */ + /** + * Sample code: VirtualMachineSchedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesExecute( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .execute("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..1356ac5e7fac --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules Get. */ +public final class VirtualMachineSchedulesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Get.json + */ + /** + * Sample code: VirtualMachineSchedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .getWithResponse("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..5db66d6f7e0c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules List. */ +public final class VirtualMachineSchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_List.json + */ + /** + * Sample code: VirtualMachineSchedules_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .list("resourceGroupName", "{labName}", "{vmName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..d0b9e90cfcbb --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachineSchedules Update. */ +public final class VirtualMachineSchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Update.json + */ + /** + * Sample code: VirtualMachineSchedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .updateWithResponse( + "resourceGroupName", + "{labName}", + "{vmName}", + "LabVmsShutdown", + new ScheduleFragment().withTags(mapOf("tagName1", "tagValue1")), + Context.NONE); + } + + @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/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 new file mode 100644 index 000000000000..31b99e39b348 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.AttachNewDataDiskOptions; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.StorageType; + +/** Samples for VirtualMachines AddDataDisk. */ +public final class VirtualMachinesAddDataDiskSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_AddDataDisk.json + */ + /** + * Sample code: VirtualMachines_AddDataDisk. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesAddDataDisk(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .addDataDisk( + "resourceGroupName", + "{labName}", + "{virtualMachineName}", + new DataDiskProperties() + .withAttachNewDataDiskOptions( + new AttachNewDataDiskOptions() + .withDiskSizeGiB(127) + .withDiskName("{diskName}") + .withDiskType(StorageType.fromString("{diskType}"))), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..3920dfb0937c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ApplyArtifactsRequest; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import java.util.Arrays; + +/** Samples for VirtualMachines ApplyArtifacts. */ +public final class VirtualMachinesApplyArtifactsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_ApplyArtifacts.json + */ + /** + * Sample code: VirtualMachines_ApplyArtifacts. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesApplyArtifacts(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .applyArtifacts( + "resourceGroupName", + "{labName}", + "{vmName}", + new ApplyArtifactsRequest() + .withArtifacts( + Arrays + .asList( + new ArtifactInstallProperties() + .withArtifactId( + "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/public" + + " repo/artifacts/windows-restart"))), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..a47a1b1f6b63 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Claim. */ +public final class VirtualMachinesClaimSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Claim.json + */ + /** + * Sample code: VirtualMachines_Claim. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesClaim(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().claim("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..d932ed0b0029 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesCreateOrUpdateSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachines CreateOrUpdate. */ +public final class VirtualMachinesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_CreateOrUpdate.json + */ + /** + * Sample code: VirtualMachines_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .define("{vmName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withSize("Standard_A2_v2") + .withUsername("{userName}") + .withPassword("{userPassword}") + .withLabSubnetName("{virtualNetworkName}Subnet") + .withLabVirtualNetworkId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}") + .withDisallowPublicIpAddress(true) + .withGalleryImageReference( + new GalleryImageReference() + .withOffer("UbuntuServer") + .withPublisher("Canonical") + .withSku("16.04-LTS") + .withOsType("Linux") + .withVersion("Latest")) + .withAllowClaim(true) + .withStorageType("Standard") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..78641517ba33 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Delete. */ +public final class VirtualMachinesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Delete.json + */ + /** + * Sample code: VirtualMachines_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().delete("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..f6b95d6e8eb4 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskSamples.java @@ -0,0 +1,32 @@ +// 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.Context; +import com.azure.resourcemanager.devtestlabs.models.DetachDataDiskProperties; + +/** Samples for VirtualMachines DetachDataDisk. */ +public final class VirtualMachinesDetachDataDiskSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_DetachDataDisk.json + */ + /** + * Sample code: VirtualMachines_DetachDataDisk. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesDetachDataDisk(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .detachDataDisk( + "resourceGroupName", + "{labName}", + "{virtualMachineName}", + new DetachDataDiskProperties() + .withExistingLabDiskId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{virtualMachineName}"), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..c8dff77eee9b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines GetRdpFileContents. */ +public final class VirtualMachinesGetRdpFileContentsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_GetRdpFileContents.json + */ + /** + * Sample code: VirtualMachines_GetRdpFileContents. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesGetRdpFileContents( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .getRdpFileContentsWithResponse("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..e0595dfcfca0 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Get. */ +public final class VirtualMachinesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Get.json + */ + /** + * Sample code: VirtualMachines_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().getWithResponse("resourceGroupName", "{labName}", "{vmName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..fc9f05af5781 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines ListApplicableSchedules. */ +public final class VirtualMachinesListApplicableSchedulesSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_ListApplicableSchedules.json + */ + /** + * Sample code: VirtualMachines_ListApplicableSchedules. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesListApplicableSchedules( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .listApplicableSchedulesWithResponse("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..44351579bffd --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines List. */ +public final class VirtualMachinesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_List.json + */ + /** + * Sample code: VirtualMachines_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..b48906e00ad3 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeploySamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Redeploy. */ +public final class VirtualMachinesRedeploySamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Redeploy.json + */ + /** + * Sample code: VirtualMachines_Redeploy. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesRedeploy(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().redeploy("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..6f127c934287 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ResizeLabVirtualMachineProperties; + +/** Samples for VirtualMachines Resize. */ +public final class VirtualMachinesResizeSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Resize.json + */ + /** + * Sample code: VirtualMachines_Resize. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesResize(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .resize( + "resourceGroupName", + "{labName}", + "{vmName}", + new ResizeLabVirtualMachineProperties().withSize("Standard_A4_v2"), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..4c8a3f838b60 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Restart. */ +public final class VirtualMachinesRestartSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Restart.json + */ + /** + * Sample code: VirtualMachines_Restart. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesRestart(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().restart("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..144e553e1410 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Start. */ +public final class VirtualMachinesStartSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Start.json + */ + /** + * Sample code: VirtualMachines_Start. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesStart(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().start("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..bf07c5cbc3f3 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Stop. */ +public final class VirtualMachinesStopSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Stop.json + */ + /** + * Sample code: VirtualMachines_Stop. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesStop(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().stop("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..1ebe94ed6b25 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines TransferDisks. */ +public final class VirtualMachinesTransferDisksSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_TransferDisks.json + */ + /** + * Sample code: VirtualMachines_TransferDisks. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesTransferDisks(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().transferDisks("resourceGroupName", "{labName}", "{virtualmachineName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..f7182f5e0ef1 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines UnClaim. */ +public final class VirtualMachinesUnClaimSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_UnClaim.json + */ + /** + * Sample code: VirtualMachines_UnClaim. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesUnClaim(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().unClaim("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..3aa315056e82 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachine; + +/** Samples for VirtualMachines Update. */ +public final class VirtualMachinesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Update.json + */ + /** + * Sample code: VirtualMachines_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + LabVirtualMachine resource = + manager + .virtualMachines() + .getWithResponse("resourceGroupName", "{labName}", "{vmName}", null, Context.NONE) + .getValue(); + resource.update().apply(); + } +} 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 new file mode 100644 index 000000000000..1286c2e7dfdd --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualNetworks CreateOrUpdate. */ +public final class VirtualNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_CreateOrUpdate.json + */ + /** + * Sample code: VirtualNetworks_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualNetworks() + .define("{virtualNetworkName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withTags(mapOf("tagName1", "tagValue1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..41bc1ac7d80f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks Delete. */ +public final class VirtualNetworksDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Delete.json + */ + /** + * Sample code: VirtualNetworks_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualNetworks().delete("resourceGroupName", "{labName}", "{virtualNetworkName}", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..9acfc673cd3e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks Get. */ +public final class VirtualNetworksGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Get.json + */ + /** + * Sample code: VirtualNetworks_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualNetworks() + .getWithResponse("resourceGroupName", "{labName}", "{virtualNetworkName}", null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..8ac805a47509 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks List. */ +public final class VirtualNetworksListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_List.json + */ + /** + * Sample code: VirtualNetworks_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualNetworks().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} 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 new file mode 100644 index 000000000000..39f595a09029 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.VirtualNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualNetworks Update. */ +public final class VirtualNetworksUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Update.json + */ + /** + * Sample code: VirtualNetworks_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + VirtualNetwork resource = + manager + .virtualNetworks() + .getWithResponse("resourceGroupName", "{labName}", "{virtualNetworkName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +}